Transform-based image coding method and apparatus therefor
By using the LFNST method and equipment, the image compilation process is optimized, solving the problem of high transmission and storage costs for high-resolution, high-quality images/videos, improving compilation efficiency, and adapting to the compression requirements of VR and AR content.
Patent Information
- Application Number
- CN202411589414.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-07-13
- Filing Date
- 2020-07-10
- Publication Date
- 2025-01-10
AI Technical Summary
Existing technologies are costly to transmit and store high-resolution, high-quality images/videos, and are not efficient enough for compressing images/videos for immersive media such as VR and AR content.
Using the LFNST method and equipment, the image compilation process is optimized by deriving the position and index of the transform coefficients, including zeroing operations to improve compilation efficiency.
It improves image/video compression efficiency and transform index compilation efficiency, reduces transmission and storage costs, and meets the needs of immersive media.
Smart Images

Figure CN119299685A_ABST
Abstract
Description
[0001] This application is a divisional application of a patent application with application number 202080061900.0 (PCT / KR2020 / 009128) filed on March 2, 2022, application date on July 10, 2020, and titled “Transformation-based image coding method and device thereof”. Technical Field
[0002] The present disclosure relates to an image coding technology, and more particularly, to a method and a device for coding an image based on transformation in an image coding system. Background Art
[0003] Nowadays, the demand for high-resolution and high-quality images / videos such as 4K, 8K or higher ultra-high-definition (UHD) images / videos has been growing in various fields. As image / video data becomes higher resolution and higher quality, the amount of information or bit volume sent increases compared to traditional image data. Therefore, when using a medium such as a traditional wired / wireless broadband line to send image data or using an existing storage medium to store image / video data, its transmission cost and storage cost increase.
[0004] In addition, nowadays, interest and demand for immersive media such as virtual reality (VR) and artificial reality (AR) content or holograms are increasing, and broadcasting of images / videos having image characteristics different from real images such as game images is increasing.
[0005] Therefore, there is a need for an efficient image / video compression technology that effectively compresses and transmits or stores and reproduces information of high-resolution and high-quality images / videos having various characteristics as described above. Summary of the invention
[0006] Technical issues
[0007] A technical aspect of the present disclosure is to provide a method and an apparatus for increasing image coding efficiency.
[0008] Another technical aspect of the present disclosure is to provide a method and apparatus for increasing the efficiency of transform index coding.
[0009] Yet another technical aspect of the present disclosure is to provide an image coding method and apparatus using LFNST.
[0010] Yet another technical aspect of the present disclosure is to provide a method and apparatus for image coding for performing zero-out when LFNST is applied.
[0011] Technical Solution
[0012] According to an embodiment of the present disclosure, an image decoding method performed by a decoding device is provided. The method may include: deriving the position of the last significant coefficient in the current block and the transform coefficient for the current block based on residual information; determining whether the index of the subblock including the last significant coefficient is 0 and the position of the last significant coefficient in the subblock is greater than 0; determining whether there is a significant coefficient in the second area other than the first area at the left top of the current block; when it is determined that the position of the last significant coefficient in the subblock with index 0 is greater than 0 and there is no significant coefficient in the second area, parsing the LFNST index from the bitstream; and deriving the modified transform coefficient by applying the LFNST matrix derived based on the LFNST index to the transform coefficient in the first area.
[0013] The method further includes: setting first flag information indicating whether the position of the last significant coefficient is greater than 0 in the sub-block with index 0 to 1; and when the position of the last significant coefficient in the sub-block with index 0 is greater than 0, changing the first flag information to 0 and parsing the LFNST index.
[0014] The method further includes: setting second flag information indicating whether a significant coefficient exists in a second region other than the first region to 1; and when there is no significant coefficient in the second region, maintaining the second flag information to 1 and parsing the LFNST index.
[0015] When the index of the subblock including the last significant coefficient in the current block is greater than 0 and the width and height of the current block are 4 or more, the second flag information is derived as 0, and the LFNST index is not parsed when the second flag information is 0.
[0016] When the size of the current block is 4x4 or 8x8 and the position of the last significant coefficient is greater than or equal to 8, the second flag information is derived as 0, and the LFNST index is not parsed when the second flag information is 0.
[0017] According to another embodiment of the present disclosure, there is provided an image encoding method performed by an encoding device. The method may include: deriving a transform coefficient for a current block based on a primary transform for a residual sample; deriving a modified transform coefficient for the current block based on a transform coefficient of a first region at the top left of the current block and a predetermined LFNST matrix; clearing a second region of the current block where the modified transform coefficient does not exist; constructing image information so that the index of a subblock including the last significant coefficient in the current block is 0, the position of the last significant coefficient in the subblock is greater than 0, and when there is no significant coefficient in the second region, sending an LFNST index indicating the LFNST matrix; and outputting image information including residual information derived by quantization of the modified transform coefficient and the LFNST index.
[0018] According to still another embodiment of the present disclosure, a digital storage medium storing image data including encoded image information and a bit stream generated according to an image encoding method performed by an encoding device may be provided.
[0019] According to yet another embodiment of the present disclosure, a digital storage medium storing image data including encoded image information and a bit stream for causing a decoding device to perform an image decoding method may be provided.
[0020] Beneficial Effects
[0021] According to the present disclosure, the overall image / video compression efficiency can be improved.
[0022] According to the present disclosure, the efficiency of transform index compilation can be improved.
[0023] Technical aspects of the present disclosure may provide an image coding method and apparatus using LFNST.
[0024] Technical aspects of the present disclosure may provide an image coding method and apparatus for performing zeroing when LFNST is applied.
[0025] The effects that can be obtained by the specific examples of the present disclosure are not limited to the effects listed above. For example, there may be various technical effects that can be understood or derived by ordinary technicians in the relevant field according to the present disclosure. Therefore, the specific effects of the present disclosure are not limited to those explicitly described in the present disclosure, and may include various effects that can be understood or derived according to the technical features of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 is a diagram schematically illustrating the configuration of a video / image encoding device to which the present disclosure is applicable.
[0027] Figure 2 is a diagram schematically illustrating a configuration of a video / image decoding device to which the present disclosure is applicable.
[0028] Figure 3 A multiple transformation scheme according to an embodiment of this document is schematically illustrated.
[0029] Figure 4 The intra directional mode for 65 prediction directions is shown as an example.
[0030] Figure 5 is a diagram for explaining RST according to an embodiment of this document.
[0031] Figure 6 is a diagram illustrating an arrangement of output data of a forward primary transform into a sequence of one-dimensional vectors according to an example.
[0032] Figure 7 is a diagram illustrating an arrangement of output data of a forward sub-transform into a sequence of two-dimensional vectors according to an example.
[0033] Figure 8 is a diagram illustrating a wide-angle intra prediction mode according to an embodiment of this document.
[0034] Fig. 9 is a diagram illustrating a block shape to which LFNST is applied.
[0035] Fig.10 is a diagram illustrating an arrangement of output data of a forward LFNST according to an example.
[0036] Fig.11 is a diagram illustrating limiting the number of output data for a forward LFNST to a maximum value of 16 according to an example.
[0037] Fig.12 is a diagram illustrating zero-out in a block to which 4×4 LFNST is applied according to an example.
[0038] Fig.13 is a diagram illustrating clearing in a block to which 8×8 LFNST is applied according to an example.
[0039] Fig.14 is a diagram illustrating clearing in a block to which 8×8 LFNST is applied according to another example.
[0040] Fig.15 is a flowchart for explaining an image decoding method according to an example.
[0041] Fig.16 is a flowchart for explaining an image encoding method according to an example.
[0042] Fig.17 An example of a video / image coding system to which the present disclosure is applicable is schematically illustrated.
[0043] Fig.18 The structure of a content streaming system to which the present disclosure is applied is illustrated. DETAILED DESCRIPTION
[0044] Although the present disclosure may be susceptible to various modifications and includes various embodiments, its specific embodiments have been shown by way of example in the accompanying drawings, and will now be described in detail. However, this is not intended to limit the present disclosure to the specific embodiments disclosed herein. The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the technical ideas of the present disclosure. Unless the context clearly indicates otherwise, the singular form may include the plural form. Terms such as "including" and "having" are intended to indicate the presence of features, numbers, steps, operations, elements, components, or combinations thereof used in the following description, and therefore should not be understood as precluding the possibility of the presence or addition of one or more different features, numbers, steps, operations, elements, components, or combinations thereof.
[0045] In addition, for the convenience of describing the different characteristic functions, each component on the drawings described herein is illustrated independently, however, it is not intended that each component is implemented by separate hardware or software. For example, any two or more of these components can be combined to form a single component, and any single component can be divided into multiple components. Embodiments in which components are combined and / or divided will fall within the scope of the patent rights of the present disclosure as long as they do not depart from the essence of the present disclosure.
[0046] Hereinafter, preferred embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. In addition, in the accompanying drawings, the same reference numerals are used for the same components, and repeated description of the same components will be omitted.
[0047] This document relates to video / image coding. For example, the methods / examples disclosed in this document may relate to the VVC (Versatile Video Coding) standard (ITU-T Rec. H.266), the next generation video / image coding standard after VVC, or other video coding related standards (e.g., HEVC (High Efficiency Video Coding) standard (ITU-T Rec. H.265), EVC (Basic Video Coding) standard, AVS2 standard, etc.).
[0048] In this document, various embodiments related to video / image coding may be provided, and unless otherwise specified, the embodiments may be combined with each other and performed.
[0049] In this document, a video may refer to a collection of a series of images over a period of time. Typically, a picture refers to a unit of an image representing a specific time region, and a slice / tile is a unit that constitutes a part of a picture. A slice / tile may include one or more coding tree units (CTUs). A picture may consist of one or more slices / tiles. A picture may consist of one or more tile groups. A tile group may include one or more tiles.
[0050] A pixel or a picture element (pel) may refer to the smallest unit constituting a picture (or image). In addition, a "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component. Alternatively, a sample may mean a pixel value in a spatial domain, or when the pixel value is transformed into a frequency domain, it may mean a transform coefficient in a frequency domain.
[0051] A unit may represent a basic unit of image processing. A unit may include at least one of a specific region and information related to the region. A unit may include a luminance block and two chrominance (e.g., cb, cr) blocks. Depending on the situation, terms such as unit, block, region, etc. may be used interchangeably. In general, an M×N block may include a set (or array) of samples (or sample arrays) or transform coefficients consisting of M columns and N rows.
[0052] In this document, the terms " / " and "," should be interpreted as indicating "and / or". For example, the expression "A / B" may mean "A and / or B". In addition, "A, B" may mean "A and / or B". In addition, "A / B / C" may mean "at least one of A, B, and / or C". In addition, "A / B / C" may mean "at least one of A, B, and / or C".
[0053] In addition, in this document, the term "or" should be interpreted as indicating "and / or". For example, the expression "A or B" may include 1) only A, 2) only B, and / or 3) both A and B. In other words, the term "or" in this document should be interpreted as indicating "additionally or alternatively".
[0054] In the present disclosure, "at least one of A and B" may mean "only A", "only B", or "both A and B". In addition, in the present disclosure, the expression "at least one of A or B" or "at least one of A and / or B" may be interpreted as "at least one of A and B".
[0055] Furthermore, in the present disclosure, “at least one of A, B, and C” may mean “only A”, “only B”, “only C”, or “any combination of A, B, and C”. Furthermore, “at least one of A, B, or C” or “at least one of A, B and / or C” may mean “at least one of A, B, and C”.
[0056] In addition, the brackets used in the present disclosure may mean "for example". Specifically, when the indication is "prediction (intra-frame prediction)", it may mean that "intra-frame prediction" is proposed as an example of "prediction". In other words, the "prediction" of the present disclosure is not limited to "intra-frame prediction", and "intra-frame prediction" is proposed as an example of "prediction". In addition, when the indication is "prediction (ie, intra-frame prediction)", this may also mean that "intra-frame prediction" is proposed as an example of "prediction".
[0057] Technical features described separately in one drawing in the present disclosure may be implemented separately or may be implemented simultaneously.
[0058] Figure 1 is a schematic diagram illustrating a configuration of a video / image encoding device to which an embodiment of the present document can be applied. Hereinafter, a video encoding device may include an image encoding device.
[0059] refer to Figure 1 , the encoding device 100 includes an image partitioner 110, a predictor 120, a residual processor 130, and an entropy encoder 140, an adder 150, a filter 160, and a memory 170. The predictor 120 may include an inter-frame predictor 121 and an intra-frame predictor 122. The residual processor 130 may include a transformer 132, a quantizer 133, a dequantizer 134, and an inverse transformer 135. The residual processor 130 may also include a subtractor 131. The adder 150 may be referred to as a reconstructor or a reconstructed block generator. According to an embodiment, the image partitioner 110, the predictor 120, the residual processor 130, the entropy encoder 140, the adder 150, and the filter 160 may be configured by at least one hardware component (e.g., an encoder chipset or processor). In addition, the memory 170 may include a decoded picture buffer (DPB) or may be configured by a digital storage medium. The hardware component may also include the memory 170 as an internal / external component.
[0060] The image partitioner 110 may partition an input image (or picture or frame) input to the encoding device 100 into one or more processing units. For example, a processor may be referred to as a coding unit (CU). In this case, the coding unit may be recursively partitioned from a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree binary tree ternary tree (QTBTTT) structure. For example, a coding unit may be partitioned into multiple coding units of a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary tree structure. In this case, for example, a quadtree structure may be applied first and a binary tree structure and / or a ternary tree structure may be applied later. Alternatively, a binary tree structure may be applied first. The coding process according to this document may be performed based on a final coding unit that is no longer partitioned. In this case, the maximum coding unit may be used as the final coding unit based on coding efficiency according to image characteristics, or, if necessary, the coding unit may be recursively partitioned into deeper coding units and a coding unit with an optimal size may be used as the final coding unit. Here, the coding process may include a process of prediction, transformation, and reconstruction, which will be described later. As another example, the processor may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may be split or partitioned from the aforementioned final coding unit. The prediction unit may be a unit for sample prediction, and the transform unit may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from a transform coefficient.
[0061] In some cases, a unit may be used interchangeably with terms such as a block or region. In general, an M×N block may represent a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally represent a pixel or a value of a pixel, may represent only a pixel / pixel value of a luminance component, or may represent only a pixel / pixel value of a chrominance component. A sample may be used as a term corresponding to one picture (or image) of a pixel or a pel.
[0062] In the encoding device 100, a prediction signal (prediction block, prediction sample array) output from the inter predictor 121 or the intra predictor 122 is subtracted from an input image signal (original block, original sample array) to generate a residual signal (residual block, residual sample array), and the generated residual signal is sent to the transformer 132. In this case, as shown, the unit for subtracting the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) in the encoding device 100 can be referred to as a subtractor 131. The predictor may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a prediction block including prediction samples for the current block. The predictor may determine whether intra prediction or inter prediction is applied on a current block or CU basis. As described later in the description of each prediction mode, the predictor may generate various information related to prediction, such as prediction mode information, and send the generated information to the entropy encoder 140. Information about the prediction may be encoded in the entropy encoder 140 and output in the form of a bitstream.
[0063] The intra-frame predictor 122 can predict the current block by referring to the samples in the current picture. The referenced samples can be located near the current block or can be spaced according to the prediction mode. In intra-frame prediction, the prediction mode may include multiple non-directional modes and multiple directional modes. The non-directional mode may include, for example, a DC mode and a plane mode. Depending on the level of detail of the prediction direction, the directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is only an example, and more or less directional prediction modes may be used depending on the setting. The intra-frame predictor 122 can determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring block.
[0064] The inter-frame predictor 121 may derive a prediction block of the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. Here, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter-frame prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter-frame predictor 121 may construct a motion information candidate list based on the neighboring blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter-frame prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter-frame predictor 121 may use the motion information of the neighboring block as the motion information of the current block. In the skip mode, unlike the merge mode, the residual signal may not be transmitted. In the case of the motion vector prediction (MVP) mode, the motion vector of the neighboring block may be used as a motion vector predictor and the motion vector of the current block may be indicated by signaling the motion vector difference.
[0065] The predictor 120 may generate a prediction signal based on various prediction methods described below. For example, the predictor may not only apply intra prediction or inter prediction to predict a block, but also apply intra prediction and inter prediction simultaneously. This may be referred to as combined inter and intra prediction (CIIP). In addition, the predictor may be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding of games, such as screen content coding (SCC). IBC basically performs prediction in the current picture, but may be performed similarly to inter prediction because a reference block is derived in the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document. The palette mode may be considered an example of intra coding or intra coding. When the palette mode is applied, the sample values within the picture may be signaled based on information about the palette table and the palette index.
[0066] The prediction signal generated by the predictor (including the inter-frame predictor 121 and / or the intra-frame predictor 122) can be used to generate a reconstruction signal or to generate a residual signal. The transformer 132 can generate a transform coefficient by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a karhunen-loève transform (KLT), a graph-based transform (GBT), or a conditional nonlinear transform (CNT). Here, GBT means a transform obtained from a graph when the relationship information between pixels is represented by a graph. CNT refers to a transform generated based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process can be applied to square pixel blocks of the same size or can be applied to blocks of variable size rather than square.
[0067] The quantizer 133 may quantize the transform coefficients and send them to the entropy encoder 140, and the entropy encoder 140 may encode the quantized signal (information about the quantized transform coefficients) and output a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantizer 133 may rearrange the block type quantized transform coefficients into a one-dimensional vector form based on the coefficient scanning order and generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. Information about the transform coefficients may be generated. The entropy encoder 140 may perform various encoding methods such as, for example, exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 140 may encode information necessary for video / image reconstruction other than the quantized transform coefficients (e.g., the values of syntax elements, etc.) together or separately. The encoding information (e.g., encoded video / image information) may be transmitted or stored in units of NAL (network abstraction layer) in the form of a bitstream. The video / image information may also include information about various parameter sets such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may also include general constraint information. In this document, information and / or syntax elements sent / signaled from an encoding device to a decoding device may be included in the video / picture information. The video / image information may be encoded by the above-mentioned encoding process and included in a bitstream. The bitstream may be sent over a network or may be stored in a digital storage medium. The network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) that transmits a signal output from the entropy encoder 140 and / or a storage unit (not shown) that stores the signal may be included as an internal / external element of the encoding device 100, and alternatively, the transmitter may be included in the entropy encoder 140.
[0068] The quantized transform coefficients output from the quantizer 133 can be used to generate a prediction signal. For example, the residual signal (residual block or residual sample) can be reconstructed by applying dequantization and inverse transformation to the quantized transform coefficients via the dequantizer 134 and the inverse transformer 135. The adder 150 adds the reconstructed residual signal to the prediction signal output from the inter-frame predictor 121 or the intra-frame predictor 122 to generate a reconstructed signal (reconstructed image, reconstructed block, reconstructed sample array). If the block to be processed has no residual, such as the case where the skip mode is applied, the prediction block can be used as a reconstructed block. The adder 150 can be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used to perform intra-frame prediction on the next block to be processed in the current picture and can be used to perform inter-frame prediction on the next picture by filtering as described below.
[0069] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during picture encoding and / or reconstruction.
[0070] The filter 160 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 160 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture and store the modified reconstructed picture in the memory 170 (specifically, the DPB of the memory 170). Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. The filter 160 can generate various information related to filtering as described later in the description of each filtering method and send the generated information to the entropy encoder 140. The information related to filtering can be encoded by the entropy encoder 140 and output in the form of a bit stream.
[0071] The modified reconstructed picture transmitted to the memory 170 may be used as a reference picture in the inter predictor 121. When inter prediction is applied by the encoding device, prediction mismatch between the encoding device 100 and the decoding device may be avoided and encoding efficiency may be improved.
[0072] The DPB of the memory 170 may store the modified reconstructed picture for use as a reference picture in the inter-frame predictor 121. The memory 170 may store the motion information of the block from which the motion information in the current picture is derived (or encoded) and / or the motion information of the reconstructed block in the picture. The stored motion information may be sent to the inter-frame predictor 121 and used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 170 may store the reconstructed samples of the reconstructed block in the current picture and may transmit the reconstructed samples to the intra-frame predictor 122.
[0073] Figure 2 is a schematic diagram illustrating a configuration of a video / image decoding device to which an embodiment of this document can be applied.
[0074] refer to Figure 2 , the decoding device 200 may include an entropy decoder 210, a residual processor 220, a predictor 230, an adder 240, a filter 250, and a memory 260. The predictor 230 may include an inter-frame predictor 231 and an intra-frame predictor 232. The residual processor 220 may include a dequantizer 221 and an inverse transformer 221. According to an embodiment, the entropy decoder 210, the residual processor 220, the predictor 230, the adder 240, and the filter 250 may be configured by a hardware component (e.g., a decoder chipset or a processor). In addition, the memory 260 may include a decoded picture buffer (DPB) or may be configured by a digital storage medium. The hardware component may also include a memory 260 as an internal / external component.
[0075] When a bit stream including video / image information is input, the decoding apparatus 200 can reconstruct the bit stream corresponding to the bit stream in the video / image format. Figure 1 The decoding device 200 may derive a unit / block based on block partition related information obtained from a bitstream. The decoding device 200 may perform decoding using a processor applied in the encoding device. Therefore, the decoding processor may be, for example, a coding unit, and the coding unit may be partitioned from a coding tree unit or a maximum coding unit according to a quadtree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units may be derived from the coding unit. The reconstructed image signal decoded and output by the decoding device 200 may be reproduced by a reproduction device.
[0076] The decoding device 200 can receive the Figure 1The signal output by the encoding device of the encoding device, and the received signal can be decoded by the entropy decoder 210. For example, the entropy decoder 210 can parse the bitstream to derive information (e.g., video / image information) necessary for image reconstruction (or picture reconstruction). The video / image information may also include information about various parameter sets such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may also include general constraint information. The decoding device may also decode the picture based on the information about the parameter set and / or the general constraint information. The information and / or syntax elements signaled / received described later in this document may be decoded and obtained from the bitstream by a decoding process. For example, the entropy decoder 210 decodes the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and outputs syntax elements required for image reconstruction and quantized values of transform coefficients for the residual. More specifically, the CABAC entropy decoding method may receive a bin corresponding to each syntax element in a bitstream, use the decoded information of the decoded target syntax element information, the decoded information of the decoded target block, or the information of the symbol / bin decoded in the previous stage to determine the context model, and perform arithmetic decoding on the bin by predicting the probability of occurrence of the bin according to the determined context model, and generate a symbol corresponding to the value of each syntax element. In this case, the CABAC entropy decoding method may update the context model by using the decoded symbol / bin information for the context model of the next symbol / bin after determining the context model. The information related to prediction among the information decoded by the entropy decoder 210 may be provided to the predictor (inter-frame predictor 232 and intra-frame predictor 231), and the residual value, i.e., the quantized transform coefficient and the related parameter information, which are entropy decoded in the entropy decoder 210, may be input to the residual processor 220. The residual processor 220 may derive a residual signal (residual block, residual sample, residual sample array). In addition, information about filtering among the information decoded by the entropy decoder 210 may be provided to the filter 250. Meanwhile, a receiver (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 receiver may be a component of the entropy decoder 210. Meanwhile, the decoding device according to the present document may be referred to as a video / image / picture decoding device, and the decoding device may be classified into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder).The information decoder may include an entropy decoder 210 , and the sample decoder may include at least one of a dequantizer 221 , an inverse transformer 222 , an adder 240 , a filter 250 , a memory 260 , an inter predictor 232 , and an intra predictor 231 .
[0077] The dequantizer 221 may dequantize the quantized transform coefficient and output the transform coefficient. The dequantizer 221 may rearrange the quantized transform coefficient in the form of a two-dimensional block form. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the encoding device. The dequantizer 221 may perform dequantization on the quantized transform coefficient by using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficient.
[0078] The inverse transformer 222 performs an inverse transform on the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0079] The predictor may perform prediction on the current block and generate a prediction block including prediction samples of the current block. The predictor may determine whether to apply intra prediction or inter prediction to the current block based on information about the prediction output from the entropy decoder 210 and may determine a specific intra / inter prediction mode.
[0080] The predictor 220 may generate a prediction signal based on various prediction methods described below. For example, the predictor may not only apply intra prediction or inter prediction to predict a block, but also apply intra prediction and inter prediction simultaneously. This may be referred to as combined inter and intra prediction (CIIP). In addition, the predictor may be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding of games, such as screen content coding (SCC). IBC basically performs prediction in the current picture, but may be performed similarly to inter prediction because a reference block is derived in the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document. The palette mode may be considered an example of intra coding or intra coding. When the palette mode is applied, the sample values within the picture may be signaled based on information about the palette table and the palette index.
[0081] The intra-frame predictor 231 can predict the current block by referring to samples in the current picture. The reference samples can be located near the current block or can be spaced according to the prediction mode. In intra-frame prediction, the prediction mode can include multiple non-directional modes and multiple directional modes. The intra-frame predictor 231 can determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring block.
[0082] The inter-frame predictor 232 may derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter-frame prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter-frame predictor 232 may construct a motion information candidate list based on the neighboring blocks and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Inter-frame prediction may be performed based on various prediction modes, and information about the prediction may include information indicating a mode of inter-frame prediction for the current block.
[0083] The adder 240 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the predictor (including the inter-frame predictor 232 and / or the intra-frame predictor 231). If the block to be processed has no residual, such as when the skip mode is applied, the prediction block can be used as the reconstructed block.
[0084] The adder 240 may be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next block to be processed in the current picture, may be output through filtering as described below, or may be used for inter prediction of the next picture.
[0085] Meanwhile, luminance mapping with chroma scaling (LMCS) can be applied during picture decoding.
[0086] The filter 250 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 250 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture and store the modified reconstructed picture in the memory 260 (specifically, the DPB of the memory 260). Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.
[0087] The (modified) reconstructed picture stored in the DPB of the memory 260 may be used as a reference picture in the inter-frame predictor 232. The memory 260 may store the motion information of the block from which the motion information in the current picture is derived (or decoded) and / or the motion information of the block that has been reconstructed in the picture. The stored motion information may be sent to the inter-frame predictor 160 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 260 may store the reconstructed samples of the reconstructed block in the current picture and send the reconstructed samples to the intra-frame predictor 231.
[0088] In this document, the embodiments described in the filter 160, the inter-frame predictor 121, and the intra-frame predictor 122 of the encoding device 100 may be the same as the filter 250, the inter-frame predictor 232, and the intra-frame predictor 231 of the decoding device 200 or correspond to the filter 250, the inter-frame predictor 232, and the intra-frame predictor 231 of the decoding device 200, respectively.
[0089] As described above, in performing video coding, prediction is performed to improve compression efficiency. A prediction block including prediction samples for a current block, i.e., a target coding block, can be generated by prediction. In this case, the prediction block includes prediction samples in a spatial domain (or a pixel domain). The prediction block is derived identically in the encoding device and the decoding device. The encoding device can improve image coding efficiency by signaling information (residual information) about the residual between the original block, rather than the original sample value of the original block itself, and the prediction block to the decoding device. The decoding device can derive a residual block including residual samples based on the residual information, can generate a reconstructed image including reconstructed samples by adding the residual block and the prediction block, and can generate a reconstructed picture including the reconstructed block.
[0090] The residual information may be generated by a transformation and quantization process. For example, the encoding device may derive a residual block between the original block and the prediction block, may derive a transform coefficient by performing a transformation process on a residual sample (residual sample array) included in the residual block, may derive a quantized transform coefficient by performing a quantization process on the transform coefficient, and may signal the relevant residual information to the decoding device (through a bitstream). In this case, the residual information may include information such as value information, position information, transformation scheme, transform kernel, and quantization parameter of the quantized transform coefficient. The decoding device may perform a dequantization / inverse transformation process based on the residual information, and may derive a residual sample (or residual block). The decoding device may generate a reconstructed picture based on the prediction block and the residual block. In addition, the encoding device may derive a residual block for reference to inter-frame prediction of a subsequent picture by dequantizing / inverse transforming the quantized transform coefficient, and may generate a reconstructed picture.
[0091] Figure 3The multiple transformation technology according to an embodiment of the present disclosure is schematically illustrated.
[0092] refer to Figure 3 , the transformer can correspond to the previous Figure 1 The converter in the encoding device, and the inverse converter may correspond to the previous Figure 1 The inverse transformer in the encoding device of Figure 2 An inverse transformer in a decoding device.
[0093] The transformer may derive (primary) transform coefficients by performing a primary transform based on the residual samples (residual sample array) in the residual block (S310). This primary transform may be referred to as a core transform. In this document, the primary transform may be based on a multi-transform selection (MTS), and when a multi-transform is applied as the primary transform, it may be referred to as a multi-core transform.
[0094] The multi-core transform may refer to a method of performing transform using discrete cosine transform (DCT) type 2 and discrete sine transform (DST) type 7, DCT type 8, and / or DST type 1 additionally. That is, the multi-core transform may refer to a transform method of transforming a residual signal (or residual block) in the spatial domain into a transform coefficient (or primary transform coefficient) in the frequency domain based on a plurality of transform kernels selected from DCT type 2, DST type 7, DCT type 8, and DST type 1. In this article, the primary transform coefficient may be referred to as a temporary transform coefficient from the perspective of the transformer.
[0095] In other words, when a conventional transform method is applied, a transform coefficient can be generated by applying a transform from the spatial domain to the frequency domain to a residual signal (or residual block) based on DCT type 2. In contrast, when a multi-core transform is applied, a transform coefficient (or primary transform coefficient) can be generated by applying a transform from the spatial domain to the frequency domain to a residual signal (or residual block) based on DCT type 2, DST type 7, DCT type 8, and / or DST type 1. In this document, DCT type 2, DST type 7, DCT type 8, and DST type 1 may be referred to as a transform type, a transform kernel, or a transform core. These DCT / DST transform types may be defined based on basis functions.
[0096] When performing a multi-core transform, a vertical transform core and a horizontal transform core for a target block may be selected from the transform cores, a vertical transform may be performed on the target block based on the vertical transform core, and a horizontal transform may be performed on the target block based on the horizontal transform core. Here, the horizontal transform may indicate a transform of a horizontal component of the target block, and the vertical transform may indicate a transform of a vertical component of the target block. The vertical transform core / horizontal transform core may be adaptively determined based on a prediction mode and / or a transform index of a target (CU or subblock) including a residual block.
[0097] In addition, according to the example, if the primary transform is performed by applying MTS, the mapping relationship of the transform kernel can be set by setting a specific basis function to a predetermined value and combining the basis functions to be applied in the vertical transform or the horizontal transform. For example, when the horizontal transform kernel is represented as trTypeHor and the vertical transform kernel is represented as trTypeVer, trTypeHor or trTypeVer with a value of 0 can be set to DCT2, trTypeHor or trTypeVer with a value of 1 can be set to DST7, and trTypeHor or trTypeVer with a value of 2 can be set to DCT8.
[0098] In this case, the MTS index information may be encoded and signaled to the decoding device to indicate any one of the plurality of transform kernel sets. For example, an MTS index of 0 may indicate that both trTypeHor and trTypeVer values are 0, an MTS index of 1 may indicate that both trTypeHor and trTypeVer values are 1, an MTS index of 2 may indicate that both trTypeHor and trTypeVer values are 2, an MTS index of 3 may indicate that both trTypeHor and trTypeVer values are 1, and an MTS index of 4 may indicate that both trTypeHor and trTypeVer values are 2.
[0099] In one example, the transformation core set according to the MTS index information is shown in the following table.
[0100] [Table 1]
[0101] tu_mts_idx[x0][y0] 0 1 2 3 4 trTypeHor 0 1 2 1 2 trTvpeVer 0 1 1 2 2
[0102] The transformer may derive modified (secondary) transform coefficients (S320) by performing a secondary transform based on the (primary) transform coefficients. The primary transform is a transform from the spatial domain to the frequency domain, while the secondary transform refers to a transform into a more compressive representation by using the correlation between the (primary) transform coefficients. The secondary transform may include an inseparable transform. In this case, the secondary transform may be referred to as an inseparable secondary transform (NSST) or a mode-dependent inseparable secondary transform (MDNSST). An inseparable secondary transform may represent a transform that generates a modified transform coefficient (or secondary transform coefficient) for a residual signal by performing a secondary transform on the (primary) transform coefficients derived by the primary transform based on an inseparable transform matrix. At this time, the vertical transform and the horizontal transform may not be applied separately to the (primary) transform coefficients (or the horizontal transform and the vertical transform may not be applied independently), but the transform may be applied once based on the inseparable transform matrix. In other words, the inseparable secondary transform may refer to a transform method in which the vertical component and the horizontal component of the (primary) transform coefficient are not separated, and, for example, a two-dimensional signal (transform coefficient) is rearranged into a one-dimensional signal through a certain determined direction (e.g., a row first direction or a column first direction), and then the modified transform coefficient (or secondary transform coefficient) is generated based on the inseparable transform matrix. For example, according to the row priority order, the M×N blocks are arranged in a row in the order of the first row, the second row, ..., and the Nth row. According to the column priority order, the M×N blocks are arranged in a row in the order of the first column, the second column, ..., and the Mth column. The inseparable secondary transform may be applied to the left top area of a block configured with (primary) transform coefficients (hereinafter, may be referred to as a transform coefficient block). 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 inseparable secondary transform may be applied to the left top 8×8 area of the transform coefficient block. In addition, if the width (W) and height (H) of the transform coefficient block are both equal to or greater than 4, and the width (W) or height (H) of the transform coefficient block is less than 8, a 4×4 non-separable sub-transform may be applied to the top left min(8,W)×min(8,H) region of the transform coefficient block. However, the embodiment is not limited thereto, and for example, even if only the condition that the width (W) or height (H) of the transform coefficient block is equal to or greater than 4 is satisfied, a 4×4 non-separable sub-transform may be applied to the top left min(8,W)×min(8,H) region of the transform coefficient block.
[0103] Specifically, for example, if a 4×4 input block is used, the non-separable secondary transform may be performed as follows.
[0104] A 4×4 input block X can be represented as follows.
[0105] [Formula 1]
[0106]
[0107] If X is represented as a vector, then the vector It can be expressed as follows.
[0108] [Formula 2]
[0109]
[0110] In formula 2, the vector is a one-dimensional vector obtained by rearranging the two-dimensional block X of Equation 1 according to the row-major order.
[0111] In this case, the inseparable secondary transform can be calculated as follows.
[0112] [Formula 3]
[0113]
[0114] In this formula, denotes a transform coefficient vector and T denotes a 16×16 (non-separable) transform matrix.
[0115] By using the above formula 3, the 16×1 transform coefficient vector can be derived And the vector can be divided into two parts by scanning order (horizontally, vertically, diagonally, etc.) Reorganized into 4×4 blocks. However, the above calculation is an example, and Hypercube-Givens Transform (HyGT) or the like may also be used for the calculation of the inseparable secondary transform in order to reduce the calculation complexity of the inseparable secondary transform.
[0116] Furthermore, in the inseparable secondary transform, the transform kernel (or transform core, transform type) may be selected to be mode-dependent. In this case, the mode may include an intra prediction mode and / or an inter prediction mode.
[0117] As described above, an inseparable secondary transform may be performed based on an 8×8 transform or a 4×4 transform determined based on the width (W) and height (H) of the transform coefficient block. The 8×8 transform refers to a transform that can be applied to an 8×8 region included in a transform coefficient block when both W and H are equal to or greater than 8, and the 8×8 region may be the top left 8×8 region in the transform coefficient block. Similarly, the 4×4 transform refers to a transform that can be applied to a 4×4 region included in a transform coefficient block when both W and H are equal to or greater than 4, and the 4×4 region may be the top left 4×4 region in the transform coefficient block. For example, an 8×8 transform kernel matrix may be a 64×64 / 16×64 matrix, and a 4×4 transform kernel matrix may be a 16×16 / 8×16 matrix.
[0118] Here, in order to select the mode-dependent transform cores, two inseparable secondary transform cores may be configured for each transform set of inseparable secondary transforms for both the 8×8 transform and the 4×4 transform, and there may be four transform sets. That is, four transform sets may be configured for the 8×8 transform, and four transform sets may be configured for the 4×4 transform. In this case, each of the four transform sets for the 8×8 transform may include two 8×8 transform cores, and each of the four transform sets for the 4×4 transform may include two 4×4 transform cores.
[0119] However, as the size of the transform (ie, the size of the region to which the transform is applied) may be, for example, a size other than 8×8 or 4×4, the number of sets may be n, and the number of transform kernels in each set may be k.
[0120] The transform set may be referred to as an NSST set or a LFNST set. A specific set among the transform sets may be selected, for example, based on the intra prediction mode of the current block (CU or subblock). A low frequency non-separable transform (LFNST) may be an example of a reduced non-separable transform, which will be described later, and represents a non-separable transform for a low frequency component.
[0121] For reference, for example, the intra prediction mode may include two non-directional (or non-angle) intra prediction modes and 65 directional (or angle) intra prediction modes. The non-directional intra prediction mode may include a plane intra prediction mode No. 0 and a DC intra prediction mode No. 1, and the directional intra prediction mode may include 65 intra prediction modes No. 2 to No. 66. However, this is an example, and this document may be applied even if the number of intra prediction modes is different. In addition, in some cases, intra prediction mode No. 67 may also be used, and intra prediction mode No. 67 may represent a linear model (LM) mode.
[0122] Figure 4 The intra directional mode for 65 prediction directions is schematically shown.
[0123] Reference Figure 4 , based on the intra prediction mode 34 having the upper left diagonal prediction direction, the intra prediction mode can be divided into an intra prediction mode having a horizontal directionality and an intra prediction mode having a vertical directionality. Figure 4In , H and V indicate horizontal directivity and vertical directivity, respectively, and numbers -32 to 32 indicate displacements of 1 / 32 units on sample grid positions. These numbers may represent offsets for mode index values. Intra-prediction modes 2 to 33 have horizontal directivity, and intra-prediction modes 34 to 66 have vertical directivity. Strictly speaking, intra-prediction mode 34 may be considered to be neither horizontal nor vertical, but may be classified as belonging to horizontal directivity when determining a transform set for a secondary transform. This is because the input data is transposed for a vertical orientation mode symmetrical based on intra-prediction mode 34, and an input data alignment method for a horizontal mode is used for intra-prediction mode 34. Transposing the input data means switching rows and columns of two-dimensional M×N block data to N×M data. Intra-prediction mode 18 and intra-prediction mode 50 may represent a horizontal intra-prediction mode and a vertical intra-prediction mode, respectively, and intra-prediction mode 2 may be referred to as an upper right diagonal intra-prediction mode because intra-prediction mode 2 has a left reference pixel and performs prediction in the upper right direction. Similarly, intra-prediction mode 34 may be referred to as a bottom-right diagonal intra-prediction mode, and intra-prediction mode 66 may be referred to as a bottom-left diagonal intra-prediction mode.
[0124] According to an example, four transform sets according to intra prediction modes may be mapped, for example, as shown in the following table.
[0125] [Table 2]
[0126] lfnstPredModeIntra lfnstTrSetIdx lfnstPredModeIntra<0 1 0<=lfnstPredModeIntra<=1 0 2<=lfnstPredModeIntra<=12 1 13<=lfnstPredModeIntra<=23 2 24<=lfnstPredModeIntra<=44 3 45<=lfnstPredModeIntra<=55 2 56<=lfnstPredModeIntra<=80 1 81<=lfnstPredModeIntra<=83 0
[0127] As shown in Table 2, any one of four transform sets, ie, lfnstTrSetIdx, may be mapped to any one of four indexes (ie, 0 to 3) according to the intra prediction mode.
[0128] When it is determined that a specific set is used for an inseparable transform, one of the k transform cores in the specific set can be selected by an inseparable secondary transform index. The encoding device can derive an inseparable secondary transform index indicating a specific transform core based on a rate-distortion (RD) check, and can signal the inseparable secondary transform index to the decoding device. The decoding device can select one of the k transform cores in a specific set based on the inseparable secondary transform index. For example, lfnst index value 0 can refer to a first inseparable secondary transform core, lfnst index value 1 can refer to a second inseparable secondary transform core, and lfnst index value 2 can refer to a third inseparable secondary transform core. Alternatively, lfnst index value 0 can indicate that the first inseparable secondary transform is not applied to the target block, and lfnst index values 1 to 3 can indicate three transform cores.
[0129] The transformer can perform an inseparable secondary transform based on the selected transform kernel, and can obtain modified (secondary) transform coefficients. As described above, the modified transform coefficients can be derived as transform coefficients quantized by a quantizer, and can be encoded and signaled to a decoding device, and transmitted to a dequantizer / inverse transformer in an encoding device.
[0130] In addition, as described above, if the secondary transform is omitted, the (primary) transform coefficients that are the output of the primary (separable) transform can be derived as transform coefficients quantized by the quantizer as described above, and can be encoded and signaled to the decoding device and transmitted to the dequantizer / inverse transformer in the encoding device.
[0131] The inverse transformer may perform a series of processes in the reverse order of the order already performed in the above-mentioned transformer. The inverse transformer may receive (dequantized) transform coefficients, and derive (primary) transform coefficients by performing a secondary (inverse) transform (S350), and may obtain a residual block (residual sample) by performing a primary (inverse) transform on the (primary) transform coefficients (S360). In this regard, from the perspective of the inverse transformer, the primary transform coefficients may be referred to as modified transform coefficients. As described above, the encoding device and the decoding device may generate a reconstructed block based on the residual block and the prediction block, and may generate a reconstructed picture based on the reconstructed block.
[0132] The decoding device may further include a secondary inverse transform application determiner (or an element for determining whether to apply a secondary inverse transform) and a secondary inverse transform determiner (or an element for determining a secondary inverse transform). The secondary inverse transform application determiner may determine whether to apply a secondary inverse transform. For example, the secondary inverse transform may be NSST, RST, or LFNST, and the secondary inverse transform application determiner may determine whether to apply a secondary inverse transform based on a secondary transform flag obtained by parsing a bitstream. In another example, the secondary inverse transform application determiner may determine whether to apply a secondary inverse transform based on a transform coefficient of a residual block.
[0133] The secondary inverse transform determiner may determine the secondary inverse transform. In this case, the secondary inverse transform determiner may determine the secondary inverse transform applied to the current block based on the LFNST (NSST or RST) transform set specified according to the intra prediction mode. In an embodiment, the secondary transform determination method may be determined depending on the primary transform determination method. Various combinations of the primary transform and the secondary transform may be determined according to the intra prediction mode. In addition, in an example, the secondary inverse transform determiner may determine the area to which the secondary inverse transform is applied based on the size of the current block.
[0134] In addition, as described above, if the secondary (inverse) transform is omitted, the (dequantized) transform coefficients can be received, the primary (separable) inverse transform can be performed, and the residual block (residual sample) can be obtained. As described above, the encoding device and the decoding device can generate a reconstructed block based on the residual block and the prediction block, and can generate a reconstructed picture based on the reconstructed block.
[0135] Furthermore, in the present disclosure, a reduced secondary transform (RST) in which the size of a transformation matrix (kernel) is reduced may be applied in the concept of NSST in order to reduce the amount of calculation and storage required for an inseparable secondary transform.
[0136] In addition, the transformation kernel, transformation matrix, and coefficients constituting the transformation kernel matrix described in the present disclosure, that is, the kernel coefficients or matrix coefficients, can be represented by 8 bits. This can be a condition for implementation in a decoding device and an encoding device, and compared with the existing 9 bits or 10 bits, the amount of storage required to store the transformation kernel can be reduced, and performance degradation can be reasonably adapted. In addition, representing the kernel matrix with 8 bits can allow the use of small multipliers and can be more suitable for single instruction multiple data (SIMD) instructions for optimal software implementation.
[0137] In the present specification, the term "RST" may refer to a transformation performed on residual samples of a target block based on a transformation matrix whose size is reduced according to a reduction factor. In the case of performing a reduced transformation, the amount of calculation required for the transformation can be reduced due to the reduction in the size of the transformation matrix. That is, RST can be used to solve the computational complexity problem that occurs when transforming a block of large size or an inseparable transform.
[0138] RST may be referred to as various terms such as reduced transform, reduced secondary transform, downscaled transform, simplified transform, and simple transform, and the names that RST may be referred to as are not limited to the listed examples. Alternatively, since RST is mainly performed in a low-frequency region including non-zero coefficients in a transform block, it may be referred to as a low-frequency non-separable transform (LFNST). A transform index may be referred to as a LFNST index.
[0139] Meanwhile, when performing a secondary inverse transform based on the RST, the inverse transformer 135 of the encoding device 100 and the inverse transformer 222 of the decoding device 200 may include an inverse reduction secondary transformer that derives a modified transform coefficient based on an inverse RST of the transform coefficient, and an inverse primary transformer that derives a residual sample for a target block based on an inverse primary transform of the modified transform coefficient. The inverse primary transform refers to an inverse transform of a primary transform applied to the residual. In the present disclosure, deriving a transform coefficient based on a transform may refer to deriving a transform coefficient by applying a transform.
[0140] Figure 5is a diagram illustrating an RST according to an embodiment of the present disclosure.
[0141] In the present disclosure, a “target block” may refer to a current block to be encoded, a residual block, or a transform block.
[0142] In the RST according to the example, an N-dimensional vector can be mapped to an R-dimensional vector located in another space, so that a reduction transformation matrix can be determined, where R is less than N. N may refer to the square of the length of the side of the block to which the transformation is applied, or the total number of transformation coefficients corresponding to the block to which the transformation is applied, and the reduction factor may refer to an R / N value. The reduction factor may be referred to as a reduction factor, a reduction factor, a simplification factor, a simple factor, or other various terms. In addition, R may be referred to as a reduction coefficient, but depending on the situation, the reduction factor may refer to R. In addition, depending on the situation, the reduction factor may refer to an N / R value.
[0143] In the example, the reduction factor or reduction coefficient may be signaled through the bitstream, but the example is not limited thereto. For example, a predetermined value for the reduction factor or reduction coefficient may be stored in each of the encoding device 200 and the decoding device 300, and in this case, the reduction factor or reduction coefficient may not be signaled separately.
[0144] The size of the reduced transform matrix according to an example may be R×N which is smaller than N×N (the size of a conventional transform matrix), and may be defined as in Equation 4 below.
[0145] [Formula 4]
[0146]
[0147] Figure 5 The matrix T in the reduced transform block shown in (a) may refer to the matrix T of equation 4: R×N .like Figure 5 As shown in (a), when the reduction transformation matrix T R×N When multiplied by the residual samples for the target block, the transform coefficients for the current block can be derived.
[0148] In the example, if the size of the block to which the transform is applied is 8×8 and R=16 (ie, R / N=16 / 64=1 / 4), then according to Figure 5 The RST of (a) can be expressed as a matrix operation shown in the following Equation 5. In this case, the storage and multiplication calculations can be reduced to about 1 / 4 by a reduction factor.
[0149] In the present disclosure, a matrix operation may be understood as an operation of obtaining a column vector by multiplying a column vector by a matrix provided on the left side of the column vector.
[0150] [Formula 5]
[0151]
[0152] In formula 6, r1 to r 64 y may represent the residual sample for the target block, and specifically may be a transform coefficient generated by applying the primary transform. As a result of the calculation of Equation 5, the transform coefficient c of the target block may be derived. i , and derive c i The process can be shown as formula 6.
[0153] [Formula 6]
[0154]
[0155] As a result of the calculation of Equation 6, the transform coefficients c1 to c R That is, when R=16, the transform coefficients c1 to c 16 . If a conventional transform is applied instead of RST, and a transform matrix of a size of 64×64 (N×N) is multiplied by a residual sample of a size of 64×1 (N×1), only 16 (R) transform coefficients are derived for the target block because RST is applied, although 64 (N) transform coefficients are derived for the target block. Since the total number of transform coefficients for the target block is reduced from N to R, the amount of data transmitted by the encoding device 200 to the decoding device 300 is reduced, and thus the transmission efficiency between the encoding device 200 and the decoding device 300 can be improved.
[0156] When considered from the perspective of the size of the transformation matrix, the size of the conventional transformation matrix is 64×64 (N×N), but the size of the reduced transformation matrix is reduced to 16×64 (R×N), so the storage usage in the case of performing RST can be reduced by the R / N ratio compared to the case of performing the conventional transformation. In addition, when compared with the number of multiplication calculations N×N in the case of using the conventional transformation matrix, the use of the reduced transformation matrix can reduce the number of multiplication calculations (R×N) by the R / N ratio.
[0157] In an example, the transformer 132 of the encoding device 100 may derive transform coefficients for the target block by performing a primary transform and a secondary transform based on RST on the residual samples for the target block. These transform coefficients may be transmitted to the inverse transformer of the decoding device 200, and the inverse transformer 222 of the decoding device 200 may derive modified transform coefficients based on an inverse reduced secondary transform (RST) for the transform coefficients, and may derive residual samples for the target block based on an inverse primary transform for the modified transform coefficients.
[0158] According to the example, the inverse RST matrix T N×RThe size of is N×R which is smaller than the size of the conventional inverse transform matrix N×N, and is similar to the reduced transform matrix T shown in Equation 4. R×N Has a transposition relationship.
[0159] Figure 5 (b) The matrix T in the reduced inverse transform block shown in t It can refer to the inverse RST matrix T N×R T (The superscript T refers to transposition). Figure 5 As shown in (b), when the inverse RST matrix T N×R T When multiplied by the transform coefficients of the target block, the modified transform coefficients of the target block or the residual samples of the target block can be derived. R×N T It can be expressed as (T R×N T ) N×R .
[0160] More specifically, when the inverse RST is used as the secondary inverse transform, when the inverse RST matrix T N×R T When multiplied by the transform coefficients of the target block, the modified transform coefficients of the target block can be derived. In addition, the inverse RST can be used as an inverse primary transform, and in this case, when the inverse RST matrix T N×R T When multiplied by the transform coefficients of the target block, the residual samples of the target block can be derived.
[0161] In the example, if the size of the block to which the inverse transform is applied is 8×8 and R=16 (ie, R / N=16 / 64=1 / 4), then according to Figure 5 The RST of (b) can be expressed as the matrix operation shown in the following equation 7.
[0162] [Formula 7]
[0163]
[0164] In formula 7, c1 to c 16 As a result of the calculation of Equation 7, r representing the modified transform coefficient of the target block or the residual sample of the target block can be derived. j , and derive r j The process can be shown as formula 8.
[0165] [Formula 8]
[0166]
[0167] As a result of the calculation of Equation 8, r1 to r2 representing the modified transform coefficients of the target block or the residual samples of the target block can be derived. N . From the perspective of the size of the inverse transformation matrix, the size of the conventional inverse transformation matrix is 64×64 (N×N), but the size of the inverse reduction transformation matrix is reduced to 64×16 (R×N), so the storage usage rate in the case of performing the inverse RST can be reduced by the R / N ratio compared to the case of performing the conventional inverse transformation. In addition, when compared with the number of multiplication calculations N×N in the case of using the conventional inverse transformation matrix, the use of the inverse reduction transformation matrix can reduce the number of multiplication calculations (N×R) by the R / N ratio.
[0168] The transform set configuration shown in Table 2 can also be applied to 8×8 RST. That is, 8×8 RST can be applied according to the transform set in Table 2. Since a transform set includes two or three transforms (kernels) according to the intra prediction mode, it can be configured to select one of up to four transforms, including the case where the secondary transform is not applied. In the transform where the secondary transform is not applied, the application of the identity matrix can be considered. Assuming that indexes 0, 1, 2, and 3 are assigned to the four transforms respectively (for example, index 0 can be assigned to the case where the identity matrix is applied, that is, the case where the secondary transform is not applied), the transform index or lfnst index as a syntax element can be signaled for each transform coefficient block, thereby specifying the transform to be applied. That is, for the top left 8×8 block, the 8×8 NSST in the RST configuration can be specified by the transform index, or the 8×8 lfnst can be specified when LFNST is applied. 8×8lfnst and 8×8RST refer to transforms that can be applied to an 8×8 region included in a transform coefficient block when both W and H of a target block to be transformed are equal to or greater than 8, and the 8×8 region may be a left top 8×8 region in the transform coefficient block. Similarly, 4×4lfnst and 4×4RST refer to transforms that can be applied to a 4×4 region included in a transform coefficient block when both W and H of a target block are equal to or greater than 4, and the 4×4 region may be a left top 4×4 region in the transform coefficient block.
[0169] According to an embodiment of the present disclosure, for the transformation in the encoding process, only 48 pieces of data can be selected, and a maximum 16×48 transform kernel matrix can be applied thereto, instead of applying a 16×64 transform kernel matrix to 64 pieces of data forming an 8×8 region. Here, "maximum" means that m has a maximum value of 16 in the m×48 transform kernel matrix for generating m coefficients. That is, when RST is performed by applying an m×48 transform kernel matrix (m≤16) to an 8×8 region, 48 pieces of data are input, and m coefficients are generated. When m is 16, 48 pieces of data are input and 16 coefficients are generated. That is, assuming that 48 pieces of data form a 48×1 vector, the 16×48 matrix and the 48×1 vector are multiplied in sequence, thereby generating a 16×1 vector. Here, the 48 pieces of data forming an 8×8 region can be appropriately arranged, thereby forming a 48×1 vector. For example, a 48×1 vector can be constructed based on 48 pieces of data constituting an area other than the right bottom 4×4 area in an 8×8 region. Here, when the matrix operation is performed by applying the maximum 16×48 transform kernel matrix, 16 modified transform coefficients are generated and the 16 modified transform coefficients can be arranged in the left top 4×4 area according to the scanning order, and the right top 4×4 area and the left bottom 4×4 area can be filled with zeros.
[0170] For the inverse transform in the decoding process, the transposed matrix of the aforementioned transform kernel matrix can be used. That is, when the inverse RST or LFNST is performed in the inverse transform process performed by the decoding device, the input coefficient data to which the inverse RST is applied is configured in a one-dimensional vector according to a predetermined arrangement order, and the modified coefficient vector obtained by multiplying the one-dimensional vector with the corresponding inverse RST matrix on the left side of the one-dimensional vector can be arranged in a two-dimensional block according to a predetermined arrangement order.
[0171] In summary, in the transformation process, when RST or LFNST is applied to an 8×8 region, 48 transform coefficients in the left top region, the right top region, and the left bottom region except the right bottom region of the 8×8 region are matrix-operated with a 16×48 transform kernel matrix. For the matrix operation, the 48 transform coefficients are input in a one-dimensional array. When the matrix operation is performed, 16 modified transform coefficients are derived, and the modified transform coefficients can be arranged in the left top region of the 8×8 region.
[0172] On the contrary, in the inverse transform process, when the inverse RST or LFNST is applied to the 8×8 region, 16 transform coefficients corresponding to the left top region of the 8×8 region among the transform coefficients in the 8×8 region can be input in a one-dimensional array according to the scanning order, and can undergo a matrix operation with a 48×16 transform kernel matrix. That is, the matrix operation can be expressed as (48×16 matrix)*(16×1 transform coefficient vector)=(48×1 modified transform coefficient vector). Here, the n×1 vector can be interpreted as having the same meaning as the n×1 matrix, and can therefore be expressed as an n×1 column vector. In addition, * represents matrix multiplication. When the matrix operation is performed, 48 modified transform coefficients can be derived, and the 48 modified transform coefficients can be arranged in the left top region, the right top region, and the left bottom region of the 8×8 region except the right bottom region.
[0173] When the secondary inverse transform is based on the RST, the inverse transformer 135 of the encoding device 100 and the inverse transformer 222 of the decoding device 200 may include an inverse reduction secondary transformer for deriving modified transform coefficients based on the inverse RST of the transform coefficients and an inverse primary transformer for deriving residual samples for the target block based on the inverse primary transform of the modified transform coefficients. The inverse primary transform refers to an inverse transform of the primary transform applied to the residual. In the present disclosure, deriving transform coefficients based on a transform may refer to deriving transform coefficients by applying a transform.
[0174] 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.
[0175] The encoding device receives as input a result (or a portion of a result) derived after applying a primary (core) transform, and applies a forward secondary transform (Secondary Transform).
[0176] [Formula 9]
[0177] y=G T x
[0178] In Equation 9, x and y are the input and output of the secondary transform, respectively, G is a matrix representing the secondary transform, and the transform basis vectors consist of column vectors. In the case of inverse LFNST, when the dimension of the transform matrix G is expressed as [number of rows × number of columns], in the case of forward LFNST, the transpose of the matrix G becomes G T Dimension.
[0179] For inverse LFNST, the dimensions of the matrix G are [48×16], [48×8], [16×16], [16×8], and the [48×8] matrix and the [16×8] matrix are partial matrices of 8 transformation basis vectors sampled from the left side of the [48×16] matrix and the [16×16] matrix, respectively.
[0180] On the other hand, for forward LFNST, the matrix G T The dimensions of are [16×48], [8×48], [16×16], [8×16], and the [8×48] matrix and the [8×16] matrix are partial matrices obtained by sampling 8 transformation basis vectors from the upper parts of the [16×48] matrix and the [16×16] matrix, respectively.
[0181] Therefore, in the case of forward LFNST, a [48×1] vector or a [16×1] vector can be used as input x, and a [16×1] vector or a [8×1] vector can be used as output y. In video coding and decoding, the output of the forward primary transform is two-dimensional (2D) data, so in order to construct a [48×1] vector or a [16×1] vector as input x, it is necessary to construct a one-dimensional vector by appropriately arranging the 2D data as the output of the forward transform.
[0182] Figure 6 is a diagram illustrating an order of arranging output data of a forward primary transform into a one-dimensional vector according to an example. Figure 6 The left figures of (a) and (b) show the order for constructing a [48×1] vector, and Figure 6 The right figures of (a) and (b) show the order for constructing a [16×1] vector. In the case of LFNST, the 2D data can be constructed by Figure 6 The same order as in (a) and (b) is sequentially arranged to obtain a one-dimensional vector x.
[0183] The arrangement direction of the output data of the forward primary transform may be determined according to the intra-frame prediction mode of the current block. For example, when the intra-frame prediction mode of the current block is in the horizontal direction relative to the diagonal direction, the arrangement direction of the output data of the forward primary transform may be determined according to the intra-frame prediction mode of the current block. Figure 6 The output data of the forward primary transform are arranged in the order of (a) of FIG. 1 and when the intra prediction mode of the current block is in a vertical direction relative to the diagonal direction, the output data of the forward primary transform can be arranged in the order of (a) of FIG. Figure 6 The output data of the forward primary transform are arranged in the order of (b).
[0184] According to the example, different from Figure 6 The order of arrangement of (a) and (b) is the order of arrangement of (a) and (b), and in order to derive and apply Figure 6If the arrangement order of (a) and (b) is the same result (y vector), the column vectors of the matrix G can be rearranged according to the arrangement order. That is, the column vectors of G can be rearranged so that each element constituting the x vector is always multiplied by the same transformation basis vector.
[0185] Since the output y derived by Formula 9 is a one-dimensional vector, when two-dimensional data is required as input data in a process using the result of the forward secondary transform as input (for example, in the process of performing quantization or residual coding), the output y vector of Formula 9 needs to be properly arranged as 2D data again.
[0186] Figure 7 is a diagram illustrating an order of arranging output data of a forward secondary transform into a two-dimensional vector according to an example.
[0187] In the case of LFNST, the output values may be arranged in 2D blocks according to a predetermined scanning order. Figure 7 (a) shows that when the output y is a [16×1] vector, the output values are arranged at 16 positions of the 2D block according to the diagonal scanning order. Figure 7 (b) shows that when the output y is a [8×1] vector, the output values are arranged at 8 positions of the 2D block according to the diagonal scanning order, and the remaining 8 positions are filled with zeros. Figure 7 The X in (b) indicates that it is filled with zeros.
[0188] According to another example, since the order of processing the output vector y when performing quantization or residual coding can be preset, the output vector y may not be arranged in Figure 7 However, in the case of residual coding, data coding may be performed in 2D block (eg, 4×4) units (eg, CG (coefficient group)), and in this case, according to Figure 7 The data is arranged in a specific order in the diagonal scan order.
[0189] In addition, the decoding device may configure a one-dimensional input vector y by arranging two-dimensional data output through a dequantization process according to a preset scanning order for inverse transformation. The input vector y may be output as an output vector x through the following equation.
[0190] [Formula 10]
[0191] x=Gy
[0192] In the case of inverse LFNST, the output vector x can be derived by multiplying the input vector y, which is a [16×1] vector or a [8×1] vector, by the G matrix. For inverse LFNST, the output vector x can be a [48×1] vector or a [16×1] vector.
[0193] The output vector x is based on Figure 6 The order shown in is arranged in a two-dimensional block and is arranged as two-dimensional data, and the two-dimensional data becomes input data (or a part of the input data) of the inverse primary transform.
[0194] Thus, the inverse secondary transform is overall the reverse of the forward secondary transform process and in the case of an inverse transform, unlike in the forward direction, the inverse secondary transform is applied first and then the inverse primary transform.
[0195] In the inverse LFNST, one of 8 [48×16] matrices and 8 [16×16] matrices can be selected as the transformation matrix G. Whether to apply the [48×16] matrix or the [16×16] matrix depends on the size and shape of the block.
[0196] In addition, 8 matrices can be derived from the four transform sets shown in Table 2 above, and each transform set can be composed of two matrices. Which transform set to use among the 4 transform sets is determined according to the intra prediction mode, and more specifically, the transform set is determined based on the value of the intra prediction mode extended by considering wide-angle intra prediction (WAIP). Which matrix is selected from the two matrices constituting the selected transform set is derived by index signaling. More specifically, 0, 1, and 2 can be used as the index values sent, 0 can indicate that LFNST is not applied, and 1 and 2 can indicate any one of the two transform matrices constituting the transform set selected based on the intra prediction mode value.
[0197] Figure 8 is a diagram illustrating a wide-angle intra prediction mode according to an embodiment of this document.
[0198] The general intra prediction mode value may have a value from 0 to 66 and from 81 to 83, and the intra prediction mode value extended due to WAIP may have a value from -14 to 83 as shown. The value from 81 to 83 indicates the CCLM (Cross Component Linear Model) mode, and the value from -14 to -1 and the value from 67 to 80 indicate the intra prediction mode extended due to WAIP application.
[0199] When the width of the current prediction block is greater than the height, the upper reference pixel is generally closer to the position inside the block to be predicted. Therefore, prediction in the left bottom direction can be more accurate than in the right top direction. Conversely, when the height of the block is greater than the width, the left reference pixel is generally closer to the position inside the block to be predicted. Therefore, prediction in the right top direction can be more accurate than in the left bottom direction. Therefore, it can be advantageous to apply remapping (i.e., mode index modification) to the index of the wide-angle intra prediction mode.
[0200] When wide-angle intra prediction is applied, information about the existing intra prediction may be signaled, and after the information is parsed, the information may be remapped to the index of the wide-angle intra prediction mode. Therefore, the total number of intra prediction modes for a specific block (e.g., a non-square block of a specific size) may not be changed, that is, the total number of intra prediction modes is 67, and the intra prediction mode coding for the specific block may not be changed.
[0201] Table 3 below shows a process of deriving a modified intra mode by remapping the intra prediction mode to the wide-angle intra prediction mode.
[0202] [Table 3]
[0203]
[0204] In Table 3, the extended intra prediction mode value is finally stored in the predModeIntra variable, and ISP_NO_SPLIT indicates that the CU block is not divided into sub-partitions by the intra sub-partitioning (ISP) technology currently adopted in the VVC standard, and the cIdx variable values of 0, 1, and 2 indicate the cases of the luminance component, the Cb component, and the Cr component, respectively. The log2 function shown in Table 3 returns a log value with a base of 2, and the Abs function returns an absolute value.
[0205] The variable predModeIntra indicating the intra prediction mode and the height and width of the transform block are used as input values of the wide-angle intra prediction mode mapping process, and the output value is the modified intra prediction mode predModeIntra. The height and width of the transform block or the coding block can be the height and width of the current block for remapping of the intra prediction mode. At this time, the variable whRatio reflecting the ratio of width to width can be set to Abs(Log2(nW / nH)).
[0206] For non-square blocks, the intra prediction mode can be divided into two cases and modified.
[0207] First, if all of conditions (1) to (3) are satisfied, (1) the width of the current block is greater than the height, (2) the intra prediction mode before modification is equal to or greater than 2, and (3) the intra prediction mode is less than the value derived as (8+2*whRatio) when the variable whRatio is greater than 1 and is less than 8 when the variable whRatio is less than or equal to 1 (predModeIntra is less than (whRatio>1)? (8+2*whRatio): 8), then the intra prediction mode is set to a value 65 greater than predModeIntra [predModeIntra is set equal to (predModeIntra+65)].
[0208] If different from the above, that is, if conditions (1) to (3) are satisfied, (1) the height of the current block is greater than the width, (2) the intra-frame prediction mode before modification is less than or equal to 66, and (3) the intra-frame prediction mode is greater than the value derived as (60-2*whRatio) when whRatio is greater than 1 and is greater than 60 when whRatio is less than or equal to 1 (predModeIntra is greater than (whRatio>1)? (60-2*whRatio):60), then the intra-frame prediction mode is set to a value that is 67 less than predModeIntra [predModeIntra is set equal to (predModeIntra-67)].
[0209] Table 2 above shows how to select a transform set based on the intra prediction mode value extended by WAIP in LFNST. Figure 8 As shown, modes 14 to 33 and modes 35 to 80 are symmetric about the prediction direction around mode 34. For example, mode 14 and mode 54 are symmetric about the direction corresponding to mode 34. Therefore, the same set of transformations is applied to modes located in mutually symmetric directions, and this symmetry is also reflected in Table 2.
[0210] In addition, it is assumed that the forward LFNST input data of mode 54 is symmetric with the forward LFNST input data of mode 14. For example, for mode 14 and mode 54, according to Figure 6 (a) and Figure 6 The arrangement order shown in (b) rearranges the two-dimensional data into one-dimensional data. In addition, it can be seen that Figure 6 (a) and Figure 6 The pattern of the order shown in (b) is symmetrical about the direction indicated by the pattern 34 (diagonal direction).
[0211] Furthermore, as described above, which transform matrix of the [48×16] matrix and the [16×16] matrix is applied to the LFNST is determined by the size and shape of the transform target block.
[0212] Fig. 9 is a diagram illustrating a block shape to which LFNST is applied. Fig. 9 (a) shows a 4×4 block, (b) shows a 4×8 block and an 8×4 block, (c) shows a 4×N block or an N×4 block, where N is 16 or greater, (d) shows an 8×8 block, and (e) shows an M×N block, where M≥8, N≥8 and N>8 or M>8.
[0213] exist Fig. 9 In , blocks with thick borders indicate the areas where LFNST is applied. Fig. 9For the blocks in (a) and (b), LFNST is applied to the top left 4×4 region, and for Fig. 9 (c), LFNST is applied separately to the two left top 4×4 regions that are arranged consecutively. Fig. 9 In (a), (b) and (c), since LFNST is applied in units of 4×4 regions, this LFNST will be referred to as “4×4LFNST” hereinafter. As the corresponding transformation matrix, it can be based on Fig. 9 and Fig.10 The matrix dimensions of G in are used to apply a [16×16] or [16×8] matrix.
[0214] More specifically, the [16×8] matrix is applied to Fig. 9 (a) 4×4 block (4×4TU or 4×4CU), and the [16×16] matrix is applied to Fig. 9 This is to adjust the worst case computational complexity to 8 multiplications per sample.
[0215] about Fig. 9 In (d) and (e), LFNST is applied to the top left 8×8 region, and this LFNST is hereinafter referred to as "8×8LFNST". As the corresponding transformation matrix, a [48×16] matrix or a [48×8] matrix may be applied. In the case of the forward LFNST, since a [48×1] vector (the X vector in Equation 9) is input as input data, not all sample values of the top left 8×8 region are used as input values of the forward LFNST. That is, as can be seen from Figure 6 (a) the left order or Figure 6 As can be seen from the left-hand order of (b), a [48×1] vector can be constructed based on samples belonging to the remaining 3 4×4 blocks while leaving the right bottom 4×4 block intact.
[0216] The [48×8] matrix can be applied to Fig. 9 (d) is an 8×8 block (8×8TU or 8×8CU), and the [48×16] matrix can be applied to Fig. 9 (e) is an 8×8 block. This is also to adjust the worst-case computational complexity to 8 multiplications per sample.
[0217] Depending on the block shape, when the corresponding forward LFNST (4×4 or 8×8 LFNST) is applied, 8 or 16 output data (Y vector in Eq. 9, [8×1] or [16×1] vector) are generated. In the forward LFNST, since the matrix G T The characteristic is that the number of output data is equal to or less than the number of input data.
[0218] Fig.10 is a diagram illustrating arrangement of output data of a forward LFNST according to an example, and shows blocks in which the output data of the forward LFNST is arranged according to a block shape.
[0219] exist Fig.10 The shaded area at the top left of the block shown corresponds to the area where the output data of the forward LFNST is located, the positions marked with 0 indicate samples filled with 0 values, and the remaining area represents the area that is not changed by the forward LFNST. In the area that is not changed by the LFNST, the output data of the forward primary transform remains unchanged.
[0220] As described above, since the size of the applied transformation matrix varies according to the shape of the block, the amount of output data also varies. Fig.10 , the output data of the forward LFNST may not completely fill the top left 4×4 block. Fig.10 In the cases of (a) and (d) of , the [16×8] matrix and the A[48×8] matrix are applied to the block or partial area inside the block indicated by the bold line, respectively, and an [8×1] vector is generated as the output of the forward LFNST. That is, according to Figure 7 The scanning order shown in (b) can only fill 8 output data, such as Fig.10 As shown in (a) and (d), the remaining 8 positions can be filled with 0. Fig. 9 (d) In the case of LFNST applied to blocks, such as Fig.10 As shown in (d), the two 4×4 blocks at the top right and bottom left adjacent to the top left 4×4 block are also filled with zero values.
[0221] As described above, basically, by signaling the LFNST index, it is specified whether to apply LFNST and the transformation matrix to be applied. Fig.10 As shown, when LFNST is applied, since the number of output data of the forward LFNST may be equal to or less than the number of input data, an area filled with zero values appears as follows.
[0222] 1) If Fig.10 As shown in (a), samples from the eighth position and subsequent positions in the scanning order in the top left 4×4 block, that is, samples from the ninth to sixteenth.
[0223] 2) If Fig.10 As shown in (d) and (e) of , when the [16×48] matrix or the [8×48] matrix is applied, two 4×4 blocks adjacent to the left top 4×4 block or the second and third 4×4 blocks in scanning order.
[0224] Therefore, if non-zero data exists by checking areas 1) and 2), it is determined that LFNST is not applied, so that signaling of the corresponding LFNST index can be omitted.
[0225] According to an example, for example, in the case of LFNST adopted in the VVC standard, since the signaling of the LFNST index is performed after residual coding, the encoding device can know whether there is non-zero data (significant coefficient) at all positions within the TU or CU block through residual coding. Therefore, the encoding device can determine whether to perform signaling about the LFNST index based on the presence of non-zero data, and the decoding device can determine whether to parse the LFNST index. When non-zero data does not exist in the area specified in 1) and 2) above, the signaling of the LFNST index is performed.
[0226] Since the truncated unary code is applied as the binarization method of the LFNST index, the LFNST index consists of up to two bins, and 0, 10, and 11 are assigned as binary codes for possible LFNST index values 0, 1, and 2, respectively. In the case of LFNST currently used for VVC, context-based CABAC coding is applied to the first bin (conventional coding), and bypass coding is applied to the second bin. The total number of contexts for the first bin is 2, and when (DCT-2, DCT-2) is applied as the primary transform pair for horizontal and vertical directions and the luminance component and the chrominance component are coded in a dual tree type, one context is allocated and the other context is applied to the remaining cases. The coding of the LFNST index is shown in the following table.
[0227] [Table 4]
[0228]
[0229] In addition, for the adopted LFNST, the following simplification method can be applied.
[0230] According to an example, the number of output data of the forward LFNST may be limited to a maximum value of 16.
[0231] exist Fig. 9 In the case of (c), 4×4 LFNST can be applied to two 4×4 regions adjacent to the left top, respectively, and in this case, a maximum of 32 LFNST output data can be generated. When the number of output data of the forward LFNST is limited to a maximum of 16, in the case of a 4×N / N×4 (N≥16) block (TU or CU), 4×4 LFNST is applied only to one 4×4 region at the left top, and LFNST can be applied only to Fig. 9 All blocks of are processed at once. By doing this, the implementation of image compilation can be simplified.
[0232] Fig.11 It is shown that the number of output data of the forward LFNST according to the example is limited to a maximum value of 16. Fig.11 , when LFNST is applied to the leftmost top 4×4 region in a 4×N or N×4 block (where N is 16 or greater), the output data of the forward LFNST becomes 16.
[0233] (ii) According to an example, clearing may be additionally applied to an area to which LFNST is not applied. In this document, clearing may mean filling all positions belonging to a specific area with a value of 0. That is, clearing may be applied to an area that is unchanged due to LFNST, and the result of the forward primary transformation is maintained. As described above, since LFNST is divided into 4×4 LFNST and 8×8 LFNST, clearing may be divided into two types ((ii)-(A) and (ii)-(B)) as follows.
[0234] (ii)-(A) When 4×4 LFNST is applied, an area to which 4×4 LFNST is not applied may be cleared. Fig.12 is a diagram illustrating clearing in a block to which 4×4 LFNST is applied according to an example.
[0235] like Fig.12 As shown, for the block to which 4×4 LFNST is applied, that is, for Fig.10 For all blocks in (a), (b), and (c), the entire area where LFNST is not applied can be filled with zeros.
[0236] on the other hand, Fig.12 (d) shows that when the maximum value of the number of output data of the forward LFNST is limited to 16 (as Fig.11 ), the remaining blocks to which 4×4 LFNST is not applied are cleared.
[0237] (ii)-(B) When 8×8 LFNST is applied, an area to which 8×8 LFNST is not applied may be cleared. Fig.13 is a diagram illustrating clearing in a block to which 8×8 LFNST is applied according to an example.
[0238] like Fig.13 As shown, for the block with 8×8 LFNST applied, that is, Fig.10 For all blocks in (d) and (e), the entire area where LFNST is not applied can be filled with zeros.
[0239] (iii) Due to the zeroing presented in (ii) above, the area filled with zeros may not be the same as when LFNST is applied. Fig.10The wider region of the LFNST case performs the zeroing proposed in (ii) to check whether there is non-zero data.
[0240] For example, when (ii)-(B) is applied, in checking Fig.10 After the areas filled with zero values in (d) and (e) have non-zero data, additionally check Fig.13 Whether there is non-zero data in the area filled with 0, the signaling for the LFNST index can be performed only when there is no non-zero data.
[0241] Of course, even if the clearing proposed in (ii) is applied, the presence of non-zero data can be checked in the same way as the existing LFNST index signaling. Fig.10 After checking whether there is non-zero data in the block filled with zeros in , LFNST index signaling can be applied. In this case, the encoding device only performs zero clearing and the decoding device does not assume zero clearing, that is, it only checks whether non-zero data exists only in Fig.10 In the regions explicitly marked as 0 in , LFNST index parsing can be performed.
[0242] Alternatively, according to another example, the following may be performed: Fig.14 Cleared as shown. Fig.14 is a diagram illustrating clearing in a block to which 8×8 LFNST is applied according to another example.
[0243] like Fig.12 and Fig.13 As shown, zeroing can be applied to all regions except the region where LFNST is applied, or zeroing can be applied only to local regions, as shown in Fig.14 Clearing to zero applies only to Fig.14 For areas outside the top left 8×8 region, clearing may not be applied to the bottom right 4×4 block within the top left 8×8 region.
[0244] Various embodiments of the combination of the simplified methods ((i), (ii)-(A), (ii)-(B), (iii)) applying LFNST can be derived. Of course, the combination of the above simplified methods is not limited to the following embodiments, and any combination can be applied to LFNST.
[0245] Implementation
[0246] Limit the number of output data of the forward LFNST to a maximum of 16 → (i)
[0247] When 4×4 LFNST is applied, all regions where 4×4 LFNST is not applied are cleared → (ii)-(A)
[0248] When 8×8 LFNST is applied, all regions where 8×8 LFNST is not applied are cleared → (ii)-(B)
[0249] After checking whether non-zero data also exists in the existing areas filled with zero values and the areas filled with zeros due to additional clearing ((ii)-(A), (ii)-(B)), the LFNST index is signaled only when non-zero data does not exist → (iii).
[0250] In the case of an embodiment, when LFNST is applied, the area where non-zero output data can exist is limited to the interior of the left top 4×4 area. Fig.12 (a) and Fig.13 In the case of (a), the eighth position in the scan order is the last position where non-zero data can exist. Fig.12 (b) and (c) and Fig.13 In case of (b), the sixteenth position in the scanning order (ie, the position of the right bottom edge of the left top 4×4 block) is the last position in which data other than 0 may exist.
[0251] Therefore, when LFNST is applied, after checking whether non-zero data exists at a position where the residual coding process is not allowed (at a position beyond the last position), it may be determined whether to signal the LFNST index.
[0252] In the case of the zeroing method proposed in (ii), the amount of calculation required to perform the entire transformation process can be reduced due to the amount of data ultimately generated when both the primary transformation and the LFNST are applied. That is, when LFNST is applied, since zeroing is applied to the forward primary transformation output data exists in the area where the LFNST is not applied, it is not necessary to generate data for the area that becomes zeroed during the execution of the forward primary transformation. Therefore, the amount of calculation required to generate the corresponding data can be reduced. The additional effects of the zeroing method proposed in (ii) are summarized as follows.
[0253] First, as mentioned above, the amount of computation required to perform the entire transformation process is reduced.
[0254] In particular, when (ii)-(B) is applied, the amount of calculation in the worst case is reduced, so that the transformation process can be made lighter. In other words, in general, a large amount of calculation is required to perform a large-size primary transformation. By applying (ii)-(B), the amount of data derived as a result of performing forward LFNST can be reduced to 16 or less. In addition, as the size of the entire block (TU or CU) increases, the effect of reducing the amount of transformation operations further increases.
[0255] Second, the amount of computation required for the entire transformation process can be reduced, thereby reducing the power consumption required to perform the transformation.
[0256] Third, the latency involved in the transformation process is reduced.
[0257] Secondary transforms such as LFNST add computational load to existing primary transforms, thus increasing the overall latency time involved in performing the transforms. In particular, in the case of intra prediction, since the reconstructed data of adjacent blocks is used during the prediction process, during encoding, the increase in latency due to the secondary transform results in an increase in the latency until reconstruction. This can lead to an increase in the overall latency of intra prediction coding.
[0258] However, if the zeroing proposed in application (ii) is applied, the latency time for performing the primary transform can be greatly reduced when applying LFNST, maintaining or reducing the overall latency of the transform, such that the encoding device can be implemented more simply.
[0259] Hereinafter, an image decoding process reflecting an embodiment is shown in a table.
[0260] [Table 5]
[0261]
[0262] Table 5 shows sps_log2_max_luma_transform_size_minus5 signaled through the sequence parameter set syntax as syntax information regarding the size of the transform block. Semantically, sps_log2_max_luma_transform_size_minus5 represents the value obtained by taking the base-2 logarithm of the maximum transform size and then subtracting 5.
[0263] The minimum size (MinTbSizeY) of the transform block for which a transform can be performed is set to 4 (MinTbSizeY = 1 << MinTbLog2SizeY), and the maximum size of the transform block for which a transform can be performed can be derived as a power of 2 of the value obtained by adding 5 to sps_log2_max_luma_transform_size_minus5 (MaxTbLog2SizeY = sps_log2_max_luma_transform_size_minus5 + 5, MaxTbSizeY = 1 << MaxTbLog2SizeY).
[0264] Since sps_log2_max_luma_transform_size_minus5 consists of 1 bit and has a value of 0 or 1, the width and height of the maximum transform block may be set to 32 or 64 based on sps_log2_max_luma_transform_size_minus5 of Table 5.
[0265] In addition, according to another embodiment, flag information sps_max_luma_transform_size_64_flag of the size of the maximum transform block may be signaled. When sps_max_luma_transform_size_64_flag is 1, the maximum size of the transform block is 64, and when sps_max_luma_transform_size_64_flag is 0, the maximum size of the transform block is 32.
[0266] [Table 6]
[0267]
[0268] Table 6 shows the lfnst_idx[x0][y0] syntax element signaled at the coding unit level. lfnst_idx[x0][y0] may indicate any one of the two transform kernel matrices included in the transform set. If lfnst_idx is 0, it may indicate that the inseparable secondary transform (ie, LFNST) is not applied.
[0269] In order for lfnst_idx to be parsed by the decoding device, many conditions need to be met. First, the variables LfnstDcOnly and LfnstZeroOutSigCoeffFlag are initially set to 1. After parsing the syntax of the transform tree (transform_tree(x0, y0, cbWidth, cbHeight, treeType)), when the variable LfnstDcOnly set to 1 becomes 0 and the value of the variable LfnstZeroOutSigCoeffFlag remains 1, lfnst_idx can be parsed [if (LfnstDcOnly==0&&LfnstZeroOutSigCoeffFlag==1)]. The variables LfnstDcOnly and LfnstZeroOutSigCoeffFlag can be derived through the residual coding syntax information.
[0270] Furthermore, the maximum coding block size at which lfnst_idx[x0][y0] can be coded is restricted to the maximum transform size (Max(cbWidth, cbHeight)<=MaxTbSizeY).
[0271] In addition, since the coding block width (cbWidth) and the coding block height (cbHeight) respectively indicate the coding block width and the coding block height of the luma component, in the case of the chroma component, LFNST can be applied to each block of a smaller size according to the image color format (e.g., 4:2:0).
[0272] Specifically, as shown in Table 6, if the tree type of the target block is dual-tree chroma, LFNST can be applied to a chroma block having a size obtained by dividing the size of the luma coding block by the size of the SubWidthC and SubHeight indicating the variables for the chroma block [lfnstWidth=(treeType==DUAL_TREE_CHROMA)?cbWidth / SubWidthC:cbWidth, lfnstHeight=(treeType==DUAL_TREE_CHROMA)?cbHeight / SubHeightC:cbHeight].
[0273] If the color format is 4:2:0, SubWidthC and SubHeight become 2, so LFNST can be applied to the chroma block having the width and height obtained by dividing the width and height of the luma block by 2. Therefore, since LFNST can be applied when the size of the luma block is equal to or smaller than a 64×64 block, LFNST can be applied when the size of the chroma block is equal to or smaller than a 32×32 block when the color format is 4:2:0.
[0274] Furthermore, in this document, when the horizontal length and the vertical length of block A are Wa and Ha, respectively, and when the horizontal length and the vertical length of block B are Wb and Hb, respectively, block A is smaller than block B means that Wa is equal to or smaller than Wb, Ha is equal to or smaller than Hb, and Wa and Wb are not equal or Ha and Hb are not equal. In addition, block A is smaller than or equal to block B means that Wa is equal to or smaller than Wb and Ha is equal to or smaller than Hb.
[0275] In summary, LFNST can be applied when the size of the target block is equal to or smaller than a preset maximum size, which can be applied to the size of the luma block, and accordingly, the maximum size of the chroma block to which LFNST can be applied can be derived.
[0276] [Table 7]
[0277]
[0278] Table 7 shows transform_skip_flag indicating whether transform is skipped for a transform block and transform core index information tu_mts_idx[x0][y0] as the transform core index information for primary transform.
[0279] As shown in Table 7, in order to signal tu_mts_idx[x0][y0], there may be a case where the prediction mode of the current block is inter mode or when the flag information sps_explicit_mts_inter_enabled_flag that explicitly indicates whether MTS can be applied to residual data generated by inter prediction is 1 [(CuPredMode[x0][y0]==MODE_INTER&&sps_explicit_mts_inter_enabled_flag)], or the prediction mode of the current block is intra mode or when the flag information sps_explicit_mts_intra_enabled_flag that explicitly indicates whether MTS can be applied to residual data generated by intra prediction is 1 [(CuPredMode[x0][y0]==MODE_INTRA&&sps_explicit_mts_intra_enabled_flag)].
[0280] In addition, when the condition that transform_skip_flag is not 0 is satisfied, tu_mts_idx[x0][y0] can be parsed.
[0281] Furthermore, according to another example, tu_mts_idx[x0][y0] may be signaled at the coding unit level of Table 6 instead of the transform unit level.
[0282] [Table 8]
[0283]
[0284]
[0285] Table 8 shows the residual coding syntax and shows a process of deriving the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag of Table 6.
[0286] Based on the size of the transform block, variables log2SbW and log2SbH indicating the height and width of the subblock can be derived, and numSbCoeff [numSbCoeff=1<<(log2SbW+log2SbH)] representing the number of coefficients that can exist in the subblock can be set based on the variables log2SbW and log2SbH.
[0287] The variable lastScanPos indicating the position of the last significant coefficient within the subblock is initially set to numSbCoeff, and the variable lastSubBlock indicating the subblock where the last non-zero coefficient exists is initially set to "(1<<(log2TbWidth+log2TbHeight−(log2SbW+log2SbH)))−1".
[0288] When performing diagonal scanning in the sub-block corresponding to lastSubBlock[lastScanPos--], check whether the last non-zero significant coefficient exists at the corresponding position.
[0289] When no valid coefficients are found in the sub-block pointed to by lastSubBlock until the variable lastScanPos becomes 0, the variable lastScanPos is set to numSbCoeff again, and the variable lastSubBlock also becomes the next sub-block in the scan direction.
[0290] That is, as the variables lastScanPos and lastSubBlock are updated according to the scan direction, the location of the last non-zero coefficient is identified.
[0291] The variable LfnstDcOnly indicates whether a non-zero coefficient exists at a position other than a DC component for at least one transform block in one coding unit, and when a non-zero coefficient exists at a position other than a DC component for at least one transform block in one coding unit, it becomes 0, and when a non-zero coefficient does not exist at a position other than a DC component for at least one transform block in one coding unit, it becomes 1. In this document, a DC component refers to a top left position or (0,0) relative to a 2D component.
[0292] There may be several transform blocks within one coding unit. For example, in the case of chrominance components, there may be transform blocks for Cb and Cr, and in the case of a single tree type, there may be transform blocks for luma, Cb, and Cr. According to an example, when a non-zero coefficient other than the position of the DC component is found in one of the transform blocks constituting the current coding block, the variable LnfstDcOnly value may be set to 0.
[0293] Meanwhile, since residual coding is not performed on the corresponding transform block if there is no non-zero coefficient in the transform block, the value of the variable LfnstDcOnly is not changed by the corresponding transform block. Therefore, when there is no non-zero coefficient in a position other than the DC component in the transform block, the value of the variable LfnstDcOnly is not changed and the previous value is maintained. For example, if the coding unit is coded as a single tree type and the value of the variable LfnstDcOnly is changed to 0 due to the luma transform block, the variable LfnstDcOnly maintains a 0 value even if there is a non-zero coefficient only in the DC component in the Cb / Cr transform block or there is no non-zero coefficient in the Cb / Cr transform block. The value of the variable LfnstDcOnly is initially initialized to 1, and if no component in the current coding unit can update the value of the variable LfnstDcOnly to 0, it maintains a 1 value as it is, and when the value of the variable LfnstDcOnly is updated to 0 at any one of the locations constituting the corresponding coding unit, it is finally maintained at 0.
[0294] As shown in Table 8, when the index of the sub-block where the last non-zero coefficient exists is 0 [lastSubBlock==0] and the position of the last non-zero coefficient in the sub-block is greater than 0 [lastScanPos>0], the variable LfnstDcOnly can be derived as 0. The variable LfnstDcOnly can be derived as 0 only when the width and height of the transform block are 4 or more [log2TbWidth>=2&&log2TbHeight>=2] and the transform skip is not applied [! transform_skip_flag[x0][y0]].
[0295] Assuming that LFNST is applied, when the index of the sub-block where the last non-zero coefficient exists is greater than 0 and the width and height of the transform block are both greater than or equal to 4 [(lastSubBlock>0&&log2TbWidth>=2&&log2TbHeight>=2)], or when the last position of the non-zero coefficient within the sub-block where the last non-zero coefficient exists is greater than 7 and the size of the transform block is 4×4 or 8×8 [(lastScanPos>7&&(log2TbWidth==2||log2TbHeight==3)&&log2TbWidth==log2TbHeight)], the variable LfnstZeroOutSigCoeffFlag, which can indicate whether clearing is performed appropriately, is set to 0.
[0296] That is, the first condition of the variable LfnstZeroOutSigCoeffFlag is a condition that a non-zero coefficient is derived in an area other than the left top area to which LFNST can be applied in the transform block (i.e., when a significant coefficient is derived in a sub-block other than the left top sub-block (4×4)). When the first condition is satisfied, the flag variable lfnstZeroOutSigCoeffFlag for clearing of LFNST is set to 0. Satisfying the first condition means that clearing is not performed, assuming that LFNST is applied.
[0297] The second condition of the variable LfnstZeroOutSigCoeffFlag is for 4×4 blocks and 8×8 blocks. When LFNST is applied to 4×4 blocks and 8×8 blocks, since the last position where a non-zero coefficient can exist is Fig.11 In the 8th position shown in (a) and (d), if there is a non-zero coefficient outside the 7th position when starting from 0, the flag variable lfnstZeroOutSigCoeffFlag is set to 0. Satisfying the second condition also indicates that zeroing is not performed when LFNST is assumed to be applied.
[0298] Thus, when the flag variable lfnstZeroOutSigCoeffFlag is set to 0, lfnst_idx signaled at the coding unit level is not signaled as shown in Table 6. That is, when the flag variable lfnstZeroOutSigCoeffFlag is set to 0, the decoding device does not parse lfnst_idx.
[0299] In summary, at the coding unit level, the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag are set to 1 respectively, and then at the residual coding level, the variable LfnstDcOnly and the variable LfnstZeroOutSigCoeffFlag are newly derived through the process shown in Table 8. Only when the variable LfnstDcOnly derived from the residual coding level is 0 and the variable LfnstZeroOutSigCoeffFlag is 1 [if (LfnstDcOnly==0&&LfnstZeroOutSigCoeffFlag==1), lfnst_idx can be signaled.
[0300] [Table 9]
[0301]
[0302]
[0303]
[0304] [Table 10]
[0305]
[0306]
[0307] Tables 9 and 10 show that intra prediction and inter prediction processes are performed based on the variable MaxTbSizeY of the size of the transform block derived from Table 5.
[0308] The maximum width (maxTbWidth) and maximum height (maxTbHeight) of the transform block are derived from the variable MaxTbSizeY or MaxTbSizeY / SubWidthC reflecting the color format according to the color index cIdx for luma or chroma [maxTbWidth=(cIdx==0)?MaxTbSizeY:MaxTbSizeY / SubWidthC, maxTbHeight=(cIdx==0)?MaxTbSizeY:MaxTbSizeY / SubHeightC].
[0309] Based on the variable maxTbWidth and the variable maxTbHeight derived in this way, the height and width of the transform block used for inter prediction and intra prediction are set [newTbW=(nTbW>maxTbWidth)?(nTbW / 2):nTbW, newTbH=(nTbH>maxTbHeight)?(nTbH / 2):nTbH], and the subsequent prediction process can be performed based on the set values.
[0310] [Table 11]
[0311]
[0312]
[0313]
[0314] Table 11 shows the overall transformation process performed by the decoding device.
[0315] Referring to Table 11, the variable nonZeroSize indicating the size or number of non-zero variables on which matrix operations are performed in order to apply LFNST is set to 8 or 16. When the width and height of the transform block are 4 or 8, that is, Fig.10The length of the output data of the forward LFNST or the input data of the inverse LFNST for the 4×4 block and the 8×8 block shown is 8. For all other blocks, the length of the output data of the forward LFNST or the input data of the inverse LFNST is 16 [nonZeroSize = ((nTbW = = 4 &&nTbH = = 4) || (nTbW = = 8 &&nTbH = = 8))? 8:16]. That is, when the forward LFNST is applied, the maximum number of output data is limited to 16.
[0316] The input data of the inverse LFNST can be arranged in two dimensions according to diagonal scanning [xC=DiagScanOrder[2][2][x][0], yC=DiagScanOrder[2][2][x][1]]. The above section shows the decoding process of (i) of the LFNST simplification method.
[0317] Thus, since the number of input data for the inverse LFNST of the transform block is limited to a maximum value of 16, the LFNST can be applied to the leftmost top 4×4 region in a 4×N block or an N×4 block, where N is 16 or greater, as shown in FIG. Fig.11 As shown, and the result is Fig.12 As shown in (d), clearing can be performed on the remaining blocks to which 4×4 LFNST is not applied.
[0318] On the other hand, when the intra prediction mode is greater than or equal to 81, that is, when CCLM is applied during intra prediction of the chrominance block, the intra prediction mode (predModeIntra) used to derive the transform set can be set to the intra mode (IntraPredModeY[xTbY+nTbW / 2][yTbY+nTbH / 2]) of the corresponding luma block.
[0319] In addition, the variable implicitMtsEnabled indicating whether MTS is implicitly performed may be set to 1 under the condition that the flag information sps_mts_enabled_flag signaled at the sequence parameter level is 1, sps_explicit_mts_intra_enabled_flag is 0, the intra prediction mode is applied to the current block, lfnst_idx is 0, and intra_mip_flag is 1.
[0320] In addition, the variables nonZeroW and nonZeroH indicating the width and height of the upper left block in which the non-zero transform coefficients input to the inverse primary transform may exist are derived as 4 when the lfnst index is not 0 and the width or width of the transform block is 4, and are otherwise derived as 8 [nonZeroW=(nTbW==4||nTbH==4)?4:8, nonZeroH=(nTbW==4||nTbH==4)?4:8]. That is, in the transform block, zeroing is performed in areas other than the 4×4 area and the 8×8 area to which lfnst is applied. This section shows the decoding process of (ii) for the LFNST simplification method.
[0321] [Table 12]
[0322]
[0323] Table 12 shows a LFNST transform set derived based on an input value for deriving a transform kernel matrix and an intra prediction mode and a transform set for LFNST.
[0324] As shown in Table 12, a transform kernel matrix (lowFreqTransMatrix) may be derived using a variable nTrS indicating a transform output size for deriving a transform kernel matrix, intra prediction mode information (predModeIntra) for selecting an LFNST transform set, and an LFNST index signaled from a coding unit as input values.
[0325] There are four LFNST transform sets, such as 0, 1, 2, and 3, and the same transform set can be applied to modes located in mutually symmetrical directions based on the symmetry of the intra prediction mode. When the intra prediction mode is a non-directional planar mode or a DC mode (0 <= predModeIntra <= 1), the transform set is 0, and in the case of a wide-angle intra prediction mode (predModeIntra <0, 56 <= predModeIntra <= 80), the transform set is 1.
[0326] On the other hand, as described above, when CCLM is applied to a chroma block, the intra prediction mode (predModeIntra) of the chroma block used to derive the transform set can be set to the intra mode (IntraPredModeY[xTbY+nTbW / 2][yTbY+nTbH / 2]) of the corresponding luminance block instead of 81 to 83 indicating CCLM or planar mode.
[0327] Therefore, 81 to 83 are omitted in the intra prediction mode (predModeIntra) for transform set selection in Table 12.
[0328] In addition, the following Table 13 shows ctxInc allocated to the bin index of the above-mentioned tu_mts_idx syntax element (ctxInc is assigned to a syntax element having context coding bin).
[0329] [Table 13]
[0330]
[0331] As shown in Table 13, the ctxInc of the first bin (binIdx=0) of tu_mts_idx is 0, the ctxInc of the second bin (binIdx=1) is 1, the ctxInc of the third bin (binIdx=2) is 2, and the ctxInc of the fourth bin (binIdx=3) is 3.
[0332] In conventional cases, any one ctxInc is selected from among a plurality of ctxIncs according to a predetermined condition, and is allocated to the first bin by allocating one fixed ctxInc to the first bin without accompanying a specific condition, as described above, coding efficiency can be increased.
[0333] The following figures are provided to describe specific examples of the present disclosure. Since the specific names of the devices or the names of the specific signals / messages / fields shown in the figures are provided for illustration, the technical features of the present disclosure are not limited to the specific names used in the following figures.
[0334] Fig.15 is a flowchart illustrating the operation of a video decoding apparatus according to an embodiment of the present disclosure.
[0335] Fig.15 Each of the operations shown can be performed by Figure 2 The decoding device 200 shown in the figure is executed. Specifically, S1510 to S1550 can be performed by Figure 2 The entropy decoder 210 shown in the figure performs S1520, which can be performed by Figure 2 The dequantizer 221 shown in the figure performs, S1560 and S1570 can be performed by Figure 2 The illustrated inverse converter 222 is executed, and S1580 can be performed by Figure 2 The adder 240 shown in the figure performs the operation according to S1510 to S1580 based on the reference Figures 3 to 14 Some of the details explained above will be omitted or will be briefly made similar to those mentioned above. Figures 2 to 14 A description of the specific details of those overlaps that are explained.
[0336] The decoding apparatus 200 according to an embodiment receives a bitstream including residual information, and may derive residual information about a current block, ie, a transform block to be transformed, from the bitstream, for example, a quantized transform coefficient (S1510).
[0337] More specifically, the decoding device 200 may decode the information about the quantized transform coefficient for the target block from the bitstream and may derive the quantized transform coefficient for the current block based on the information about the quantized transform coefficient for the current block. The information about the quantized transform coefficient for the target block may be included in a sequence parameter set (SPS) or a slice header, and may include at least one of the following: information about whether a reduced transform (RST) is applied, information about a simplification factor, information about a minimum transform size for applying a reduced transform, information about a maximum transform size for applying a reduced transform, a reduced inverse transform size, and information about a transform index indicating any one of transform kernel matrices included in a transform set.
[0338] The decoding device 200 may derive a position of a last significant coefficient in the current block and a transform coefficient for the current block based on the residual information (S1520). The decoding device 200 may perform dequantization on the quantized transform coefficient of the current block to derive the transform coefficient.
[0339] The derived transform coefficients can be arranged two-dimensionally in the current block, and the decoding device can derive non-zero data, that is, information about the non-zero significant coefficients in the current block through residual coding. That is, the decoding device can determine the last position information of the non-zero significant coefficients in the current block.
[0340] The transform coefficient derived based on the residual information of S1520 may be a dequantized transform coefficient as described above, or may be a quantized transform coefficient. That is, the transform coefficient may be any data capable of determining whether it is non-zero data in the current block and the position of a significant coefficient regardless of whether the transform coefficient is quantized.
[0341] The decoding apparatus may determine whether the index of the subblock including the last significant coefficient is 0 and whether the position of the last significant coefficient in the subblock is 0 or greater (S1530). The decoding apparatus may determine whether there is a significant coefficient in an area other than a DC area (an area where a DC component is located) of at least one transform block among the transform blocks constituting the coding block.
[0342] In this document, according to an example, the DC region may only mean a position relative to a DC transform coefficient, ie, only a left top position of a transform block.
[0343] According to the determination, a first variable or first flag information indicating whether there is a significant coefficient in an area other than a DC area of the current block may be derived, and the first variable or the first flag information may be derived in the residual coding process. When the index of the sub-block including 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, the first flag information may be derived as 0, and if the first flag information is 0, the LFNST index can be parsed.
[0344] The first flag information may be initially set to 1, and depending on whether there is a significant coefficient in a region other than the DC region, may be maintained as 1 or may be changed to 0. That is, the first flag information indicating whether the position of the last significant coefficient in the subblock with index 0 is greater than 0 is initially set to 1, and when the position of the last significant coefficient in the subblock with index 0 is 0 or greater, the first flag information is changed to 0. When the first flag information is changed to 0, the LFNST index may be parsed.
[0345] According to an example, variables log2SbW and log2SbH indicating the height and width of a subblock may be derived based on the size of a transform block, and numSbCoeff [numSbCoeff=1<<(log2SbW+log2SbH)] representing the number of coefficients that may exist in a subblock may be set based on the variables log2SbW and log2SbH.
[0346] The variable lastScanPos indicating the position of the last significant coefficient within the sub-block is initially set to numSbCoeff, and the variable lastSubBlock indicating the sub-block in which the last non-zero coefficient exists is initially "(1<<(log2TbWidth+log2TbHeight-(log2SbW+log2SbH)))-set to 1".
[0347] When scanning in the diagonal direction in the subblock corresponding to lastSubBlock[lastScanPos--], it is checked whether the last significant coefficient other than 0 exists at the corresponding position.
[0348] When no significant coefficient is found within the sub-block pointed to by lastSubBlock before the variable lastScanPos becomes 0, the variable lastScanPos is set to numSbCoeff again, and the variable lastSubBlock is also changed to the next sub-block in the scan direction [lastSubBlock--].
[0349] That is, as the variable lastScanPos and the variable lastSubBlock are updated according to the scan direction, the position where the last non-zero coefficient exists is identified.
[0350] The variable LfnstDcOnly indicates whether there is a non-zero coefficient at the position of the DC component for at least one transform block that is not in a coding unit, and becomes 0 when there is a non-zero coefficient at the position of the DC component for at least one transform block that is not in a coding unit, and becomes 1 when there is no non-zero coefficient at the position other than the DC component for all transform blocks in one coding unit.
[0351] As shown in Table 8, when the index of the sub-block where the last non-zero coefficient exists is 0 [lastSubBlock==0], and the position of the last non-zero coefficient in the sub-block is greater than 0 [lastScanPos>0], the variable LfnstDcOnly can be derived as 0. The variable LfnstDcOnly can be derived as 0 only when the width and height of the transform block are 4 or more [log2TbWidth>=2&&log2TbHeight>=2] and the transform skip is not applied [! transform_skip_flag[x0][y0]].
[0352] According to an example, the decoding apparatus may determine whether there is a significant coefficient in a second region other than the first region at the left top of the current block (S1540).
[0353] The decoding device may set the second variable or second flag information indicating whether there is a significant coefficient in the second region other than the first region to 1, and when there is no significant coefficient in the second region, may maintain the second flag information to 1, and may parse the LFNST index.
[0354] The second flag information may be a variable LfnstZeroOutSigCoeffFlag which may indicate that zeroing is performed when LFNST is applied. The second flag information is initially set to 1, and when there is a significant coefficient in the second region, the second flag information may be changed to 0.
[0355] When the index of the sub-block in which the last non-zero coefficient exists is greater than 0 and the width and height of the transform block are both greater than 4 [(lastSubBlock>0&&log2TbWidth>=2&&log2TbHeight>=2)], or when the last position of the non-zero coefficient within the sub-block in which the last non-zero coefficient exists is greater than 7 and the size of the transform block is 4x4 or 8x8 [(lastScanPos>7&&(log2TbWidth==2||log2TbHeight==3)&&log2TbWidth==log2TbHeight)], the variable LfnstZeroOutSigCoeffFlag can be derived to 0.
[0356] That is, in a transform block, when a non-zero coefficient is derived from an area other than the top left area where the LFNST transform coefficient can exist, or for a 4x4 block and an 8x8 block, when a non-zero coefficient exists outside the eighth position in the scanning order, the variable LfnstZeroOutSigCoeffFlag is set to 0. In this case, the LFNST index is not parsed.
[0357] The first region may be derived based on the size of the current block.
[0358] For example, when the size of the current block is 4x4 or 8x8, the first area may be from the top left of the current block to the eighth sample position in the scanning direction.
[0359] When the size of the current block is 4×4 or 8×8, since 8 data are output through the forward LFNST, 8 transform coefficients received by the decoding device can be arranged from the left top to the eighth sample position of the current block in the scanning direction, as shown in Fig.12 (a) and Fig.13 As in (a).
[0360] In addition, when the size of the current block is not 4x4 or 8x8, the first area may be a 4x4 area at the left top of the current block. If the size of the current block is not 4x4 or 8x8, since 16 data are output through the forward LFNST, the 16 transform coefficients received by the decoding device may be arranged in the left top 4x4 area of the current block, as shown in FIG. Fig.12 (b) to (d) and Fig.13 As shown in (b).
[0361] Meanwhile, the transform coefficients that may be arranged in the first region may be as follows Figure 7 As shown they are arranged along the diagonal scan direction.
[0362] In addition, according to an example, the maximum number of transform coefficients that may exist in a block to which LFNST is applied may be 16.
[0363] The decoding apparatus may parse the LFNST index from the bitstream when it is determined that the position of the last significant coefficient in the subblock having the index 0 is equal to or greater than 0 and there is no significant coefficient in the second region ( S1550 ).
[0364] In other words, when the first flag information indicates that a significant coefficient exists in a region other than a DC region, and the second flag information indicates that a significant coefficient does not exist in the second region, the decoding apparatus may parse the LFNST index from the bitstream.
[0365] That is, the LFNST index can be parsed when the first flag information set to 1 is changed to 0 and the second flag information is maintained as 1. In other words, except for the DC region, there are significant coefficients in the sub-block including the DC region (ie, the top left 4x4 block), and when there are no significant coefficients by checking the significant coefficients until the second region of the current block, the LFNST index for LFNST can be parsed.
[0366] In summary, at the coding unit level, the first flag information LfnstDcOnly and the second flag information LfnstZeroOutSigCoeffFlag are respectively set to 1, and then re-derived at the residual coding level through the process shown in Table 8. Only when the variable LfnstDcOnly derived from the residual coding level is 0 and the variable LfnstZeroOutSigCoeffFlag is 1 [if (LfnstDcOnly==0&&LfnstZeroOutSigCoeffFlag==1)], lfnst_idx can be signaled at the coding unit level.
[0367] As described above, when the forward LFNST is performed by the encoding apparatus, clearing of the remaining area of the current block except for the area where the LFNST transform coefficient may exist may be performed to zero.
[0368] Therefore, when there are significant coefficients in the second region, it is determined that LFNST is not applied, so the LFNST index is not signaled and the decoding apparatus does not parse the LFNST index.
[0369] The LFNST index information is received as syntax information, and the syntax information is received as a binarized bin string including 0 and 1.
[0370] The syntax element of the LFNST index according to the present embodiment may indicate whether inverse LFNST or inverse inseparable transform is applied and any one of transform core matrices included in the transform set, and the transform set includes two transform core matrices. In this case, the syntax element of the transform index may have three values.
[0371] That is, according to an embodiment, the syntax element value for the LFNST index may include: 0, which indicates that the inverse LFNST is not applied to the target block; 1, which indicates the first transform core matrix among the transform core matrices; and 2, which indicates the second transform core matrix among the transform core matrices.
[0372] When the LFNST index is parsed, the decoding apparatus may apply the LFNST matrix to the transform coefficient of the first region to derive a modified transform coefficient ( S1560 ).
[0373] The inverse transformer 232 of the decoding device 200 may determine a transform set based on a mapping relationship according to an intra prediction mode applied to a current block, and may perform inverse LFNST, ie, inverse inseparable transform based on the transform set and a value of a syntax element for an LFNST index.
[0374] As described above, a plurality of transform sets may be determined according to an intra prediction mode of a transform block to be transformed, and inverse LFNST may be performed based on any one of the transform kernel matrices (i.e., the LFNST matrices included in the transform set indicated by the LFNST index). A matrix applied to inverse LFNST may be referred to as an inverse LFNST matrix or a LFNST matrix, and the name of this matrix is irrelevant as long as it has a transposed relationship with a matrix used for forward LFNST.
[0375] In one example, the inverse LFNST matrix may be a non-square matrix in which the number of columns is less than the number of rows.
[0376] Meanwhile, a predetermined number of modified transform coefficients may be derived based on the size of the current block. For example, when the height and width of the current block are 8 or more, as in Figure 6 48 modified transform coefficients are derived as shown on the left. When the width and height of the current block are not equal to or greater than 8, that is, when the width and height of the current block are greater than or equal to 4 and the width or height of the current block is less than 8, it can be as shown in Figure 6 The 16 modified transform coefficients are derived as shown on the right.
[0377] like Figure 6 As shown, 48 modified transform coefficients may be arranged in the left top, right top, and left bottom 4x4 regions of the left top 8x8 region of the current block, and 16 modified transform coefficients may be arranged in the left top 4x4 region of the current block.
[0378] The 48 modified transform coefficients and the 16 modified transform coefficients may be arranged in the vertical or horizontal direction according to the intra prediction mode of the current block. For example, when the intra prediction mode is based on the diagonal direction ( Figure 8 The horizontal direction of mode 34) ( Figure 8 2 to 34), the modified transform coefficients may be arranged in the horizontal direction, i.e., in the row-first direction, such as Figure 6 When the intra prediction mode is based on the vertical direction of the diagonal direction ( Figure 8 35 to 66 in the example), the modified transform coefficients may be arranged in the vertical direction, i.e., in the column-first direction, such as Figure 6 as shown in (b).
[0379] In one embodiment, S1560 may include decoding the transform index, determining whether it corresponds to a condition for applying the inverse RST based on the transform index (i.e., the LFNST index), and when the condition for applying the inverse LFNST is met, selecting a transform kernel matrix and applying the inverse LFNST to the transform coefficients based on the selected transform kernel matrix and / or the simplification factor. In this case, the size of the simplified inverse transform matrix may be determined based on the simplification factor.
[0380] Referring to S1560, it can be confirmed that the residual sample for the target block is derived based on the inverse LFNST of the transform coefficient for the target block. Regarding the size of the inverse transform matrix, the size of the general inverse transform matrix is N x N, while the size of the inverse LFNST matrix is reduced to N x R, so that it is possible to reduce the memory occupation by the R / N ratio when performing the inverse LFNST compared to when performing the general transform. In addition, compared with the number of multiplication operations N x N when using the general inverse transform matrix, it is possible to reduce the number of multiplication operations by the R / N ratio (to N x R) when using the inverse LFNST matrix. In addition, since only R transform coefficients need to be decoded when applying the inverse LFNST, the total number of transform coefficients for the target block can be reduced from N to R, thereby improving the decoding efficiency. That is, according to S1560, the (inverse) transform efficiency and decoding efficiency of the decoding device 200 can be improved by the inverse LFNST.
[0381] The decoding apparatus 200 according to an embodiment may induce residual samples for the target block based on the inverse primary transform for the modified transform coefficient ( S1570 ).
[0382] On the other hand, when LFNST is not applied, a primary inverse transform process based only on MTS may be applied in the inverse transform process as follows. That is, the decoding device may determine whether LFNST is applied to the current block as in the above-described embodiment, and when LFNST is not applied, the decoding device may derive residual samples from transform coefficients through primary inverse transform.
[0383] When there are significant coefficients in the second region other than the first left top region of the current block, the decoding apparatus may determine not to apply the LFNST, and may derive residual samples from the transform coefficients through a primary inverse transform.
[0384] The primary inverse transform process may be referred to as an inverse primary transform process or an MTS inverse transform process. Such an MTS-based primary inverse transform process may also be omitted in some cases.
[0385] Additionally, a simplified inverse transform may be applied to the inverse primary transform, or a conventional separable transform may be used.
[0386] The decoding apparatus 200 according to an embodiment may generate a reconstructed sample based on the residual sample of the current block and the prediction sample of the current block ( S1580 ).
[0387] The following figures are provided to describe specific examples of the present disclosure. Since the specific names of the devices illustrated in the figures or the names of the specific signals / messages / fields are provided for illustration purposes, the technical features of the present disclosure are not limited to the specific names used in the following figures.
[0388] Fig.16 is a flowchart illustrating the operation of a video encoding apparatus according to an embodiment of the present disclosure.
[0389] Fig.16 Each of the operations shown can be performed by Figure 1 The illustrated encoding device 100 is executed. Specifically, S1610 may be performed by Figure 1 The illustrated predictor 120 performs S1620, which may be performed by Figure 1 The subtractor 131 shown in the figure is executed, and S1630 to S1650 can be performed by Figure 1 The illustrated converter 132 is executed, and S1660 and S1670 can be performed by Figure 1 The illustrated quantizer 133 and entropy encoder 240 perform. The operations according to S1610 to S1670 are based on Figures 3 to 14 Therefore, some of the contents described in the above reference will be omitted or briefly described. Figure 1 and Figures 3 to 14 Description of those specific details of the overlap.
[0390] The encoding device 100 according to an embodiment may induce a prediction sample based on an intra prediction mode applied to a current block ( S1610 ).
[0391] The encoding device 100 according to an embodiment may induce residual samples for the current block based on the prediction samples ( S1620 ).
[0392] The encoding device 100 according to an embodiment may induce a transform coefficient for a target block based on a primary transform for a residual sample ( S1630 ).
[0393] The primary transform may be performed by a plurality of transform cores, and in this case, the transform core may be selected based on the intra prediction mode.
[0394] The encoding apparatus 100 may determine whether to perform a secondary transform or a non-separable transform, specifically, a LFNST, on a transform coefficient for a current block.
[0395] When it is determined that LFNST is to be performed, the encoding device 100 may derive a modified transform coefficient for the current block based on the transform coefficient of the first region at the left top of the current block and a predetermined LFNST matrix ( S1640 ).
[0396] The encoding apparatus 100 may determine a transform set based on a mapping relationship according to an intra prediction mode applied to a current block, and may perform LFNST, that is, an inseparable transform based on one of two LFNST matrices included in the transform set.
[0397] As described above, a plurality of transform sets may be determined according to the intra prediction mode of the transform block to be transformed. A matrix applied to LFNST has a transposed relationship with a matrix used for inverse LFNST.
[0398] In one example, the LFNST matrix may be a non-square matrix in which the number of rows is less than the number of columns.
[0399] The first region can be derived based on the size of the current block. For example, when the height and width of the current block are greater than or equal to 8, the first region is as in Figure 6 The first area may be a 4x4 area at the left top, right top, and left bottom of the 8x8 area at the left top of the current block shown on the left side of FIG. When the height and width of the current block are not equal to or greater than 8, the first area may be a 4x4 area at the left top, right top, and left bottom of the 8x8 area at the left top of the current block shown on the left side of FIG. Figure 6 The 4x4 area at the top left of the current block is shown on the right.
[0400] Transform coefficients of the first region may be read in a vertical or horizontal direction according to an intra prediction mode of the current block and one-dimensionally arranged for a multiplication operation with the LFNST matrix.
[0401] The 48 modified transform coefficients or the 16 modified transform coefficients of the first region may be read in the vertical or horizontal direction and arranged in one dimension according to the intra prediction mode of the current block. For example, if the intra prediction mode is based on the diagonal direction ( Figure 8 The horizontal direction of mode 34) ( Figure 8 2 to 34 in ), the transform coefficients can be arranged in the horizontal direction, that is, in the row-first direction, as Figure 6 When the intra prediction mode is based on the vertical direction of the diagonal direction ( Figure 8 35 to 66 in the example), the transform coefficients may be arranged in the vertical direction, i.e., in the column-first direction, as Figure 6 as shown in (b).
[0402] In one example, the LFNST may be performed based on a simplified transformation matrix or a transformation kernel matrix, and the simplified transformation matrix may be a non-square matrix in which the number of rows is less than the number of columns.
[0403] In one embodiment, S1640 may include determining whether a condition for applying LFNST is satisfied, generating and encoding an LFNST index based on the determination, selecting a transform kernel matrix when the condition for applying LFNST is satisfied, and applying LFNST to the residual sample based on the selected transform kernel matrix and / or a simplification factor. In this case, the size of the simplified transform matrix may be determined based on the simplification factor.
[0404] Referring to S1640, it can be confirmed that the transform coefficient for the target block is derived based on the LFNST for the residual sample. Regarding the size of the transform kernel matrix, the size of the general transform kernel matrix is N x N, and the size of the simplified transform matrix is reduced to R x N, so that it is possible to reduce the memory occupation by the R / N ratio when performing RST compared to when performing the general transform. In addition, compared with the number of multiplication operations N x N, when using the general transform kernel matrix, it is possible to reduce the number of multiplication operations by the R / N ratio (to R x N) when using the simplified transform kernel matrix. In addition, since only R transform coefficients are derived when RST is applied, the total number of transform coefficients for the target block can be reduced from N to R compared to when applying a general transform that derives N transform coefficients, thereby reducing the amount of data sent by the encoding device 100 to the decoding device 200. That is, according to S1640, the transform efficiency and coding efficiency of the encoding device 100 can be improved by LFNST.
[0405] Meanwhile, according to an example, the encoding apparatus may clear the second region of the current block in which the modified transform coefficient does not exist ( S1650 ).
[0406] like Fig.12 and Fig.13 Similarly, all remaining areas of the current block in which there are no modified transform coefficients can be regarded as zero. Due to the clearing, the amount of calculation required to perform the entire transform process is reduced, and the amount of calculation required for the entire transform process is reduced, thereby reducing the power consumption required to perform the transform. In addition, the image coding efficiency can be improved by reducing the delay involved in the transform process.
[0407] On the other hand, when LFNST is not applied, the primary transform process based only on MTS can be applied in the transform process as described above. That is, the encoding device can determine whether LFNST is applied to the current block as in the above embodiment, and when LFNST is not applied, the encoding device can derive the transform coefficient from the residual sample through the primary transform.
[0408] This primary transformation process may be referred to as a primary transformation process or an MTS transformation process. In some cases, such an MTS-based primary transformation process may also be omitted.
[0409] According to the example encoding device, the image information may be configured so that the index of the subblock including the last significant coefficient in the current block is 0, the position of the last significant coefficient in the subblock is 0 or greater, and when there is no significant coefficient in the second region, the LFNST index indicating the LFNST matrix is parsed (S1660).
[0410] That is, the encoding apparatus according to the example may configure the image information such that when a significant coefficient exists in a region excluding a DC region of the current block and the above-mentioned clearing is performed, an LFNST index indicating the LFNST matrix is parsed.
[0411] The encoding device can configure the image information so that the image information shown in Table 6 and Table 8 can be parsed by the decoding device.
[0412] According to an example, when the index of the sub-block including 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, it is determined that there are significant coefficients in an area other than the DC area, and the image information can be configured so that the LFNST index is transmitted or signaled. In this document, the first position in the scanning order may be 0.
[0413] In addition, according to an example, when the index of the subblock including the last significant coefficient in the current block is greater than 0 and the width and height of the current block are 4 or more, it is determined that LFNST is not applied, and the image information may be configured such that the LFNST index is not signaled.
[0414] In addition, according to an example, when the size of the current block is 4x4 or 8x8 and the start of the position in the scanning order is 0 and the position of the last significant coefficient is greater than 7, the encoding device can determine that LFNST is not applied and configure the image information so that the LFNST index is not signaled.
[0415] That is, the encoding device can configure the image information so that after the variable LfnstDcOnly corresponding to the first flag information and the variable LfnstZeroOutSigCoeffFlag corresponding to the second flag information are derived in the decoding device, the LFNST index can be parsed according to the derived variable values.
[0416] For example, the encoding device sets the first flag information indicating whether the position of the last significant coefficient is greater than 0 in the subblock with index 0 to 1, and when the position of the last significant coefficient in the subblock with index 0 is greater than 0, the first flag information may be changed to 0. In this case, the LFNST index may be encoded.
[0417] In addition, the encoding apparatus sets second flag information indicating whether a significant coefficient exists in a second region other than the first region to 1, and when there is no significant coefficient in the second region, the second flag information may be maintained as 1. In this case, the LFNST index may be encoded.
[0418] On the other hand, when the index of the subblock including the last significant coefficient in the current block is greater than 0 and the width and height of the current block are 4 or more, the encoding device may change the second flag information to 0, or when the size of the current block is 4×4 or 8×8 and the position of the last significant coefficient is 8 or more, the encoding device may change the second flag information to 0. In this case, since the image information is configured so that the LFNST index is not parsed, the LFNST index is not encoded.
[0419] The encoding device 100 according to an embodiment may induce a quantized transform coefficient by performing quantization based on the modified transform coefficient for the target block, and may encode and output image information including information about the quantized transform coefficient and the LFNST index ( S1670 ).
[0420] That is, the encoding device may generate residual information including information about the quantized transform coefficients. The residual information may include the above-mentioned transform-related information / syntax elements. The encoding device may encode the image / video information including the residual information and output the encoded image / video information in the form of a bitstream.
[0421] More specifically, the encoding device 100 may generate information about the quantized transform coefficient and encode the generated information about the quantized transform coefficient.
[0422] In one example, the information about the quantized transform coefficient may include at least one of information about whether LFNST is applied, information about a simplification factor, information about a minimum transform size to which LFNST is applied, and information about a maximum transform size to which LFNST is applied.
[0423] In addition, the encoding device 100 may encode information about the size of the maximum transform application block, for example, syntax information about the transform block size, such as sps_log2_max_luma_transform_size_minus5, or flag information such as sps_max_luma_transform_size_64_flag, at the sequence parameter set level.
[0424] In the present disclosure, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. When quantization / dequantization is omitted, the quantized transform coefficient may be referred to as a transform coefficient. When transform / inverse transform is omitted, the transform coefficient may be referred to as a coefficient or a residual coefficient, or may still be referred to as a transform coefficient for consistency of expression.
[0425] In addition, in the present disclosure, the quantized transform coefficient and the transform coefficient may be referred to as a transform coefficient and a scaled transform coefficient, respectively. In this case, the residual information may include information about the transform coefficient, and the information about the transform coefficient may be signaled by the residual coding syntax. The transform coefficient may be derived based on the residual information (or information about the transform coefficient), and the scaled transform coefficient may be derived by an inverse transform (scaling) of the transform coefficient. The residual sample may be derived based on an inverse transform (transform) of the scaled transform coefficient. These details may also be applied / expressed in other parts of the present disclosure.
[0426] In the above-mentioned embodiments, the method is explained based on the flowchart with the aid of a series of steps or boxes, but the present disclosure is not limited to the order of the steps, and a certain step may be performed in an order or step different from the above order or step, or a certain step may be performed concurrently with other steps. In addition, it can be understood by a person of ordinary skill in the art that the steps shown in the flowchart are not exclusive, and another step may be incorporated or one or more steps in the flowchart may be deleted without affecting the scope of the present disclosure.
[0427] The above method according to the present disclosure may be implemented in a software form, and the encoding device and / or decoding device according to the present disclosure may be included in a device for image processing such as a television, a computer, a smart phone, a set-top box, a display device, and the like.
[0428] When the embodiments in the present disclosure are implemented by software, the above methods can be implemented as modules (steps, functions, etc.) for performing the above functions. These modules can be stored in a memory and can be executed by a processor. The memory can be inside or outside the processor and can be connected to the processor in various well-known ways. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits and / or data processing devices. The memory may include a read-only memory (ROM), a random access memory (RAM), a flash memory, a memory card, a storage medium and / or other storage devices. In other words, the embodiments described in the present disclosure can be implemented and executed on a processor, a microprocessor, a controller or a chip. For example, the functional units shown in each of the accompanying drawings can be implemented and executed on a computer, a processor, a microprocessor, a controller or a chip.
[0429] In addition, the decoding device and encoding device of the present disclosure can be included in a multimedia broadcast transceiver, a mobile communication terminal, a home theater video device, a digital theater video device, a surveillance camera, a video chat device, a real-time communication device (such as video communication), a mobile streaming device, a storage medium, a camera, a video on demand (VoD) service provider, an over-the-top (OTT) video device, an Internet streaming service provider, a three-dimensional (3D) video device, a video phone video device, and a medical video device, and can be used to process a video signal or a data signal. For example, an over-the-top (OTT) video device can include a game console, a Blu-ray player, an Internet access TV, a home theater system, a smart phone, a tablet PC, a digital video recorder (DVR), etc.
[0430] In addition, the processing method of the present disclosure can be produced in the form of a program executed by a computer and can be stored in a computer-readable recording medium. Multimedia data with a data structure according to the present disclosure can also be stored in a computer-readable recording medium. Computer-readable recording media include various storage devices and distributed storage devices that store computer-readable data. Computer-readable recording media may include, for example, a Blu-ray disc (BD), a universal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium includes a medium implemented in the form of a carrier (e.g., transmission on the Internet). In addition, the bit stream generated by the encoding method can be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network. In addition, the embodiments of the present disclosure can be implemented as a computer program product through a program code, and the program code can be executed on a computer according to the embodiments of the present disclosure. The program code can be stored on a computer-readable carrier.
[0431] Fig.17An example of a video / image coding system to which the present disclosure is applicable is schematically illustrated.
[0432] refer to Fig.17 The video / image coding system may include a first device (source device) and a second device (receiving device). The source device may deliver coded video / image information or data to the receiving device in the form of a file or stream via a digital storage medium or a network.
[0433] The source device may include a video source, an encoding device, and a transmitter. The receiving device may include a receiver, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display, and the display may be configured as a separate device or an external component.
[0434] The video source can obtain the video / image by capturing, synthesizing or generating the process of the video / image. The video source may include a video / image capturing device and / or a video / image generating device. The video / image capturing device may include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generating device may include, for example, a computer, a tablet computer, and a smart phone, and may (electronically) generate the video / image. For example, a virtual video / image may be generated by a computer, etc. In this case, the video / image capturing process may be replaced by the process of generating the relevant data.
[0435] The encoding device can encode the input video / image. The encoding device can perform a series of processes such as prediction, transformation and quantization for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.
[0436] The transmitter may transmit the encoded video / image information or data output in the form of a bit stream to a receiver of a receiving device in the form of a file or stream through a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter may include an element for generating a media file in a predetermined file format, and may include an element for transmitting through a broadcast / communication network. The receiver may receive / extract a bit stream and transmit the received / extracted bit stream to a decoding device.
[0437] The decoding device may decode a video / image by performing a series of processes such as dequantization, inverse transformation, prediction, etc. corresponding to the operation of the encoding device.
[0438] The renderer can render the decoded video / image, and the rendered video / image can be displayed through a display.
[0439] Fig.18 The structure of a content streaming system to which the present disclosure is applied is illustrated.
[0440] Furthermore, the content streaming system to which the present disclosure is applied may mainly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.
[0441] The encoding server is used to compress the content input from a multimedia input device such as a smart phone, a camera, a camcorder, etc. into digital data to generate a bitstream and send it to a streaming server. As another example, in the case where a multimedia input device such as a smart phone, a camera, a camcorder, etc. directly generates a bitstream, the encoding server can be omitted. The bitstream can be generated by the encoding method or the bitstream generation method to which the present disclosure is applied. And the streaming server can temporarily store the bitstream in the process of sending or receiving the bitstream.
[0442] The streaming server sends multimedia data to the user device through the web server based on the user's request, and the web server acts as a tool to inform the user of what services are available. When the user requests the service the user wants, the web server transmits the request to the streaming server, and the streaming server sends the multimedia data to the user. In this regard, the content streaming system may include a separate control server, and in this case, the control server is used to control the command / response between the corresponding devices in the content streaming system.
[0443] The streaming server can receive content from a media storage and / or encoding server. For example, when receiving content from an encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a predetermined period of time to provide a streaming service smoothly.
[0444] For example, the user device may include a mobile phone, a smart phone, a laptop computer, a digital broadcast terminal, a personal digital assistant (PDA), a portable multimedia player (PMP), a navigation, a tablet PC, a tablet PC, an ultrabook, a wearable device (e.g., a watch-type terminal (smart watch), a glasses-type terminal (smart glasses), a head-mounted display (HMD)), a digital TV, a desktop computer, a digital signage, etc. Each server in the content streaming system may be operated as a distributed server, and in this case, data received by each server can be processed in a distributed manner.
[0445] The claims disclosed herein can be combined in various ways. For example, the technical features of the method claims of the present disclosure can be combined to be implemented or performed in a device, and the technical features of the device claims can be combined to be implemented or performed in a method. In addition, the technical features of the method claims and the device claims can be combined to be implemented or performed in a device, and the technical features of the method claims and the device claims can be combined to be implemented or performed in a method.
Claims
1. An image decoding device, comprising: Memory; as well as at least one processor connected to the memory, wherein the at least one processor is configured to: Obtaining residual information from a bitstream; deriving a position of a last significant coefficient in a current block and a transform coefficient for the current block based on the residual information; Determining whether the index of the subblock including the last significant coefficient is 0 and the position of the last significant coefficient in the subblock is greater than 0; determining whether there is a significant coefficient in a second area other than the first area at the left top of the current block; When it is determined that the position of the last significant coefficient in the sub-block with index 0 is greater than 0 and the significant coefficient does not exist in the second region, parsing a low frequency non-separable transform (LFNST) index from the bitstream; deriving modified transform coefficients by applying a LFNST matrix derived based on the LFNST index to the transform coefficients in the first region; deriving residual samples for the current block based on an inverse primary transform on the modified transform coefficients; as well as generating a reconstructed picture based on the residual samples for the current block, Wherein, based on the width and height of the current block being 4 or greater and the width or height of the current block being less than 8, the first area is a 4x4 area at the left top of the current block and based on the presence of the valid coefficients in the second area other than the 4x4 area at the left top, the LFNST index is not parsed.
2. The image decoding device according to claim 1, wherein: The at least one processor is further configured to: set first flag information related to whether the position of the last significant coefficient is greater than 0 in the sub-block with index 0 to 1, and Wherein, based on the position of the last significant coefficient in the sub-block with index 0 being greater than 0, the first flag information is changed to 0 and the LFNST index is parsed.
3. The image decoding device according to claim 1, wherein: The at least one processor is further configured to: set second flag information related to whether a significant coefficient exists in the second region other than the first region to 1, and When there is no significant coefficient in the second area, the second flag information is maintained as 1 and the LFNST index is parsed.
4. The image decoding device according to claim 3, wherein: The second flag information is derived to be 0 based on the index of the subblock including the last significant coefficient in the current block being greater than 0 and the width and height of the current block being 4 or greater, and Wherein, based on the second flag information being 0, the LFNST index is not parsed.
5. The image decoding device according to claim 3, wherein: Based on the size of the current block being 4x4 or 8x8 and the position of the last significant coefficient being greater than or equal to 8, the second flag information is derived to be 0, and Wherein, based on the second flag information being 0, the LFNST index is not parsed.
6. The image decoding device according to claim 1, wherein: deriving the first area based on the size of the current block, Wherein, based on the size of the current block being 4x4 or 8x8, the first area is from the left top to the eighth sample position of the current block in the scanning direction, and Wherein, based on the fact that the size of the current block is not 4x4 or 8x8, the first area is a 4x4 area at the left top of the current block.
7. The image decoding device according to claim 1, wherein: deriving a predetermined number of the modified transform coefficients based on a size of the current block, wherein, based on the height and width of the current block being greater than or equal to 8, 48 modified transform coefficients are derived, and Therein, based on the width and height of the current block being 4 or greater and the width or height of the current block being less than 8, 16 modified transform coefficients are derived.
8. The image decoding device according to claim 7, wherein: 48 modified transform coefficients are arranged in the left top, right top and left bottom 4x4 regions within the left top 8x8 region of the current block, and Therein, 16 modified transform coefficients are arranged in the left top 4x4 area of the current block.
9. An image encoding device, comprising: Memory; as well as at least one processor connected to the memory, wherein the at least one processor is configured to: deriving prediction samples for the current block; deriving residual samples for the current block based on the prediction samples; deriving transform coefficients for the current block based on a primary transform for the residual samples; deriving a modified transform coefficient for the current block based on the transform coefficient of the first region at the top left of the current block and a predetermined low frequency non-separable transform (LFNST) matrix; clearing a second region of the current block in which the modified transform coefficients are not present; constructing image information so that an index of a subblock including a last significant coefficient in the current block is 0, a position of the last significant coefficient in the subblock is greater than 0, and when the significant coefficient does not exist in the second region, an LFNST index associated with the LFNST matrix is transmitted, and outputting the image information, the image information comprising residual information derived by quantization of the modified transform coefficient and the LFNST index, Wherein, based on the width and height of the current block being 4 or greater and the width or height of the current block being less than 8, the first area is a 4x4 area at the left top of the current block and based on the presence of the valid coefficients in the second area other than the 4x4 area at the left top, the LFNST index is not encoded.
10. The image encoding device according to claim 9, wherein: The at least one processor is further configured to: Setting first flag information related to whether the position of the last significant coefficient in the sub-block with index 0 is greater than 0 to 1; Based on the position of the last significant coefficient in the sub-block with index 0 being greater than 0, changing the first flag information to 0; as well as The LFNST index is encoded.
11. The image encoding device according to claim 9, wherein: The at least one processor is further configured to: setting second flag information related to whether the significant coefficient exists in the second region excluding the first region to 1; When the significant coefficient does not exist in the second region, maintaining the second flag information as 1; as well as The LFNST index is encoded.
12. The image encoding device according to claim 11, wherein: The second flag information is changed to 0 based on that the index of the subblock including the last significant coefficient in the current block is greater than 0 and the width and height of the current block are 4 or more, and The image information is configured such that, based on the second flag information being 0, the LFNST index is not sent.
13. The image encoding device according to claim 11, wherein: Based on the size of the current block being 4×4 or 8×8 and the position of the last significant coefficient being greater than or equal to 8, the second flag information is changed to 0, and The image information is configured such that, based on the second flag information being 0, the LFNST index is not sent.
14. The image encoding device according to claim 9, wherein: deriving the first area based on the size of the current block, Wherein, based on the height and width of the current block being greater than or equal to 8, the first area is the left top, right top and left bottom 4x4 areas within the left top 8x8 area of the current block, and Wherein, based on the width and height of the current block being 4 or greater and the width or height of the current block being less than 8, the first area is the left top 4x4 area of the current block.
15. An apparatus for transmitting data for image information, comprising: At least one processor configured to generate a bitstream for the image information, wherein the bitstream is generated based on the following steps: deriving prediction samples for the current block; deriving residual samples for the current block based on the prediction samples; deriving transform coefficients for the current block based on a primary transform for the residual samples; deriving a modified transform coefficient for the current block based on the transform coefficient of the first region at the top left of the current block and a predetermined low frequency non-separable transform (LFNST) matrix; clearing a second region of the current block in which the modified transform coefficients are not present; constructing image information so that an index of a subblock including a last significant coefficient in the current block is 0, a position of the last significant coefficient in the subblock is greater than 0, and when the significant coefficient does not exist in the second region, an LFNST index associated with the LFNST matrix is transmitted; as well as outputting the image information including residual information derived by quantization of the modified transform coefficient and the LFNST index to generate the bitstream; as well as a transmitter configured to transmit data comprising the bit stream, Wherein, based on the width and height of the current block being 4 or greater and the width or height of the current block being less than 8, the first area is a 4x4 area at the left top of the current block and based on the presence of the valid coefficients in the second area other than the 4x4 area at the left top, the LFNST index is not encoded.