Method and apparatus for processing video signal using reduced transform
The method of applying reduced transforms to predefined regions in video decoding addresses the inefficiencies of high-resolution video processing, reducing complexity and enhancing coding efficiency.
Patent Information
- Application Number
- JP2024154771
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2018-06-03
- Filing Date
- 2024-09-09
- Publication Date
- 2024-11-26
AI Technical Summary
Next-generation video content with high spatial resolution, frame rate, and dimensionality poses challenges in terms of memory storage, memory access rate, and processing power, necessitating more efficient coding tools, particularly in transform design for reduced complexity and improved coding efficiency.
A method for decoding video signals using reduced transforms, where a transform skip is determined for current blocks, and a primary transform is applied based on a transform index and block size, with coefficients of other regions considered as zero, utilizing predefined transformation kernels like DST7 and DCT8.
Significantly reduces complexity by applying transformations only to predefined regions, enhancing coding efficiency and reducing computational demands in processing high-resolution video content.
Smart Images

Figure 2024164318000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a method and apparatus for processing a video signal, and more particularly to a method for designing and applying a reduced transform which can be applied to a linear transform. [Background technology]
[0002] Next-generation video content is characterized by high spatial resolution, high frame rate, and high dimensionality of scene representation. Processing such content will bring about a significant increase in memory storage, memory access rate, and processing power.
[0003] Therefore, there is a need to design coding tools to process next-generation video content more efficiently. In particular, when applying transforms, there is a need to design transforms that are much more efficient in terms of coding efficiency and complexity. Summary of the Invention [Problem to be solved by the invention]
[0004] The object of the invention is to propose a method for performing a primary transform on a predefined region depending on certain conditions.
[0005] The technical problems to be solved in the present invention are not limited to the technical problems mentioned above, and other technical problems not mentioned can be clearly understood by a person having ordinary skill in the art to which the present invention belongs from the description below. [Means for solving the problem]
[0006] One aspect of the present invention may include a method for decoding a video signal based on a reduced transform, the method including: determining whether a transform skip is applied to a current block; if the transform skip is not applied to the current block, obtaining a transform index indicating a transform kernel of the current block from the video signal; determining an area to which a primary transform of the current block is applied based on the transform kernel indicated by the transform index and a size of the current block; and performing an inverse primary transform on the area to which the primary transform is applied using the transform kernel indicated by the transform index.
[0007] Preferably, the step of determining the area to which the linear transform is applied may comprise the step of considering coefficients of remaining areas within the current block other than the area to which the linear transform is applied as zero.
[0008] Preferably, the step of determining an area to which the primary transformation is applied may be performed by determining an area having a width and / or height of the predefined size as the area to which the primary transformation is applied when the transformation kernel indicated by the transformation index is a predefined transformation and the width and / or height of the current block is larger than a predefined size.
[0009] Preferably, the predefined transform may be any one of a combination of transforms consisting of a combination of DST7 and / or DCT8.
[0010] Preferably, the predefined size may be sixteen.
[0011] Preferably, the step of determining an area to which the primary transformation is applied can be performed by determining the smaller of the width of the current block and 32 as the width of the area to which the primary transformation is applied, and determining the smaller of the height of the current block and 32 as the height of the area to which the primary transformation is applied, if the transformation kernel indicated by the transformation index belongs to a first transformation group, and determining the smaller of the width of the current block and 16 as the width of the area to which the primary transformation is applied, and determining the smaller of the height of the current block and 16 as the height of the area to which the primary transformation is applied, if the transformation kernel indicated by the transformation index belongs to a second transformation group.
[0012] Preferably, the first transform group includes DCT2, and the second transform group may include a combination of transforms consisting of a combination of DCT7 and / or DCT8.
[0013] Another aspect of the present invention may include an apparatus for decoding a video signal based on a reduced transform, the apparatus including: a transform skip confirmation unit for confirming whether a transform skip is applied to a current block; a transform index acquisition unit for acquiring a transform index indicating a transform kernel of the current block from the video signal if the transform skip is not applied to the current block; and a primary inverse transform unit for determining an area to which a primary transform is applied to the current block based on the transform kernel indicated by the transform index and a size of the current block, and performing an inverse primary transform on the area to which the primary transform is applied using the transform kernel indicated by the transform index.
[0014] Preferably, the linear transformation unit is capable of regarding coefficients of remaining areas in the current block other than the area to which the linear transformation is applied as zero.
[0015] Preferably, the primary transformation unit may determine, when the transformation kernel indicated by the transformation index is a predefined transformation and the width and / or height of the current block is greater than a predefined size, an area having a width and / or height of the predefined size as an area to which the primary transformation is applied.
[0016] Preferably, the predefined transform may be any one of a combination of transforms consisting of a combination of DST7 and / or DCT8.
[0017] Preferably, the predefined size may be sixteen.
[0018] Preferably, the primary transformation unit may determine, when the transformation kernel indicated by the transformation index belongs to a first transformation group, the smaller of the width of the current block and 32 as the width of the area to which the primary transformation is applied, and determine, when the transformation kernel indicated by the transformation index belongs to a second transformation group, the smaller of the width of the current block and 16 as the width of the area to which the primary transformation is applied, and determine, when the transformation kernel indicated by the transformation index belongs to a second transformation group, the smaller of the width of the current block and 16 as the width of the area to which the primary transformation is applied, and determine, when the transformation kernel indicated by the transformation index belongs to a second transformation group, the smaller of the width of the current block and 16 as the height of the area to which the primary transformation is applied.
[0019] Preferably, the first transform group includes DCT2, and the second transform group may include a combination of transforms consisting of a combination of DCT7 and / or DCT8. Effect of the Invention
[0020] According to an embodiment of the present invention, the complexity can be significantly reduced by performing the transformation only on predefined regions depending on certain conditions.
[0021] The effects obtained by the present invention are not limited to those mentioned above, and the mentioned and different effects will be clearly understood by those having ordinary skill in the art to which the present invention pertains from the following description. [Brief description of the drawings]
[0022] [Figure 1] 1 shows a schematic block diagram of an encoder for encoding a video signal as an embodiment to which the present invention is applied. [Diagram 2] 1 shows a schematic block diagram of a decoder in which a video signal is decoded as an embodiment to which the present invention is applied. [Diagram 3] As embodiments to which the present invention can be applied, FIG. 3A is a diagram for explaining block division structures using QT (QuadTree, hereinafter referred to as "QT"), FIG. 3B is a BT (Binary Tree, hereinafter referred to as "BT"), FIG. 3C is a TT (Ternary Tree, hereinafter referred to as "TT"), and FIG. 3D is an AT (Asymmetric Tree, hereinafter referred to as "AT"). [Figure 4] As an embodiment to which the present invention is applied, a schematic block diagram of a transform and quantization unit 120 / 130 and an inverse quantization and inverse transform unit 140 / 150 in an encoder is shown. [Diagram 5] As an embodiment to which the present invention is applied, a schematic block diagram of an inverse quantization and inverse transform unit 220 / 230 in a decoder is shown. [Figure 6] 1 is a table showing transform configuration groups to which MTS (Multiple Transform Selection) is applied as an embodiment to which the present invention is applied. [Figure 7]2 is a flowchart illustrating an encoding process in which multiple transform selection (MTS) is performed as an embodiment to which the present invention is applied. [Figure 8] 1 is a flowchart illustrating a decoding process in which multiple transform selection (MTS) is performed as an embodiment to which the present invention is applied. [Figure 9] 1 is a flowchart illustrating a process of encoding an MTS flag and an MTS index according to an embodiment of the present invention; [Figure 10] 1 is a flowchart illustrating a decoding process for applying a horizontal transform or a vertical transform to a row or a column based on an MTS flag and an MTS index, as an embodiment to which the present invention is applied. [Figure 11] As an embodiment to which the present invention is applied, a flow chart for performing an inverse transformation based on transformation-related parameters is shown. [Figure 12] 13 is a table showing allocation of a transform set for each intra prediction mode in NSST as an embodiment to which the present invention is applied. [Figure 13] As an embodiment to which the present invention is applied, a calculation flow diagram for Givens rotation is shown. [Figure 14] As an embodiment to which the present invention is applied, a one-round configuration of 4x4 NSST composed of a Givens rotation layer and permutation is shown. [Figure 15] 1 is a block diagram illustrating the operation of a forward reduced transform and a forward reduced transform as an embodiment to which the present invention is applied. [Figure 16] 13 is a diagram illustrating a process of performing a reverse scan from the 64th to the 17th blocks based on a reverse scan order, according to an embodiment of the present invention. [Figure 17]Three forward scan orders of blocks of transform coefficients (transform blocks) are shown as embodiments to which the present invention may be applied. [Figure 18] In an embodiment to which the present invention is applied, when a diagonal scan is applied to the upper left 4x8 block and a 4x4 RST is applied, the positions of valid transform coefficients and the order of forward scan for each 4x4 block are shown. [Figure 19] As an embodiment to which the present invention is applied, a case will be described in which a diagonal scan is applied to the upper left 4x8 block and valid transform coefficients of two 4x4 blocks are combined into one 4x4 block when a 4x4 RST is applied. [Figure 20] 1 shows a flow chart for encoding a video signal based on a reduced quadratic transform as an embodiment to which the present invention can be applied. [Figure 21] 1 shows a flow chart for decoding a video signal based on a reduced quadratic transform as an embodiment to which the present invention is applied. [Figure 22] FIG. 2 is a diagram illustrating a method for encoding a video signal using a reduced transform as an embodiment to which the present invention is applied. [Figure 23] FIG. 2 is a diagram illustrating a method for decoding a video signal using a reduced transform as an embodiment to which the present invention is applied; [Figure 24] FIG. 2 illustrates a reduced transformation structure based on a reduced factor as an embodiment to which the present invention can be applied. [Diagram 25] 1 is a diagram illustrating a method of adaptively applying a reduced transform to perform decoding as an embodiment to which the present invention can be applied; [Figure 26] 1 is a diagram illustrating a method of adaptively applying a reduced transform to perform decoding as an embodiment to which the present invention can be applied; [Figure 27]FIG. 1 illustrates an example of a forward reduced secondary transform and a forward reduced secondary transform as embodiments to which the present invention can be applied, and pseudocode for deriving the same. [Figure 28] FIG. 1 illustrates an example of a forward reduced secondary transform and a forward reduced secondary transform as embodiments to which the present invention can be applied, and pseudocode for deriving the same. [Figure 29] FIG. 1 illustrates a method for applying a reduced quadratic transform to a non-square region, in accordance with an embodiment of the present invention. [Diagram 30] FIG. 1 illustrates a downscaled transformation controlled by a downscale factor as an embodiment to which the present invention may be applied. [Diagram 31] 1 is a diagram illustrating an inverse transform unit according to an embodiment to which the present invention is applied; [Diagram 32] 1 shows a video coding system to which the present invention is applied; [Diagram 33] 1 shows a structural diagram of a content streaming system as an embodiment to which the present invention is applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0023] Hereinafter, the configuration and operation of an embodiment of the present invention will be described with reference to the attached drawings. The configuration and operation of the present invention described with reference to the drawings will be described as one embodiment, and the technical idea of the present invention and its core configuration and operation are not limited thereby.
[0024] Furthermore, the terms used in the present invention are generally used as widely as possible, but in certain cases, the applicant may use terms arbitrarily selected by the applicant. In such cases, the meanings will be clearly described in the detailed description of the relevant part, and it is made clear that the terms should not be interpreted simply based on the names of the terms used in the description of the present invention, but should be interpreted by understanding the meanings of the corresponding terms.
[0025] In addition, the terms used in the present invention are general terms selected to describe the invention, but if there are other terms having similar meanings, they may be substituted for more appropriate interpretation. For example, in the case of a signal, data, sample, picture, frame, block, etc., they may be appropriately substituted and interpreted in each coding process. In addition, in the case of partitioning, decomposition, splitting, division, etc., they may be appropriately substituted and interpreted in each coding process.
[0026] In this document, MTS (Multiple Transform Selection, hereinafter referred to as "MTS") may refer to a method of performing a transform using at least two or more transform types. This may also be expressed as AMT (Adaptive Multiple Transform) or EMT (Explicit Multiple Transform), and similarly, Mts_idx may also be expressed as AMT_idx, EMT_idx, tu_Mts_idx, AMT_TU_idx, EMT_TU_idx, a transform index or a transform combination index, and the present invention is not limited to such expressions.
[0027] FIG. 1 is a schematic block diagram of an encoder for encoding a video signal as an embodiment to which the present invention is applied.
[0028] Referring to FIG. 1, the encoder 100 may include an image division unit 110, a transform unit 120, a quantization unit 130, an inverse quantization unit 140, an inverse transform unit 150, a filtering unit 160, a decoded picture buffer (DPB) 170, an inter prediction unit 180, an intra prediction unit 185, and an entropy encoding unit 190.
[0029] The image division unit 110 may divide an input image (or picture, frame) input to the encoder 100 into one or more processing units. For example, the processing units may be a coding tree unit (CTU), a coding unit (CU), a prediction unit (PU), or a transform unit (TU).
[0030] However, the above terms are used merely for the convenience of explanation of the present invention, and the present invention is not limited to the definition of the terms. In addition, in this specification, for the convenience of explanation, the term coding unit is used as a unit used in the process of encoding or decoding a video signal, but the present invention is not limited thereto and can be appropriately interpreted according to the content of the invention.
[0031] The encoder 100 may subtract a prediction signal output from the inter prediction unit 180 or the intra prediction unit 185 from the input video signal to generate a residual signal, and the generated residual signal is transmitted to the conversion unit 120.
[0032] The transform unit 120 can apply a transform technique to the remaining signal to generate transform coefficients. The transform process can be applied to a square block of a quadtree structure, a block (square or rectangular) divided by a binary tree structure, a ternary tree structure, or an asymmetric tree structure.
[0033] The transform unit 120 may perform a transform based on a plurality of transforms (or a combination of transforms), and such a transform method may be called Multiple Transform Selection (MTS). The MTS may also be called Adaptive Multiple Transform (AMT) or Enhanced Multiple Transform (EMT).
[0034] The above (MTS, AMT, EMT) may refer to a transformation method that is performed based on a transformation (or a combination of transformations) adaptively selected from a plurality of transformations (or a combination of transformations).
[0035] The plurality of transforms (or combinations of transforms) may include the transforms (or combinations of transforms) described herein in Figure 6. In this specification, the transforms or transform types may be expressed as, for example, DCT-Type 2, DCT-II, DCT2, DCT2, etc.
[0036] The converter 120 may implement the following embodiments.
[0037] The present invention provides a method for designing a RST that can be applied to a 4x4 block.
[0038] The present invention provides a configuration of an area to which a 4x4 RST is applied, a method for arranging transform coefficients generated after applying a 4x4 RST, a scan order of the arranged transform coefficients, and a method for aligning and matching transform coefficients generated for each block.
[0039] The present invention provides a method for coding a transform index that specifies a 4x4 RST.
[0040] The present invention provides a method for checking whether a non-zero transform coefficient exists in an area that is not allowed when applying 4x4 RST, and for conditionally coding the corresponding transform index.
[0041] The present invention provides a method for coding the position of the last non-zero transform coefficient, then conditionally coding its transform index, and then omitting the associated residual coding for the impermissible positions.
[0042] The present invention provides a method for applying different transform index coding and residual coding to luma blocks and chroma blocks when applying 4x4 RST.
[0043] Specific embodiments for this are described in further detail herein.
[0044] The quantization unit 130 quantizes the transform coefficients and transmits the quantized transform coefficients to the entropy encoding unit 190, and the entropy encoding unit 190 may entropy code the quantized signal and output the quantized signal as a bitstream.
[0045] Although the transform unit 120 and the quantization unit 130 are described as separate functional units, the present invention is not limited thereto and may be combined into one functional unit. The inverse quantization unit 140 and the inverse transform unit 150 may also be combined into one functional unit.
[0046] The quantized signal output from the quantizer 130 can be used to generate a prediction signal. For example, the quantized signal can be restored to a residual signal by applying inverse quantization and inverse transformation through the inverse quantizer 140 and the inverse transformer 150 in a loop. A reconstructed signal can be generated by adding the restored residual signal to a prediction signal output from the inter prediction unit 180 or the intra prediction unit 185.
[0047] Meanwhile, quantization errors occurring during the compression process may cause block boundaries to become visible. This phenomenon is called blocking artifacts, and is one of the important factors in evaluating image quality. A filtering process can be performed to reduce this artifact. This filtering process removes blocking artifacts and reduces errors in the current picture, improving image quality.
[0048] The filtering unit 160 applies filtering to the reconstructed signal, and outputs the signal to a playback device or transfers it to a decoded picture buffer 170. The filtered signal transferred to the decoded picture buffer 170 is used as a reference picture by an inter prediction unit 180. By using the filtered picture as a reference picture in this manner in an inter prediction mode, not only the image quality but also the coding efficiency can be improved.
[0049] The decoded picture buffer 170 may store the filtered pictures for use as reference pictures from the inter predictor 180.
[0050] The inter prediction unit 180 performs temporal prediction and / or spatial prediction to remove temporal redundancy and / or spatial redundancy by referring to a reconstructed picture. Here, the reference picture used for performing the prediction is a signal that has been converted through quantization and inverse quantization in block units during encoding / decoding in a previous time, so blocking artifacts and ringing artifacts may exist.
[0051] Therefore, in order to solve the performance degradation due to the signal discontinuity and quantization, the inter prediction unit 180 may apply a low pass filter to interpolate signals between pixels in sub-pixel units. Here, a sub-pixel refers to a virtual pixel generated by applying an interpolation filter, and an integer pixel refers to an actual pixel present in a restored picture. As an interpolation method, linear interpolation, bi-linear interpolation, a Wiener filter, etc. may be applied.
[0052] The interpolation filter may be applied to a reconstructed picture to improve prediction accuracy. For example, the inter prediction unit 180 may apply an interpolation filter to integer pixels to generate interpolated pixels, and perform prediction using an interpolated block composed of the interpolated pixels as a prediction block.
[0053] Meanwhile, the intra prediction unit 185 may predict a current block by referring to samples in the vicinity of a block to be currently encoded. The intra prediction unit 185 may perform the following process to perform intra prediction. First, reference samples required for generating a prediction signal may be prepared. Then, a prediction signal may be generated using the prepared samples. Then, a prediction mode is encoded. In this case, the reference samples may be prepared through reference sample padding and / or reference sample filtering. Since the reference samples have undergone prediction and restoration processes, quantization errors may exist. Therefore, in order to reduce such errors, a reference sample filtering process may be performed for each prediction mode used in intra prediction.
[0054] A prediction signal generated via the inter prediction unit 180 or the intra prediction unit 185 is used to generate a reconstructed signal or a residual signal.
[0055] FIG. 2 is a schematic block diagram of a decoder for decoding a video signal as an embodiment to which the present invention is applied.
[0056] Referring to FIG. 2, the decoder 200 may include an analysis unit (not shown), an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, a filtering unit 240, a decoded picture buffer (DPB) 250, an inter prediction unit 260, and an intra prediction unit 265.
[0057] The reconstructed video signal outputted through the decoder 200 can be reproduced through a reproduction device.
[0058] Decoder 200 can receive the signal output from encoder 100 in FIG. 1, and the received signal can be entropy decoded via entropy decoding unit 210.
[0059] In inverse quantization unit 220, quantization step size information is used to obtain transform coefficients from the entropy decoded signal.
[0060] In inverse transform unit 230, the transform coefficients are inversely transformed to obtain the residual signal.
[0061] Here, the present invention provides a method of configuring a transform combination for each group of transform configurations classified by at least one of a prediction mode, a block size, or a block shape, and the inverse transform unit 230 can perform an inverse transform based on the transform combination configured according to the present invention. Also, the embodiments described in this specification can be applied.
[0062] The inverse transform unit 230 can execute the following embodiments.
[0063] The present invention provides a method of restoring a video signal based on a reduced secondary transform.
[0064] The inverse transform unit 230 can induce a secondary transform corresponding to a secondary transform index, perform an inverse secondary transform on the block of transform coefficients using the secondary transform, and perform an inverse primary transform on the block on which the inverse secondary transform has been performed. Here, the secondary transform means a reduced secondary transform, and the reduced secondary transform indicates a transform in which N pieces of residual data (Nx1 residual vector) are input and L pieces (L < N) of transform coefficient data (Lx1 transform coefficient vector) are output.
[0065] In the present invention, the reduced secondary transformation is applied to a specific region of the current block, and the specific region is an upper left MxM (M≦N) region in the current block.
[0066] In the present invention, when the inverse secondary transform is performed, a 4x4 reduced secondary transform is applied to each of the divided 4x4 blocks in the current block.
[0067] In the present invention, whether or not to obtain the secondary transform index is determined based on the position of the last non-zero transform coefficient in the transform coefficient block.
[0068] In the present invention, the secondary transform index is obtained when the last non-zero transform coefficient is not located in a specific area, and the specific area represents the remaining area excluding positions where non-zero transform coefficients can exist when the transform coefficients are arranged according to a scan order when the reduced secondary transform is applied.
[0069] The inverse transform unit 230 may derive a transform combination corresponding to a primary transform index, and perform an inverse primary transform using the transform combination. Here, the primary transform index corresponds to any one of a plurality of transform combinations constituted by a combination of DST7 and / or DCT8, and the transform combination is constituted by a horizontal transform and a vertical transform. At this time, the horizontal transform and the vertical transform correspond to any one of the DST7 or the DCT8.
[0070] Although the inverse quantization unit 220 and the inverse transform unit 230 are described as separate functional units, the present invention is not limited thereto and may be combined into one functional unit.
[0071] A reconstructed signal is generated by adding the obtained residual signal to a prediction signal output from the inter prediction unit 260 or the intra prediction unit 265.
[0072] The filtering unit 240 applies filtering to the reconstructed signal and outputs the signal to a playback device or transfers the signal to the decoded picture buffer unit 250. The filtered signal transferred to the decoded picture buffer unit 250 is used as a reference picture by the inter prediction unit 260.
[0073] The embodiments described herein for the transform section 120 and each functional unit of the encoder 100 may equally be applied to the inverse transform section 230 and corresponding functional units of the decoder.
[0074] FIG. 3 is a diagram for explaining block division structures according to an embodiment to which the present invention can be applied, in which FIG. 3A is a QT (QuadTree, hereinafter referred to as "QT"), FIG. 3B is a BT (Binary Tree, hereinafter referred to as "BT"), FIG. 3C is a TT (Ternary Tree, hereinafter referred to as "TT"), and FIG. 3D is an AT (Asymmetric Tree, hereinafter referred to as "AT").
[0075] A block of video coding can be divided based on a QuadTree (QT). A subblock divided by QT can be further divided recursively using QT. A leaf block that is no longer divided by QT can be divided by at least one of a Binary Tree (BT), a Ternary Tree (TT) or an Asymmetric Tree (AT). BT can have two types of division, horizontal BT (2NxN, 2NxN) and vertical BT (Nx2N, Nx2N). TT can have two types of division, horizontal TT (2Nx1 / 2N, 2NxN, 2Nx1 / 2N) and vertical TT (1 / 2Nx2N, Nx2N, 1 / 2Nx2N). AT can have four types of partitions: horizontal-up AT (2Nx1 / 2N, 2Nx3 / 2N), horizontal-down AT (2Nx3 / 2N, 2Nx1 / 2N), vertical-left AT (1 / 2Nx2N, 3 / 2Nx2N), vertical-right AT (3 / 2Nx2N, 1 / 2Nx2N). Each BT, TT, and AT can be further partitioned recursively using BT, TT, and AT.
[0076] 3A shows an example of QT division. Block A can be divided into four sub-blocks (A0, A1, A2, A3) by QT. Sub-block A1 can be divided into four sub-blocks (B0, B1, B2, B3) again by QT.
[0077] FIG. 3B shows an example of BT division. Block B3, which is no longer divided by QT, can be divided into vertical BT (C0, C1) or horizontal BT (D0, D1). Like block C0, each subblock can be further divided recursively, such as in the form of horizontal BT (E0, E1) or vertical BT (F0, F1).
[0078] 3C shows an example of TT division. Block B3, which is no longer divided by QT, can be divided into vertical TTs (C0, C1, C2) or horizontal TTs (D0, D1, D2). Like block C1, each subblock can be further divided recursively, such as in the form of horizontal TTs (E0, E1, E2) or vertical TTs (F0, F1, F2).
[0079] The above 3D shows an example of AT division. Block B3, which is no longer divided by QT, can be divided into vertical AT(C0, C1) or horizontal AT(D0, D1). Like block C1, each subblock can be further divided recursively, such as in the form of horizontal AT(E0, E1) or vertical TT(F0, F1).
[0080] Meanwhile, BT, TT, and AT division can be used together for division. For example, a subblock divided by BT can be divided by TT or AT. Also, a subblock divided by TT can be divided by BT or AT. A subblock divided by AT can be divided by BT or TT. For example, after horizontal BT division, each subblock can be divided into vertical BT, or after vertical BT division, each subblock can be divided into horizontal BT. The above two division methods have different division procedures, but the final division form is the same.
[0081] Also, when a block is divided, the order of searching the block can be defined in various ways. In general, searching a block from left to right and from top to bottom can mean an order of determining whether additional blocks of each divided subblock are divided, or can mean an encoding order of each subblock when the block is no longer divided, or can mean a search order when a subblock refers to information of other adjacent blocks.
[0082] 4 and 5 show an embodiment to which the present invention is applied. FIG. 4 shows a schematic block diagram of a transform and quantization unit (120 / 130) and an inverse quantization and inverse transform unit (140 / 150) in an encoder, and FIG. 5 shows a schematic block diagram of an inverse quantization and inverse transform unit (220 / 230) in a decoder.
[0083] 4, the transform and quantization unit (120 / 130) may include a primary transform unit 121, a secondary transform unit 122, and a quantization unit 130. The inverse quantization and inverse transform unit (140 / 150) may include an inverse quantization unit 140, an inverse secondary transform unit 151, and an inverse primary transform unit 152.
[0084] 5, the inverse quantization and inverse transform unit (220 / 230) may include an inverse quantization unit 220, an inverse secondary transform unit 231, and an inverse primary transform unit 232.
[0085] In the present invention, when performing a transformation, the transformation can be performed through multiple stages. For example, as shown in Figure 4, two stages of a primary transform and a secondary transform can be applied, or more transformation steps can be used based on the algorithm. Here, the primary transform can also be called a core transform.
[0086] The primary transform unit 121 may apply a primary transform to the remaining signal, where the primary transform may be predefined in a table in the encoder and / or decoder.
[0087] For the primary transform, a Discrete Cosine Transform type 2 (hereinafter, referred to as "DCT2") may be applied.
[0088] Alternatively, Discrete Sine Transform-type 7 (hereinafter, referred to as "DST7") may be applied in a specific case. For example, DST7 may be applied to a 4x4 block in an intra prediction mode.
[0089] Also, in the case of the primary transform, a combination of multiple transforms (DST 7, DCT 8, DST 1, DCT 5) of MTS (Multiple Transform Selection) may be applied. For example, FIG. 6 may be applied.
[0090] The secondary transform unit 122 may apply a secondary transform to the primary transformed signal, where the secondary transform may be predefined in a table in the encoder and / or decoder.
[0091] In one embodiment, the secondary transform may be a Non-Separable Secondary Transform (NSST) that may be applied conditionally. For example, the NSST may be applied only to intra-predicted blocks, and may have a set of applicable transforms for each prediction mode group.
[0092] Here, the prediction mode group may be set based on the symmetry of the prediction direction. For example, since the prediction mode 52 and the prediction mode 16 are symmetric based on the prediction mode 34 (diagonal direction), they may form one group and the same transform set may be applied. In this case, when applying the transform of the prediction mode 52, the input data is transposed before being applied, because the transform set is the same as that of the prediction mode 16.
[0093] On the other hand, Planar and DC modes have their own transformation sets, each consisting of two transformations, since there is no directional symmetry, while the remaining directional modes have three transformations per transformation set.
[0094] In another embodiment, in the case of the secondary transform, a combination of multiple transforms (DST7, DCT8, DST1, DCT5) of MTS (Multiple Transform Selection) can be applied. For example, FIG. 6 can be applied.
[0095] In another embodiment, DST7 can be applied as a secondary transform.
[0096] In another embodiment, the secondary transformation may be applied only to a specific top-left region, rather than to the entire block that has been primarily transformed. For example, if the size of the block is 8x8 or more, an 8x8 NSST may be applied, and if the size is less than 8x8, a 4x4 secondary transformation may be applied. In this case, the block may be divided into 4x4 blocks, and then a 4x4 secondary transformation may be applied to each block.
[0097] In another embodiment, when 4xN / Nx4 (N>=16), a 4x4 quadratic transform can also be applied.
[0098] The quadratic transform (eg, NSST), the 4x4 quadratic transform, and the 8x8 quadratic transform will be described in more detail below with reference to FIGS. 12 to 15 and other embodiments of the specification.
[0099] The quantization unit 130 may quantize the secondary transformed signal.
[0100] The inverse quantization and inverse transformation unit (140 / 150) performs the above-described processes inversely, and therefore a duplicated description will be omitted.
[0101] FIG. 5 shows a schematic block diagram of the inverse quantization and inverse transform unit (220 / 230) in the decoder.
[0102] 5, the inverse quantization and inverse transform unit (220 / 230) may include an inverse quantization unit 220, an inverse secondary transform unit 231, and an inverse primary transform unit 232.
[0103] The inverse quantization unit 220 obtains transform coefficients from the entropy decoded signal using quantization step size information.
[0104] The inverse secondary transform unit 231 performs an inverse secondary transform on the transform coefficients. Here, the inverse secondary transform refers to an inverse transform of the secondary transform described with reference to FIG.
[0105] In another embodiment, in the case of the secondary transformation, a combination of multiple transforms (DST7, DCT8, DST1, DCT5) of MTS (Multiple Transform Selection) can be applied. For example, FIG. 6 can be applied.
[0106] The inverse primary transform unit 232 performs an inverse primary transform on the inverse secondary transformed signal (or block) to obtain a residual signal. Here, the inverse primary transform refers to the inverse transform of the primary transform described in FIG. 4.
[0107] In one embodiment, for the primary transform, a combination of multiple transforms (DST 7, DCT 8, DST 1, DCT 5) of Multiple Transform Selection (MTS) may be applied, for example, as shown in FIG.
[0108] In one embodiment of the present invention, DST7 may be applied as a primary transform.
[0109] In one embodiment of the present invention, a DCT8 may be applied as the primary transform.
[0110] The present invention provides a method for configuring a transform combination for each transform configuration group classified by at least one of a prediction mode, a block size, and a block shape, and the inverse primary transform unit 232 may perform an inverse transform based on the transform combination configured according to the present invention. Also, the embodiments described in this specification may be applied.
[0111] FIG. 6 is a table showing a group of transform configurations to which MTS (Multiple Transform Selection) is applied as an embodiment to which the present invention is applied.
[0112] A group of transformation settings to which MTS (Multiple Transform Selection) is applied
[0113] In this specification, candidates for the j-th transformation combination of a group Gi of transformation settings are represented as a pair as shown in the following formula (1).
[0114] [Number 1] (H(Gi, j), V(Gi, j))
[0115] Here, H(Gi,j) refers to the horizontal transform of the j-th candidate, and V(Gi,j) refers to the vertical transform of the j-th candidate. For example, in FIG. 6, it can be written as H(G3,2)=DST7, V(G3,2)=DCT8. Depending on the context, the value assigned to H(Gi,j) or V(Gi,j) may be a nominal value for distinguishing the transform as in the above example, an index value for the transform, or a 2D matrix of the transform.
[0116] In addition, in this specification, the 2D matrix values of DCT and DST can be expressed as in the following Equations 2 and 3.
[0117] [Number 2] DCT type 2:, DCT type 8:
[0118] [Number 3] DST type 7:, DST type 4:
[0119] Here, whether it is DST or DCT is represented by S or C, the type number is written as a superscript in the form of Roman numerals, and the subscript N indicates that it is an NxN transformation. JPEG2024164318000002.jpg77 and A 2D matrix like JPEG2024164318000003.jpg77 assumes that the column vectors form the transform basis.
[0120] 6, a transform configuration group is determined based on a prediction mode, and there can be a total of six groups (G0 to G5). G0 to G4 correspond to cases where intra prediction is applied, and G5 indicates a combination (or a transform set, or a transform combination set) of transforms applied to a residual block generated by inter prediction.
[0121] A combination of transformations can be performed by a horizontal transform (or row transform) applied to the rows of the 2D block and a vertical transform (or column transform) applied to the columns.
[0122] Here, each of the groups of transform settings may have four transform combination candidates. The four transform combination candidates may be selected or determined via transform combination indexes of 0 to 3, and the transform combination indexes may be encoded and transmitted from the encoder to the decoder.
[0123] In one embodiment, residual data (or residual signals) obtained through intra prediction may have different statistical characteristics depending on the intra prediction mode, and therefore, as shown in FIG 6, a different transform may be applied to each intra prediction mode instead of a general cosine transform.
[0124] Looking carefully at FIG. 6, there are shown a case where 35 intra prediction modes are used and a case where 67 intra prediction modes are used. A plurality of transform combinations can be applied to each transform setting group divided by columns of each intra prediction mode. For example, the plurality of transform combinations can be composed of four (row-direction transform, column-direction transform) combinations. As a specific example, in group 0, DST-7 and DCT-5 can be applied to both the row (horizontal) direction and the column (vertical) direction, and a total of four combinations are possible.
[0125] Since a total of four transform kernel combinations may be applied to each intra prediction mode, a transform combination index for selecting one of them may be transmitted for each transform unit. In this specification, the transform combination index may be called an MTS index and may be represented by Mts_idx.
[0126] In addition to the transform kernels presented in FIG. 6, there may be cases where DCT2 is optimal for all row and column directions due to the characteristics of a residual signal. Therefore, by defining an MTS flag for each coding unit, transforms can be performed adaptively. Here, if the MTS flag is 0, DCT2 is applied to all row and column directions, and if the MTS flag is 1, one of the four combinations can be selected or determined via the MTS index.
[0127] In one embodiment, when the MTS flag is 1, if the number of non-zero transform coefficients for one transform unit is not greater than a threshold, DST-7 can be applied to all row and column directions without applying the transform kernel of Fig. 6. For example, the threshold can be set to 2, which can be set differently based on the block size or transform unit size. This is also applicable to other embodiments of the specification.
[0128] In one embodiment, the values of the transform coefficients are first analyzed, and if the number of non-zero transform coefficients is not greater than a threshold, the amount of additional information transmitted can be reduced by applying DST-7 without analyzing the MTS and index.
[0129] In one embodiment, when the MTS flag is 1, if the number of non-zero transform coefficients for one transform unit is greater than a threshold, the MTS index can be analyzed, and the horizontal transform and vertical transform can be determined based on the MTS index.
[0130] In one embodiment, MTS can be applied only when the width and height of the transform unit are both less than or equal to 32.
[0131] In one embodiment, FIG. 6 can be preset through off-line training.
[0132] In one embodiment, the MTS index can be defined as one index that can simultaneously indicate a combination of horizontal and vertical transforms, or the MTS index can define a horizontal transform index and a vertical transform index separately.
[0133] In one embodiment, the MTS flag or the MTS index may be defined at at least one level of a sequence, a picture, a slice, a block, a coding unit, a transform unit, or a prediction unit. For example, the MTS flag or the MTS index may be defined at at least one level of a sequence parameter set (SPS), a coding unit, or a transform unit. Also, as one example, a syntax flag for enabling / disabling MTS may be defined at at least one level of a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header.
[0134] In another embodiment, the transform combination (horizontal transform, vertical transform) corresponding to the transform index can be configured independent of the MTS flag, the prediction mode, and / or the block shape. For example, the transform combination can be at least one of DCT2, DST7, and / or DCT8. As a specific example, if the transform index is 0, 1, 2, 3, or 4, the transform combination can be (DCT2, DCT2), (DST7, DST7), (DCT8, DST7), (DST7, DCT8), or (DCT8, DCT8).
[0135] FIG. 7 is a flowchart showing an encoding process in which MTS (Multiple Transform Selection) is performed as an embodiment to which the present invention is applied.
[0136] Although the present specification describes an embodiment in which transforms are applied separately for the horizontal and vertical directions, the combination of transforms can also be configured to be non-separable transforms.
[0137] Or it can be composed of a mixture of separable and non-separable transforms. In this case, when a non-separable transform is used, the selection of transformations by row / column or by horizontal / vertical direction becomes unnecessary, and the combination of transformations in Figure 6 is used only when a separable transform is selected.
[0138] In addition, the method proposed in this specification can be applied regardless of the primary transform or the secondary transform. That is, there is no restriction that it must be applied to only one of the two, and both can be applied. Here, the primary transform may refer to a transform for first transforming a residual block, and the secondary transform may refer to a transform for applying a transform to a block generated as a result of the primary transform.
[0139] First, the encoder may determine a group of transform settings corresponding to a current block (S710). Here, the group of transform settings may refer to the group of transform settings in FIG. 6, but the present invention is not limited thereto and may be configured with other combinations of transforms.
[0140] The encoder may perform transforms for combinations of available candidate transforms in the transform settings group (S720).
[0141] As a result of performing the transformations, the encoder may determine or select a combination of transformations that has a minimum RD (Rate Distortion) cost (S730).
[0142] The encoder may encode an index of a transform combination corresponding to the selected transform combination (S740).
[0143] FIG. 8 is a flowchart showing a decoding process in which MTS (Multiple Transform Selection) is performed as an embodiment to which the present invention is applied.
[0144] First, the decoder may determine a group of transform settings for the current block (S810).
[0145] The decoder may analyze (or obtain) a transform combination index from the video signal, where the transform combination index may correspond to any one of a plurality of transform combinations in the transform setting group (S820). For example, the transform setting group may include DST7 (Discrete Sine Transform type 7) and DCT8 (Discrete Cosine Transform type 8). The transform combination index may be referred to as an MTS index.
[0146] In one embodiment, the group of transformation settings may be set based on at least one of a prediction mode, a block size, or a block shape of the current block.
[0147] The decoder may derive a transform combination corresponding to the transform combination index (S830), where the transform combination is composed of a horizontal transform and a vertical transform and may include at least one of the DST-7 or DCT-8.
[0148] In addition, the combination of transformations may refer to the combination of transformations described in Fig. 6, but the present invention is not limited thereto, and may be configured with other combinations of transformations according to other embodiments of the present specification.
[0149] The decoder may perform an inverse transform of the current block based on the combination of transforms (S840). If the combination of transforms is composed of a row (horizontal) transform and a column (vertical) transform, the row (horizontal) transform may be applied first, and then the column (vertical) transform may be applied. However, the present invention is not limited thereto, and if the combination of transforms is composed of inversely applied or non-separable transforms, the non-separable transform may be applied immediately.
[0150] In an embodiment, when the vertical transform or the horizontal transform is the DST-7 or DCT-8, the inverse DST-7 transform or the inverse DCT-8 transform may be applied column by column and then row by row.
[0151] In one embodiment, the vertical transformation or the horizontal transformation may be applied separately to each row and / or each column.
[0152] In one embodiment, the index of the transformation combination may be obtained based on an MTS flag indicating whether MTS is performed, i.e., the index of the transformation combination may be obtained if MTS is performed based on the MTS flag.
[0153] In one embodiment, the decoder may check whether the number of non-zero transform coefficients is greater than a threshold, and the index of the transform combination may be obtained if the number of non-zero transform coefficients is greater than a threshold.
[0154] In one embodiment, the MTS flag or the MTS index may be defined at at least one level of a sequence, a picture, a slice, a block, a coding unit, a transform unit, or a prediction unit.
[0155] In one embodiment, the inverse transform can be applied only if the width and height of the transform unit are both less than or equal to 32.
[0156] Meanwhile, in another embodiment, the process of determining the group of transform settings and the process of parsing the index of the transform combination can be performed simultaneously, or the step S810 can be omitted since it is preset in the encoder and / or decoder.
[0157] FIG. 9 is a flowchart illustrating a process of encoding an MTS flag and an MTS index according to an embodiment of the present invention.
[0158] The encoder may determine whether multiple transform selection (MTS) of the current block is applied (S910).
[0159] If multiple transform selection (MTS) is applied, the encoder may encode with MTS flag=1 (S920).
[0160] The encoder may determine an MTS index based on at least one of a prediction mode, a horizontal transform, and a vertical transform of the current block (S930). Here, the MTS index refers to an index indicating one of a plurality of transform combinations for each intra prediction mode, and the MTS index may be transmitted for each transform unit.
[0161] Once the MTS index is determined, the encoder may encode the MTS index (S940).
[0162] On the other hand, if the MTS (Multiple Transform Selection) is not applied, the encoder may encode the MTS flag=0 (S950).
[0163] FIG. 10 is a flowchart illustrating a decoding process for applying a horizontal transform or a vertical transform to a row or a column based on an MTS, a flag, and an MTS index, as an embodiment to which the present invention is applied.
[0164] The decoder may parse an MTS flag from the bitstream (S1010), where the MTS flag may indicate whether a multiple transform selection (MTS) of the current block is applied.
[0165] The decoder may determine whether a multiple transform selection (MTS) of the current block is applied based on the MTS flag (S1020). For example, the decoder may determine whether the MTS flag is 1 or not.
[0166] If the MTS flag is 1, the decoder may check whether the number of non-zero transform coefficients is greater than (or equal to) a threshold (S1030). For example, the threshold may be set to 2, which may be set differently based on the block size or transform unit size.
[0167] If the number of non-zero transform coefficients is greater than a threshold, the decoder may analyze an MTS index (S1040). Here, the MTS index refers to an index indicating one of a plurality of transform combinations for each intra prediction mode or inter prediction mode, and the MTS index may be transmitted for each transform unit. Alternatively, the MTS index may refer to an index indicating one of transform combinations defined in a pre-defined transform combination table, and the pre-defined transform combination table may refer to FIG. 6, but the present invention is not limited thereto.
[0168] The decoder may derive or determine horizontal and vertical transforms based on at least one of the MTS index or the prediction mode (S1050).
[0169] Alternatively, the decoder may derive a combination of transforms corresponding to the MTS index. For example, the decoder may derive or determine a horizontal transform and a vertical transform corresponding to the MTS index.
[0170] On the other hand, if the number of non-zero transform coefficients is not greater than the threshold, the decoder may apply a preset vertical inverse transform to each column (S1060). For example, the vertical inverse transform may be an inverse transform of DST7.
[0171] Then, the decoder may apply a preset horizontal inverse transform to each row (S1070). For example, the horizontal inverse transform may be an inverse transform of DST7. That is, if the number of non-zero transform coefficients is not greater than a threshold, a transform kernel preset in the encoder or decoder may be used. For example, a commonly used transform kernel (e.g., DCT-2, DST-7, DCT-8) may be used instead of one defined in the transform combination table of FIG. 6.
[0172] On the other hand, if the MTS flag is 0, the decoder may apply a preset vertical inverse transform to each column (S1080). For example, the vertical inverse transform may be an inverse transform of DCT2.
[0173] Then, the decoder may apply a preset horizontal inverse transform to each row (S1090). For example, the horizontal inverse transform may be an inverse transform of DCT2. That is, if the MTS flag is 0, a transform kernel preset in the encoder or decoder is used. For example, a commonly used transform kernel may be used instead of one defined in the transform combination table of FIG. 6.
[0174] FIG. 11 shows a flowchart of an embodiment of the present invention for performing an inverse transformation based on transformation-related parameters.
[0175] A decoder to which the present invention is applied can acquire sps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag (S1110). Here, sps_mts_intra_enabled_flag indicates whether tu_mts_flag exists in the residual coding syntax of an intra coding unit. For example, if sps_mts_intra_enabled_flag=0, tu_mts_flag does not exist in the residual coding syntax of an intra coding unit, and if sps_mts_intra_enabled_flag=0, tu_mts_flag exists in the residual coding syntax of an intra coding unit. And sps_mts_inter_enabled_flag indicates whether tu_mts flag exists in the residual coding syntax of an inter coding unit. For example, if sps_mts_inter_enabled_flag=0, then tu_mts_flag is not present in the residual coding syntax of the inter coding unit, and if sps_mts_inter_enabled_flag=0, then tu_mts_flag is present in the residual coding syntax of the inter coding unit.
[0176] The decoder may acquire tu_mts_flag based on sps_mts_intra_enabled_flag or sps_mts_inter_enabled_flag (S1120). For example, when sps_mts_intra_enabled_flag=1 or sps_mts_inter_enabled_flag=1, the decoder may acquire tu_mts_flag. Here, tu_mts_flag indicates whether multiple transform selection (hereinafter referred to as "MTS") is applied to the residual samples of the luma transform block. For example, when tu_mts_flag=0, MTS is not applied to the residual samples of the luma transform block, and when tu_mts_flag=1, MTS is applied to the residual samples of the luma transform block.
[0177] As another example, at least one of the embodiments of this document may be applied to the tu_mts_flag.
[0178] The decoder may obtain mts_idx based on tu_mts_flag (S1130). For example, when tu_mts_flag=1, the decoder may obtain mts_idx, where mts_idx indicates which transform kernel is applied to luma residual samples along the horizontal and / or vertical directions of the current transform block.
[0179] For example, for mts_idx, at least one of the embodiments in this document may be applied. As a specific example, at least one of the embodiments in FIG. 6 may be applied.
[0180] The decoder may derive a transform kernel corresponding to mts_idx (S1140). For example, the transform kernel corresponding to mts_idx may be defined as being divided into a horizontal transform and a vertical transform.
[0181] As another example, different transformation kernels may be applied to the horizontal transformation and the vertical transformation, although the present invention is not limited thereto, and the same transformation kernel may be applied to the horizontal transformation and the vertical transformation.
[0182] In one embodiment, mts_idx may be defined as shown in Table 1 below.
[0183] [Table 1]
[0184] The decoder can then perform an inverse transform based on the transform kernel (S1150).
[0185] In FIG. 11, the embodiment of acquiring tu_mts_flag to determine whether MTS is applied, and then acquiring mts_idx based on the acquired tu_mts_flag value to determine the transformation kernel is described, but the present invention is not limited thereto. As an example, the decoder can directly analyze mts_idx without analyzing tu_mts_flag to determine the transformation kernel. In this case, the above-mentioned Table 1 is used. That is, when the mts_idx value indicates 0, DCT-2 is applied in the horizontal / vertical direction, and when the mts_idx value indicates a value other than 0, DST-7 and / or DCT-8 can be applied based on the mts_idx value.
[0186] As another embodiment of the present invention, a decoding process is described which performs a conversion process.
[0187] The decoder may ascertain (S10) a transform size (nTbS), where the transform size (nTbS) may be a variable representing a horizontal sample size of the scaled transform coefficients.
[0188] The decoder may check a transform kernel type (trType) (S20). Here, the transform kernel type (trType) may be a variable representing a type of transform kernel, and various embodiments of this document may be applied. The transform kernel type (trType) may include a horizontal transform kernel type (trTypeHor) and a vertical transform kernel type (trTypeVer).
[0189] Referring to Table 1, when the transform kernel type (trType) is 0, it indicates DCT2, when it is 1, it indicates DCT7, and when it is 2, it indicates DCT8.
[0190] The decoder may perform transform matrix multiplication based on at least one of a transform size (nTbS) or a transform kernel type (S30).
[0191] As another example, if the transformation kernel type is 1 and the transformation size is 4, a predetermined transformation matrix 1 may be applied when performing the transformation matrix multiplication.
[0192] As another example, if the transformation kernel type is 1 and the transformation size is 8, a predetermined transformation matrix 2 may be applied when performing the transformation matrix multiplication.
[0193] As another example, if the transformation kernel type is 1 and the transformation size is 16, a predetermined transformation matrix 3 may be applied when performing the transformation matrix multiplication.
[0194] As another example, if the transformation kernel type is 1 and the transformation size is 32, a default transformation matrix of 4 may be applied.
[0195] Similarly, if the transformation kernel type is 2 and the transformation size is 4, 8, 16, or 32, the default transformation matrices (5), (6), (7), and (8) can be applied, respectively.
[0196] Here, each of the predefined transformation matrices (1) to (8) may correspond to one of various types of transformation matrices. For example, the transformation matrices illustrated in FIG. 6 may be applied.
[0197] The decoder can derive transform samples (or transform coefficients) based on multiplication of a transform matrix (S40).
[0198] The above embodiments may be used individually, but the invention is not limited thereto, and may be used in combination with the above embodiments and other embodiments herein.
[0199] FIG. 12 is a table showing allocation of a transform set for each intra prediction mode in NSST as an embodiment to which the present invention is applied.
[0200] Non-Separable Secondary Transform (NSST)
[0201] A secondary transform unit may apply a secondary transform to the primary transformed signal, where the secondary transform may be predefined in a table in the encoder and / or decoder.
[0202] In one embodiment, the secondary transform may be a Non-Separable Secondary Transform (NSST) that is conditionally applied. For example, the NSST may be applied only to intra-predicted blocks, and may have a set of applicable transforms for each prediction mode group.
[0203] Here, the prediction mode group may be set based on the symmetry of the prediction direction. For example, since the prediction mode 52 and the prediction mode 16 are symmetric based on the prediction mode 34 (diagonal direction), they form one group and the same transform set may be applied. In this case, when applying the transform of the prediction mode 52, the input data is transposed before being applied, because the transform set is the same as that of the prediction mode 16.
[0204] Meanwhile, in the case of the planar mode and the DC mode, since there is no directional symmetry, each of them has a transformation set, and the transformation set may be composed of two transformations. For the remaining directional modes, each transformation set may be composed of three transformations. However, the present invention is not limited thereto, and each transformation set may be composed of multiple transformations.
[0205] In one embodiment, other transform set tables may be defined than those shown in Figure 12. For example, a transform set from a predefined table may be determined based on an intra-prediction mode (or intra-prediction mode group), as shown in Table 2 below. Syntax may be signaled from the encoder to the decoder to indicate a particular transform within the determined transform set depending on the intra-prediction mode.
[0206] [Table 2]
[0207] Referring to Table 2, a predefined transform set may be assigned to a grouped intra prediction mode (or an intra prediction mode group), where the IntraPredMode value may be a mode value transformed taking into account Wide Angle Intra Prediction (WAIP).
[0208] FIG. 13 shows an embodiment to which the present invention is applied, and shows a calculation flow diagram for the Givens rotation.
[0209] In another embodiment, the NSST can be applied only to the top-left 8x8 region, rather than to the entire block that has been first transformed. For example, if the size of the block is 8x8 or more, 8x8 NSST is applied, and if it is less than 8x8, 4x4 NSST is applied, and in this case, the block is divided into 4x4 blocks and then 4x4 NSST is applied to each of them.
[0210] In another embodiment, 4x4 NSST can be applied even when 4xN / Nx4 (N>=16).
[0211] The 8x8 NSST and 4x4 NSST are both non-separable transforms, according to the composition of the transform combinations described in this document, so the 8x8 NSST has 64 inputs and 64 outputs, while the 4x4 NSST has 16 inputs and 16 outputs.
[0212] Both 8x8 NSST and 4x4 NSST are composed of a hierarchical combination of Gibbons rotations. The matrix corresponding to one Gibbons rotation is the same as the following equation (4), and the matrix product is as shown in the following equation (5).
[0213]
number
[0214]
number
[0215] As shown in Figure 13, one Gibbons rotation rotates two data, so a total of 32 or 8 Gibbons rotations are required to process 64 (in the case of 8x8 NSST) or 16 (in the case of 4x4 NSST) data, respectively.
[0216] Therefore, a Gibbons rotation layer is formed by bundling 32 or 8 elements. The output data of one Gibbons rotation layer is transferred to the next Gibbons rotation layer with a predetermined permutation as input data.
[0217] FIG. 14 shows an embodiment to which the present invention is applied, which shows a one-round configuration of a 4x4 NSST composed of a Givens rotation layer and permutation.
[0218] If we look carefully at Figure 14, we can see that in the case of 4x4 NSST, four Gibbons rotation layers are processed sequentially. The output data of the Gibbons rotation layer shown in Figure 14 goes through a fixed permutation (i.e. shuffling) and is transferred as the input data of the next Gibbons rotation layer.
[0219] As shown in FIG. 14, the permutation pattern is determined regularly, and in the case of 4x4 NSST, four Gibbons rotation layers and the permutation form one round.
[0220] In the case of 8x8 NSST, six Gibbons rotation layers and the permutation form one round. 4x4 NSST goes through two rounds, and 8x8 NSST goes through four rounds. Different rounds use the same permutation pattern, but the Gibbons rotation angles applied are different. Therefore, the angle data of all Gibbons rotations that make up each transformation must be stored.
[0221] In the last step, further substitution is finally performed on the data output through the Gibbons rotation layer, and the substitution information is stored separately for each conversion. In the forward NSST, the substitution is performed last, while in the reverse NSST, conversely, the reverse substitution is applied first.
[0222] In the case of the reverse NSST, when the Gibbons rotation layer and substitution applied in the forward NSST are executed in the reverse order, each Gibbons rotation angle is rotated with a (-) value.
[0223] FIG. 15 is a block diagram for explaining the operations of a forward reduced transform and a reverse reduced transform as an embodiment to which the present invention is applied.
[0224] Reduced Secondary Transform (RST)
[0225] When an orthogonal matrix representing a transform has an NxN form, a reduced transform (hereinafter referred to as "RT") leaves only R out of N transform basis vectors (R < N). The matrix of the forward RT for generating transform coefficients is given as in the following equation (6).
[0226]
Equation
[0227] Since the matrix of the reverse RT is the transpose matrix of the forward RT matrix, when the application of the forward RT and the reverse RT is illustrated, it is the same as FIG. 15. Here, the reduction factor is defined as R / N (R < N).
[0228] The number of elements in the reduced transform is R*N, which is smaller than the size of the full matrix (N*N). That is, the matrix required is R / N of the full matrix. Also, the number of multiplications required is RxN, which is R / N lower than the original NxN. When applying the reduced transform, we have R coefficients, so we can transfer only the values of R coefficients instead of N coefficients.
[0229] Assuming that the RT of the upper left 8x8 block of the transformation block that has undergone the linear transformation is applied, the RT can be named an 8x8 reduced secondary transformation (8x8 RST).
[0230] When the R value in Equation 6 is 16, the forward 8x8 RST has a 16x64 matrix shape, and the reverse 8x8 RST has a 64x16 matrix shape.
[0231] Also, the same configuration of the set of transformations as in Fig. 12 can be applied to the 8x8 RST. That is, a corresponding 8x8 RST can be applied based on the set of transformations in Fig. 12.
[0232] In one embodiment, when one transform set is composed of two or three transforms according to the intra prediction mode in FIG. 12, one of up to four transforms may be selected, including a case where no secondary transform is applied, where one transform can be viewed as an identity matrix.
[0233] When the four transforms are assigned indices of 0, 1, 2, and 3, respectively, a syntax element called an NSST index can be signaled for each transform block to specify the corresponding transform. That is, for an 8x8 top left block, 8x8 NSST can be specified in the case of NSST through the NSST index, and 8x8 RST can be specified in the configuration of RST. In addition, the 0th index can be assigned to an identity matrix, i.e., when no quadratic transform is applied.
[0234] When applying the forward 8x8 RST as in Equation 6, 16 valid transform coefficients are generated, so it can be seen that 64 input data constituting an 8x8 area is reduced to 16 output data. From the perspective of a two-dimensional area, only about 1 / 4 of the area is filled with valid transform coefficients. Therefore, the 16 output data obtained by applying the forward 8x8 RST can be filled in the 4x4 upper left area in FIG. 16.
[0235] FIG. 16 is a diagram illustrating a process of performing a reverse scan from the 64th to the 17th blocks based on a reverse scan order, as an embodiment to which the present invention is applied.
[0236] FIG. 16 shows a scan of the 17th coefficient to the 64th coefficient (in the forward scan order) when the forward scan order starts from 1. However, FIG. 16 shows a backward scan, which shows a backward scan from the 64th coefficient to the 17th coefficient.
[0237] 16, the upper left 4x4 region is a Region of Interest (ROI) to which valid transform coefficients are assigned, and the remaining regions are left empty, i.e., the remaining regions may be assigned a value of 0 by default.
[0238] If there is a valid non-zero transform coefficient outside the ROI region of FIG. 16, it means that the 8x8 RST is not applied. In this case, the corresponding NSST index coding can be omitted.
[0239] Conversely, if there are no non-zero transform coefficients outside the ROI region of Figure 16 (when 8x8 RST is applied, areas outside the ROI are assigned 0), it is possible that 8x8 RST has been applied, so an NSST index can be coded.
[0240] In this manner, the conditional NSST index coding can be performed after the residual coding process since it must be confirmed whether or not a transform coefficient is not zero.
[0241] The present invention deals with the design of RSTs and related optimization methods that can be applied to 4x4 blocks from the RST structure. The embodiments described herein can be applied not only to 4x4 RSTs, but also to 8x8 RSTs or other forms of transformation.
[0242] FIG. 17 shows three forward scan orders for blocks of transform coefficients (transform blocks) as an embodiment to which the present invention may be applied.
[0243] Embodiment 1: RST applicable to 4x4 blocks
[0244] A non-separable transform that can be applied to a 4x4 block is a 16x16 transform, i.e., if the data elements that make up a 4x4 block are arranged in a row-major or column-major order, they become a 16x1 vector, to which a non-separable transform can be applied.
[0245] The forward 16x16 transform is composed of 16 row-wise transform basis vectors, and the transform coefficients of the transform basis vectors are obtained by applying the inner product between the 16x1 vector and each transform basis vector. The process of obtaining the transform coefficients corresponding to all 16 transform basis vectors is the same as multiplying the input 16x1 vector by a 16x16 non-separable transform matrix.
[0246] The transform coefficients obtained by the matrix multiplication have a 16x1 vector shape, but each transform coefficient may have different statistical characteristics. For example, if a 16x1 transform coefficient vector is composed of the 0th element to the 15th element, the variance of the 0th element may be larger than the variance of the 15th element. In other words, the earlier an element is located, the larger the variance value and the larger the energy value.
[0247] By applying an inverse 16x16 non-separable transform to the 16x1 transform coefficients, the original 4x4 block of signals can be restored. If the forward 16x16 non-separable transform is an orthonormal transform, the inverse 16x16 transform can be obtained via the transpose matrix of the forward 16x16 transform.
[0248] A 4x4 block signal can be restored by multiplying the inverse 16x16 non-separable transform matrix by the 16x1 transform coefficient vector to obtain 16x1 vector data and arranging it in row-first or column-first order, as applied first.
[0249] As previously mentioned, the elements of a 16x1 transform coefficient vector may have different statistical properties.
[0250] If the transform coefficients located forward (close to the 0th element) have a larger energy, a signal close to the original signal can be restored even if an inverse transform is applied to some of the transform coefficients that appear earlier without using all the transform coefficients. For example, if an inverse 16x16 non-separable transform is composed of 16 column basis vectors, a 16xL matrix can be constructed by leaving only L column basis vectors. In addition, after leaving only the important L transform coefficients among the transform coefficients (Lx1 vector), a 16xL matrix and an Lx1 vector can be multiplied to restore a 16x1 vector with a small error from the original input 16x1 vector data.
[0251] As a result, since only L coefficients are used to restore data, it is better to obtain Lx1 transform coefficient vectors instead of 16x1 transform coefficient vectors when obtaining transform coefficients. In other words, by selecting L row-direction transform vectors in the forward 16x16 non-separable transform matrix to construct an Lx16 transform, and then multiplying it by a 16x1 input vector, the important L transform coefficients can be obtained.
[0252] The value of L has a range of 1≦L<16. Generally, L of the 16 transformation basis vectors can be selected in any manner. However, from the viewpoint of coding and decoding, it may be advantageous in terms of coding efficiency to select a transformation basis vector that is important in terms of signal energy.
[0253] Embodiment 2: Setting the application area of 4x4 RST and arranging the conversion coefficients
[0254] The 4x4 RST can be applied to a secondary transform, and can be applied secondarily to a block to which a primary transform such as Dct-type 2 has been applied. When the size of a block to which a primary transform has been applied is NxN, the size of a block to which a primary transform has been applied is generally larger than 4x4. Therefore, when applying the 4x4 RST to the NxN block, the following two methods are possible.
[0255] Embodiment 2-1) It is possible to apply the 4x4 RST to only a part of the NxN area, rather than to the entire NxN area. For example, it can be applied to only the upper left MxM area (M≦N).
[0256] In embodiment 2-2), after dividing the area to which the secondary transformation is applied into 4x4 blocks, a 4x4 RST can be applied to each divided block.
[0257] As an embodiment, the above-mentioned embodiments 2-1) and 2-2) can be applied in combination. For example, only the upper left MxM region can be divided into 4x4 blocks, and then 4x4 RST can be applied.
[0258] In one embodiment, a secondary transformation is applied only to the upper left 8x8 region, and if the NxN block is equal to or larger than 8x8, an 8x8 RST is applied, and if the NxN block is smaller than 8x8 (4x4, 8x4, 4x8), it can be divided into 4x4 blocks as in embodiment 2-2 and then a 4x4 RST can be applied to each block. Also, if 4xN / Nx4 (N>=16), a 4x4 RST can be applied.
[0259] When L (1≦L<16) transform coefficients are generated after applying 4×4 RST, there is a degree of freedom in how to arrange the L transform coefficients. However, since there is a fixed order when processing the transform coefficients in the residual coding step, the coding performance may change depending on how the L transform coefficients are arranged in a two-dimensional block.
[0260] For example, in the case of HEVC residual coding, coding starts from the position farthest from the DC position in order to improve coding performance by taking advantage of the fact that the value of the quantized coefficient is 0 or close to 0 as it moves farther away from the DC position.
[0261] Therefore, it may be advantageous in terms of coding performance to arrange the more important coefficients having high energy among the L transform coefficients so that they are coded later in the residual coding order.
[0262] Figure 17 shows three forward scan orders for 4x4 transform blocks (Coefficient Group (CG)) applied in HEVC. In residual coding, the scan order in Figure 17 is reversed (i.e., coding is performed from 16 to 1).
[0263] Since the three scanning orders presented in FIG. 17 are selected depending on the intra prediction mode, the present invention can be configured to determine the scanning order for the L transform coefficients depending on the intra prediction mode as well.
[0264] FIG. 18 illustrates the positions of valid transform coefficients and the order of forward scan for each 4x4 block when a diagonal scan is applied to the upper left 4x8 block and a 4x4 RST is applied, as an embodiment to which the present invention is applied.
[0265] When the upper left 4x8 block is divided into 4x4 blocks according to the diagonal scan order in FIG. 17 and a 4x4 RST is applied to each of them, if the value of L is 8 (i.e., only 8 out of 16 transform coefficients are left), the transform coefficients can be positioned as shown in FIG. 18.
[0266] Only half of each 4x4 block can have transform coefficients, and where an X appears, it can be assigned a value of 0 by default.
[0267] Therefore, L transform coefficients are arranged in each 4x4 block according to the scan order presented in Figure 17, and residual coding can be applied to the remaining (16 - L) positions of each 4x4 block by assuming that they are filled with 0s.
[0268] FIG. 19 shows an embodiment to which the present invention is applied, in which a diagonal scan is applied to the upper left 4x8 block and a 4x4 RST is applied, and valid transform coefficients of two 4x4 blocks are combined into one 4x4 block.
[0269] 19, it can be seen that L transform coefficients arranged in two 4x4 blocks can be combined into one. In particular, when the value of L is 8, the transform coefficients of the two 4x4 blocks are combined to completely fill one 4x4 block, so that there are no transform coefficients remaining in the other 4x4 block.
[0270] Therefore, for such vacant 4x4 blocks, most residual coding is no longer necessary, so the corresponding coded_sub_block_flag can be coded to 0.
[0271] In addition, in an embodiment of the present invention, various methods can be applied to how to mix the transform coefficients of two 4x4 blocks. Although they can be mixed in any order, the present invention can provide the following method.
[0272] 1) The transform coefficients of two 4x4 blocks are alternately shuffled in the scan order. That is, in FIG. 18, the transform coefficients of the upper block are JPEG2024164318000009.jpg1166, and the transformation coefficients of the lower block are When using JPEG2024164318000010.jpg1066 You can alternate between them like this: JPEG2024164318000011.jpg1165, or JPEG2024164318000012.jpg79 and You can also change the order of JPEG2024164318000013.jpg77. That is, You can set it so that JPEG2024164318000014.jpg108 comes first.
[0273] 2) The transform coefficients of the first 4x4 block can be arranged first, followed by the transform coefficients of the second 4x4 block. That is, You can connect and place it like this: JPEG2024164318000015.jpg1065. Or, You can also change the order, for example, JPEG2024164318000016.jpg1060.
[0274] Embodiment 3: A method for coding NSST index of 4x4 RST
[0275] When the 4x4 RST is applied as shown in FIG. 18, the L+1th to 16th transform coefficients can be filled with 0 values according to the scan order of the transform coefficients of each 4x4 block.
[0276] Therefore, if any one of the two 4x4 blocks has a non-zero value in the L+1 to 16 positions, it is determined that the 4x4 RST is not applied.
[0277] If the 4x4 RST also has a structure that selects and applies one of a set of prepared transformations like NSST, it is possible to signal a transformation index (which can be named an NSST index in this embodiment) indicating which transformation to apply.
[0278] If a decoder can know the NSST index through bitstream analysis, it is assumed that such analysis is performed after residual decoding.
[0279] If residual decoding is performed and it is confirmed that there is at least one non-zero transform coefficient between L+1-th and 16-th, then 4x4 RST is not applied, and the NSST index can be set not to be analyzed.
[0280] Therefore, the NSST index is selectively analyzed only when necessary, thereby reducing signaling costs.
[0281] As shown in Fig. 18, if a 4x4 RST is applied to a plurality of 4x4 blocks in a particular region (for example, the same 4x4 RST may be applied to all of them, or different 4x4 RSTs may be applied to each of them), a 4x4 RST to be applied to all of the 4x4 blocks may be specified via one NSST index. In this case, the same 4x4 RST may be specified, or a 4x4 RST to be applied to each of the 4x4 blocks may be specified.
[0282] Since the 4x4 RST and application of all the 4x4 blocks are determined by one NSST index, it can be checked during the residual decoding process whether a non-zero transform coefficient exists at positions L+1 to 16 for all the 4x4 blocks. If a non-zero transform coefficient exists at an impermissible position (L+1 to 16) in one 4x4 block as a result of the check, it can be configured not to code the NSST index.
[0283] The NSST index may be signaled separately for luma blocks and chroma blocks, and in the case of chroma blocks, separate NSST indices may be signaled for Cb and Cr, or one NSST index may be shared.
[0284] If Cb and Cr share one NSST index, the 4x4 RST specified by the same NSST index can be applied. In this case, the 4x4 RST itself for Cb and Cr can be the same, and the NSST index can be the same, but they can also have individual 4x4 RSTs.
[0285] To apply the above-mentioned conditional signaling to the shared NSST index, it can be configured to check that there are non-zero transform coefficients from L+1 to 16 for all 4x4 blocks of Cb and Cr, and not signal the NSST index if there are non-zero transform coefficients.
[0286] As shown in FIG. 19, when the transform coefficients of two 4x4 blocks are combined, when the 4x4 RST is applied, it is possible to determine whether the NSST index is to be signaled after checking whether a non-zero transform coefficient exists in a position where no valid transform coefficient exists.
[0287] For example, as shown in Figure 19(b), when L is 8 and 4x4 RST is applied to one 4x4 block, if there is no valid transform coefficient (block marked with X), the coded_sub_block_flag of the block without valid transform coefficients can be checked. In this case, if coded_sub_block_flag is 1, it can be set not to signal the NSST index.
[0288] Embodiment 4: Optimization method when coding of NSST index is performed before residual coding
[0289] When coding of the NSST index is performed before residual coding, whether or not to apply 4x4 RST is determined in advance, so that residual coding can be omitted for positions where the transform coefficients are assigned to 0.
[0290] Here, whether or not to apply the 4x4 RST can be configured to be known through the NSST index. For example, if the NSST index is 0, the 4x4 RST is not applied.
[0291] Alternatively, it can be signaled via another syntax element (e.g., NSST flag). For example, if another syntax element is NSST flag, the NSST flag is first parsed to determine whether to apply 4x4 RST, and if the value of the NSST flag is 1, residual coding can be omitted for positions where no valid transform coefficients can exist.
[0292] In one embodiment, when performing residual coding, the position of the last non-zero transform coefficient on the TU is coded first. If the coding of the NSST index is performed after the coding of the position of the last non-zero transform coefficient, and the position of the last non-zero transform coefficient is found to be a position where a non-zero transform coefficient cannot occur assuming the application of 4x4 RST, it can be configured not to code the NSST index and not to apply 4x4 RST.
[0293] For example, when 4x4 RST is applied to the position indicated by X in Figure 18, a valid transform coefficient is not located (e.g., a value of 0 can be satisfied), so if the last non-zero transform coefficient is located in the area indicated by X, coding of the NSST index can be omitted. If the last non-zero transform coefficient is not located in the area indicated by X, coding of the NSST index can be performed.
[0294] In one embodiment, when the NSST index is conditionally coded after coding of the position of the last non-zero transform coefficient to check whether to apply 4x4 RST, the remaining residual coding portion can be processed using the following two schemes.
[0295] When the 4x4 RST is not applied, the general residual coding is maintained as it is, that is, coding is performed under the assumption that a non-zero transform coefficient can exist at any position from the position of the last non-zero transform coefficient to the DC.
[0296] When applying 4x4 RST, since there are no transform coefficients for a particular position or particular 4x4 block (e.g., the X position in Figure 18 above may be filled with 0 by default), residual coding may not be performed for the corresponding position or block.
[0297] For example, when reaching the position indicated by X in Figure 18, coding of sig_coeff_flag can be omitted. Here, sig_coeff_flag indicates a flag indicating whether a non-zero transform coefficient exists at the corresponding position.
[0298] As shown in FIG. 19, when combining transform coefficients of two blocks, for a 4x4 block assigned to 0, the coding of coded_sub_block_flag can be omitted and the corresponding value can be induced to 0, and for the corresponding 4x4 block, all values can be induced to 0 without additional coding.
[0299] When coding the NSST index after coding the position of the last non-zero transform coefficient, if the x position (Px) and y position (Py) of the last non-zero transform coefficient are smaller than Tx and Ty, respectively, it is possible to omit the NSST index coding and not apply the 4x4 RST.
[0300] For example, Tx=1, Ty=1 means that if the last non-zero transform coefficient is at the DC position, NSST index coding is omitted.
[0301] The method of determining whether to perform NSST index coding through comparison with such a threshold can be applied differently to luma and chroma, for example, different Tx and Ty can be applied to luma and chroma, or a threshold can be applied to luma but not to chroma, or vice versa.
[0302] The two methods mentioned above, i.e., first, a method of omitting NSST index coding when the last non-zero transform coefficient is located in an area where no valid transform coefficients exist, and second, a method of omitting NSST index coding when the X and Y coordinates of the last non-zero transform coefficient are each smaller than a certain threshold value, can also be applied together.
[0303] For example, after checking a threshold value of the position coordinate of the last non-zero transform coefficient, it can be checked whether the last non-zero transform coefficient is located in an area where no valid transform coefficient exists, or the order can be changed.
[0304] The method presented in the fourth embodiment can also be applied to 8x8 RST. That is, if the last non-zero transform coefficient is located in a region other than the upper left 4x4 region in the upper left 8x8 region, the coding of the NSST index can be omitted, otherwise, the NSST index coding can be performed.
[0305] Also, if the values of the X and Y coordinates of the position of the last non-zero transform coefficient are all less than a threshold, the coding of the NSST index can be omitted, or the two methods can be applied together.
[0306] 5th embodiment: When RST is applied, different NSST index coding and residual coding methods are applied to luma and chroma.
[0307] The schemes described in the third and fourth embodiments may be applied differently to luma and chroma, that is, NSST index coding and residual coding schemes may be applied differently to luma and chroma.
[0308] For example, luma may apply the scheme of embodiment 4, and chroma may apply the scheme of embodiment 3. Or luma may apply the conditional NSST index coding presented in embodiment 3 or embodiment 4, and chroma may not apply the conditional NSST index coding. Or vice versa.
[0309] FIG. 20 shows a flowchart of a video signal encoding method according to an embodiment of the present invention, which is based on a Reduced Secondary Transform (RST).
[0310] The encoder may determine (or select) a forward secondary transform based on at least one of the prediction mode, block shape, and / or block size of the current block (S2010). In this case, the forward secondary transform candidates may include at least one of the embodiments of FIG. 6 and / or FIG. 12.
[0311] The encoder may determine an optimal forward quadratic transform through RD optimization (Rate Distortion optimization). The optimal forward quadratic transform may correspond to any one of a combination of a plurality of transforms, and the combination of the plurality of transforms may be defined by a transform index. For example, for RD optimization, results of performing all of forward quadratic transform, quantization, residual coding, etc. of each candidate may be compared. In this case, a formula such as cost = rate + λ·distortion or cost = distortion + λ·rate may be used, but the present invention is not limited thereto.
[0312] The encoder may signal a secondary transform index corresponding to the optimal forward secondary transform (S2020), where the secondary transform index may be any of the other embodiments described herein.
[0313] For example, the secondary transform index may be configured as the transform set of FIG. 12. Since one transform set is composed of two or three transforms depending on the intra prediction mode, it may be configured to select one of up to four transforms including the case where the secondary transform is not applied. When the four transforms are assigned indexes 0, 1, 2, and 3, respectively, the secondary transform index may be signaled for each block of transform coefficients to specify the transform to be applied. In this case, the 0th index may be assigned to an identity matrix, i.e., when the secondary transform is not applied.
[0314] In another embodiment, the signaling of the secondary transform index may be performed at any of the following stages: 1) before residual coding, 2) during residual coding (after position coding of the last non-zero transform coefficient), or 3) after residual coding. The above embodiment will be described in detail as follows.
[0315] Method for signaling secondary transform index prior to residual coding
[0316] The encoder can determine a forward quadratic transform.
[0317] The encoder may code a secondary transform index corresponding to the forward secondary transform.
[0318] The encoder can code the position of the last non-zero transform coefficient.
[0319] The encoder may perform residual coding of syntax elements other than the position of the last non-zero transform coefficient.
[0320] (2) Signaling secondary transform index during residual coding
[0321] The encoder can determine a forward quadratic transform.
[0322] The encoder can code the position of the last non-zero transform coefficient.
[0323] If the last non-zero transform coefficient is not located in a specific region, the encoder may code a secondary transform index corresponding to the forward secondary transform, where the specific region indicates a remaining region excluding a position where a non-zero transform coefficient may exist when transform coefficients are arranged according to a scan order when a reduced secondary transform is applied, but the present invention is not limited thereto.
[0324] The encoder may perform residual coding of syntax elements other than the position of the last non-zero transform coefficient.
[0325] Method for signaling secondary transform index after residual coding - Patents.com
[0326] The encoder can determine a forward quadratic transform.
[0327] The encoder can code the position of the last non-zero transform coefficient.
[0328] When the last non-zero conversion coefficient is not located in the specific region, the encoder can perform residual coding on syntax elements other than the position of the last non-zero conversion coefficient. Here, when the reduced second-order conversion is applied to the specific region, the specific region indicates the remaining region excluding the positions where non-zero conversion coefficients can exist when the conversion coefficients are arranged in the scan order. However, the present invention is not limited to this.
[0329] The encoder can code a second-order conversion index corresponding to the forward second-order conversion.
[0330] On the other hand, the encoder can perform a forward first-order conversion on the current block (residual block) (S2030). Here, the forward first-order conversion can be similarly applied to the S2010 stage and / or the S2020 stage.
[0331] The encoder can perform a forward second-order conversion on the current block using the optimal forward second-order conversion (S2040). For example, the optimal forward second-order conversion can be a reduced second-order conversion. The reduced second-order conversion means a conversion in which N pieces of residual data (Nx1 residual vector) are input and L pieces of conversion coefficient data (Lx1 conversion coefficient vector) are output (L < N).
[0332] As an embodiment, the reduced second-order conversion can be applied to a specific region of the current block. For example, when the current block is NxN, the specific region can mean the upper left N / 2xN / 2 region. However, the present invention is not limited to this and can be set differently based on at least one of the prediction mode, the shape of the block, or the block size. For example, when the current block is NxN, the specific region can mean the upper left MxM region (M ≦ N).
[0333] Meanwhile, the encoder may quantize the current block to generate a block of transform coefficients (S2050).
[0334] The encoder may perform entropy encoding on the blocks of transform coefficients to generate a bitstream.
[0335] FIG. 21 shows a flowchart of a video signal decoding process based on a Reduced Secondary Transform (RST) as an embodiment to which the present invention is applied.
[0336] The decoder may obtain a secondary transform index from the bitstream (S2110). Here, the secondary transform index may be any of the embodiments described herein. For example, the secondary transform index may include at least one of the embodiments shown in FIG. 6 and / or FIG. 12.
[0337] In another embodiment, the step of obtaining the secondary transform index may be performed at any one of the following stages: 1) before residual decoding, 2) during residual decoding (after decoding the position of the last non-zero transform coefficient), or 3) after residual decoding.
[0338] The decoder may derive a secondary transform corresponding to the secondary transform index (S2120). At this time, the secondary transform candidates may include at least one of the embodiments of FIG. 6 and / or FIG.
[0339] However, the steps S2110 and S2120 are merely exemplary embodiments, and the present invention is not limited thereto. For example, the decoder may derive a secondary transform based on at least one of a block shape and / or a block size in a prediction mode of the current block, without obtaining the secondary transform index.
[0340] On the one hand, the decoder can entropy-decode the bitstream to obtain a block of transform coefficients and perform inverse quantization on the block of transform coefficients (S2130).
[0341] The decoder can perform an inverse second-order transform on the block of inverse-quantized transform coefficients (S2140). For example, the inverse second-order transform can be a reduced second-order transform. The reduced second-order transform means a transform in which N pieces of residual data (Nx1 residual vector) are input and L pieces (L < N) of transform coefficient data (Lx1 transform coefficient vector) are output.
[0342] As one embodiment, the reduced second-order transform can be applied to a specific region of the current block. For example, when the current block is NxN, the specific region can mean the upper left N / 2xN / 2 region. However, the present invention is not limited thereto, and it can be set differently based on at least one of the prediction mode, the shape of the block, or the block size. For example, when the current block is NxN, the specific region can mean the upper left MxM region (M≦N) or MxL (M≦N, L≦N).
[0343] Then, the decoder can perform an inverse first-order transform on the result of the inverse second-order transform (S2150).
[0344] The decoder generates a residual block through step S2150, and a restored block is generated by adding the residual block and the prediction block.
[0345] Embodiment 6: Reduced Multiple Transform Selection (MTS)
[0346] In an embodiment of the present invention, a method for improving the complexity is proposed by applying a primary transform only to a predefined region. The complexity may increase when a combination of various multiple transforms (or transform kernels) such as MTS (e.g., DCT2, DST7, DCT8, DST1, Dct5, etc.) is selectively applied to the primary transform. In particular, as the size of the coding block (or transform block) increases, the complexity may increase significantly since various multiple transforms must be considered.
[0347] Therefore, in order to reduce the complexity, the present invention proposes a method of performing the transformation only on predefined regions according to certain conditions, rather than performing (or applying) the transformation on all regions.
[0348] As an embodiment, based on the method of reduced transform (RT) described above in Figs. 15 to 21, instead of applying a primary transform to a pixel block (luma block) of size MxM to obtain a transform block of size MxM, an encoder / decoder can obtain a transform block of size RxR by performing a transform only on an area of size RxR (M>=R). As an example, the RxR area can be the top-left RxR area in a current block (coding block, transform block).
[0349] As a result, there may be non-zero coefficients that are valid only in the RxR domain. As an example, in this case, the encoder / decoder may zero out coefficients that are in areas other than the RxR domain without performing any calculations.
[0350] Also, the encoder / decoder may apply the primary transform only to a predefined region determined according to the size of the coding block (or transform block) and / or the type of transform (or transform kernel). Table 3 below illustrates a Reduced Adaptive Multiple Transform (RAMT) using a predefined R value according to the size of the transform (or the size of the transform block). In the present invention, the Reduced Adaptive Multiple Transform (RAMT) indicating a reduced transform adaptively determined according to the block size may be referred to as a Reduced Multiple Transform Selection (MTS), a Reduced explicit multiple transform, a Reduced primary transform, etc.
[0351] [Table 3]
[0352] Referring to Table 3, at least one or more reduced transforms may be defined depending on the size of the transform (or the size of the transform block). In one embodiment, which of the reduced transforms illustrated in Table 3 is used may be determined based on the transform (or transform kernel) applied to the current block (coding block or transform block). Although Table 3 assumes that three reduced transforms are used, the present invention is not limited thereto, and one or more various numbers of reduced transforms may be predefined depending on the size of the transform.
[0353] In addition, in the embodiment of the present invention, in applying the above-mentioned reduced adaptive multiple transform, the reduced transform factor (R) may be determined depending on the primary transform. For example, when the primary transform is DCT2, the amount of calculation is relatively simple compared to other primary transforms (e.g., a combination of DCT7 and / or DCT8), so that the reduced transform may not be used for small-sized blocks or a relatively large R value may be used to minimize degradation of coding performance. Table 4 below illustrates an example of a Reduced Adaptive Multiple Transform (RAMT) that uses a predefined R value based on the size of the transform (or the size of the transform block) and the transform kernel.
[0354] [Table 4]
[0355] Referring to Table 4, when the transform applied to the primary transform is DCT2 and when it is another transform (eg, a combination of DCT7 and / or DCT8), different reduced transform factors are used.
[0356] FIG. 22 is a diagram illustrating a method for encoding a video signal using a reduced transform as an embodiment to which the present invention is applied.
[0357] Referring to FIG. 22, first, the encoder determines whether to apply a transform to a current block (S2201). The encoder may encode a transform skip flag based on the determined result. In this case, the step of encoding the transform skip flag may be included in step S2201.
[0358] The encoder determines a transform kernel to be applied to the primary transform of the current block if a transform is applied to the current block (S2202). The encoder may encode a transform index indicating the determined transform kernel, in which case a step of encoding the transform index may be included in step S2202.
[0359] The encoder determines a region to which a primary transform is applied to the current block based on a transform kernel to be applied to the primary transform of the current block and the size of the current block (S2203).
[0360] In one embodiment, the encoder may consider the coefficients in the remaining regions of the current block other than the region to which the linear transform is applied as zero.
[0361] Also, in one embodiment, the encoder may determine that if the transform kernel indicated by the transform index is a predefined transform and the width and / or height of the current block is larger than the predefined size, a region having a width and / or height of the predefined size is the region to which the primary transform is applied.
[0362] For example, the predefined transform may be any one of a combination of a plurality of transforms including a combination of DCT7 and / or DCT8, and the predefined size may be 16. Or, the predefined transform may be a remaining transform excluding DCT2. As another example, when the transform kernel indicated by the transform index is DCT2 and the width and / or height of the current block is greater than 32, the encoder may determine a region having a width and / or height of 32 as a region to which the primary transform is applied.
[0363] Also, in one embodiment, when the transform kernel indicated by the transform index belongs to a first transform group, the encoder may determine the smaller of the width of the current block and the first threshold as the width of the region to which the primary transform is applied, and may determine the smaller of the height of the current block and the first threshold as the height of the region to which the primary transform is applied. As an example, the first threshold may be 32, but the present invention is not limited thereto, and may be 4, 8, or 16 as shown in Table 3 or Table 4 above.
[0364] If the transform kernel indicated by the transform index belongs to the second transform group, the encoder may determine the smaller of the width of the current block and the second threshold as the width of the region to which the primary transform is applied, and may determine the smaller of the height of the current block and the second threshold as the height of the region to which the primary transform is applied. As an example, the second threshold may be 16, but the present invention is not limited thereto, and may be 4, 6, 8, 12, or 32 as shown in Table 3 or Table 4.
[0365] In one embodiment, the first transform group may include a DCT2, and the second transform group may include a combination of transforms including a combination of DCT7 and / or DCT8.
[0366] The encoder performs a forward primary transform using a transform kernel applied to the primary transform of the current block for the region to which the primary transform is applied (S2204). The encoder may obtain primary transformed transform coefficients by performing the forward primary transform. In one embodiment, the encoder may apply a secondary transform to the primary transformed transform coefficients, and in this case, the method described above with reference to FIGS. 4 to 20 may be applied.
[0367] FIG. 23 is a diagram illustrating a method for decoding a video signal using a reduced transform as an embodiment to which the present invention is applied.
[0368] The decoder checks whether a transform skip is applied to the current block (S2301).
[0369] If transform skip is not applied to the current block, the decoder obtains a transform index indicating a transform kernel to be applied to the current block from the video signal (S2302).
[0370] The decoder determines the region to which the primary transform of the current block is applied based on the transform kernel indicated by the transform index and the size (i.e., width and / or height) of the current block (S2303).
[0371] In one embodiment, the decoder may consider the coefficients in the remaining regions of the current block other than the region to which the linear transform is applied as zero.
[0372] Also, in one embodiment, the decoder may determine that if the transform kernel indicated by the transform index is a predefined transform and the width and / or height of the current block is larger than the predefined size, a region having a width and / or height of the predefined size is the region to which the primary transform is applied.
[0373] For example, the predefined transform may be any one of a combination of a plurality of transforms including a combination of DCT7 and / or DCT8, and the predefined size may be 16. Or, the predefined transform may be a remaining transform excluding DCT2. As another example, when the transform kernel indicated by the transform index is DCT2 and the width and / or height of the current block is greater than 32, the decoder may determine a region having a width and / or height of 32 as a region to which the primary transform is applied.
[0374] Also, in one embodiment, when the transform kernel indicated by the transform index belongs to a first transform group, the decoder may determine the smaller of the width of the current block and the first threshold as the width of the region to which the primary transform is applied, and may determine the smaller of the height of the current block and the first threshold as the height of the region to which the primary transform is applied. As an example, the first threshold may be 32, but the present invention is not limited thereto, and may be 4, 8, or 16 as shown in Table 3 or Table 4 above.
[0375] If the transform kernel indicated by the transform index belongs to the second transform group, the decoder may determine the smaller of the width of the current block and the second threshold as the width of the region to which the primary transform is applied, and may determine the smaller of the height of the current block and the second threshold as the height of the region to which the primary transform is applied. As an example, the second threshold may be 16, but the present invention is not limited thereto, and may be 4, 6, 8, 12, or 32 as shown in Table 3 or Table 4.
[0376] In one embodiment, the first transform group may include a DCT2, and the second transform group may include a combination of transforms including a combination of DCT7 and / or DCT8.
[0377] The decoder performs an inverse primary transform on the region to which the primary transform is applied, using a transform kernel indicated by the transform index (S2304). The decoder can obtain the primary inverse transformed transform coefficients by performing the inverse primary transform. In one embodiment, the decoder can apply a secondary transform to the inverse quantized transform coefficients before performing the primary transform, and in this case, the method described above in FIG. 4 to FIG. 20 can be applied.
[0378] According to an embodiment of the present invention, the worst case complexity can be significantly reduced by performing the transformation only on a predefined region depending on certain conditions.
[0379] Embodiment 7: Reduced Transform
[0380] In the embodiment of the present invention, various embodiments of the reduced transform proposed in the previous Figures 15 to 23 will be described in order to improve the problem of transform complexity. As described above, the reduced transform proposed in the present invention can be applied regardless of a primary transform (e.g., Dct, DST) or a secondary transform (e.g., NSST, LFNST (Low-Frequency Non-Separable Transform)).
[0381] FIG. 24 is a diagram illustrating a reduced transformation structure based on a reduced factor as an embodiment to which the present invention can be applied.
[0382] Referring to FIG. 24, for convenience of explanation, the decoder will be mainly described, however, the reduced transform proposed in this embodiment can be similarly applied to the encoder.
[0383] The decoder can apply an inverse downscaled transform to the dequantized transform coefficients, where the decoder uses a pre-determined (or pre-defined) downscaled factor (e.g., R or R / N) and / or transform kernel to perform the downscaled transform.
[0384] In one embodiment, the transform kernel may be selected based on available information such as the size (e.g., width / height) of the current block (coding block or transform block), intra / inter prediction mode, CIdx, etc. If the current coding block is a luma block, CIdx may have a value of 0. Otherwise (i.e., if the current coding block is a Cb or Cr block), CIdx may have a non-zero value such as 1.
[0385] FIG. 25 is a diagram illustrating a method of adaptively applying a reduced transform to perform decoding as an embodiment to which the present invention can be applied.
[0386] Referring to FIG. 25, for convenience of explanation, the description will be centered on a decoder, but the method of performing a transform using a reduced transform proposed in this embodiment can be applied to an encoder as well.
[0387] The decoder performs inverse quantization on the current block (S2501).
[0388] The decoder checks whether a transform is applied (or used) to the current block (S2502). If a transform is not applied to the current block, the decoder ends the transform process.
[0389] The decoder analyzes a transform index from the video signal indicating a transform kernel to be applied to the current block if a transform is to be applied to the current block (S2503).
[0390] The decoder checks whether the reduced inverse transform condition is satisfied (S2504). If the reduced inverse transform condition is not satisfied, the decoder performs a regular inverse transform on the current block (S2505). If the reduced inverse transform condition is satisfied, the decoder performs a reduced inverse transform on the current block (S2507). At this time, the decoder may select a transform kernel to be applied to the current block based on the transform index analyzed in step S2503 (S2506). In an embodiment, the transform kernel may be selected based on available information such as the size (e.g., width / height) of the current block (coding block or transform block), intra / inter prediction mode, CIdx, etc. Also, if a reduced inverse transform is applied to the current block, step S2506 may include a step of selecting a reduced factor.
[0391] In one embodiment, the reduced inverse transform condition may apply the above-mentioned 6 conditions (e.g., Tables 3 and 4). That is, it may be determined whether to apply the reduced inverse transform based on the size and transform type (or transform kernel) of the current block (coding block or transform block).
[0392] As an example, the reduced transform is used when the following specific condition is met:
[0393] - Width>TH && Height>TH (where TH indicates a specific threshold to a predefined value (e.g. 4))
[0394] Or
[0395] - Width * Height > K && MIN(width, height) > TH (where K, TH are predefined values indicating certain thresholds)
[0396] As another example, the reduced transform is used when the following specific condition is met: i.e., it can be applied to blocks up to (or smaller than) a certain size that meet the following specific condition:
[0397] - Width <= TH && Height <= TH (where TH is a predefined value (e.g. 8) indicating a specific threshold)
[0398] or
[0399] - Width * Height <= K && MIN(width, height) <= TH (where K, TH are predefined values indicating specific thresholds)
[0400] As another example, the reduced transform can be applied only to a predetermined group of blocks as follows.
[0401] - Width == TH && Height == TH
[0402] Or
[0403] - Width == Height
[0404] In an embodiment, if the conditions for using the reduced transform are not met, a regular transform may be applied. Specifically, the regular transform may be predefined and available in the encoder / decoder. The following is an example of a regular transform.
[0405] - Dct2, Dct4, Dct5, Dct7, Dct8
[0406] Or
[0407] - DST1, DST4, DST7,
[0408] or
[0409] - Non-separable transform
[0410] or
[0411] - NSST (HyGT)
[0412] or
[0413] - LFNST(Low-Frequency Non-Separable Transform)
[0414] The above conditions can be interpreted based on logical operators as shown in Table 5 below.
[0415] [Table 5]
[0416] Also, as shown in Figure 25, the reduced transform condition may depend on a transform index (Transform_idx) indicating a transform to be applied to a current block. As an example, the Transform_idx may be transmitted from the encoder to the decoder twice. One may be a horizontal transform index (Transform_idx_h) and the other may be a vertical transform index (Transform_idx_v).
[0417] FIG. 26 is a diagram illustrating a method of adaptively applying a reduced transform to perform decoding as an embodiment to which the present invention can be applied.
[0418] Referring to FIG. 26, for convenience of explanation, the description will be focused on a decoder, however, the method of performing a transform using a reduced transform proposed in this embodiment can be applied to an encoder as well.
[0419] In one embodiment of the present invention, the contractive transformation described above is used for the secondary transformation. In this regard, the overlapping description with the method described above in FIG. 25 will be omitted.
[0420] 1) After performing inverse quantization on the current block, the decoder checks whether to activate NSST for the current block. The decoder can determine whether it needs to analyze the NSST index using predefined conditions.
[0421] If NSST is activated, the decoder analyzes the NSST index to see if a reduced quadratic inverse transform applies.
[0422] 3) The decoder checks whether the reduced quadratic inverse variant is satisfied.
[0423] 4) If the reduced inverse transform condition is not met, the decoder performs a regular secondary inverse transform on the current block.
[0424] 5) If the reduced inverse secondary transform condition is met, the decoder performs a reduced inverse secondary transform on the current block.
[0425] 6) At this time, the decoder may select a transform kernel to be applied to the current block based on the NSST index. In an embodiment, the transform kernel may be selected based on available information such as the size (e.g., width / height) of the current block (coding block or transform block), intra / inter prediction mode, CIdx, etc. Also, if a reduced secondary inverse transform is applied to the current block, the decoder may select a reduced factor.
[0426] In one embodiment, the reduced secondary inverse transform condition may be applied according to the above-mentioned 6 conditions (e.g., Tables 3 and 4). That is, it may be determined whether to apply the reduced inverse transform based on the size of the current block (coding block or transform block) and the transform type (or transform kernel).
[0427] Embodiment 8: Reduced Transform as a Secondary Transform with Different Block Size
[0428] In one embodiment of the present invention, a reduced transform is proposed that takes into account various block sizes used in the secondary transform / secondary inverse transform. As an example, reduced transforms of different block sizes of 4x4, 8x8, and 16x16 used in the secondary transform / secondary inverse transform can be defined.
[0429] 27 and 28 are diagrams illustrating an example of a forward reduced secondary transform and a forward reduced secondary transform as an embodiment to which the present invention is applied, and pseudocode for deriving the same.
[0430] 27 and 28, there are shown a reduced secondary transform and a reduced inverse secondary transform where the block to which the secondary transform is applied is an 8x8 block and the reduction factor R = 16. The reduced secondary transform and the reduced inverse secondary transform as shown in FIG. 27 can be derived using the pseudocode shown in FIG.
[0431] 9. Reduced Transform as a Secondary Transform with Non-Rectangular Shape
[0432] As mentioned above, due to the complexity of the secondary transform when a non-separable transform is applied, in conventional video compression techniques, the secondary transform is applied to the upper left 4x4 or 8x8 region of the coding block (or transform block).
[0433] In an embodiment of the present invention, we propose a method for applying the reduced quadratic transform to 4x4 or 8x8 square regions as well as many other non-square shapes.
[0434] FIG. 29 is a diagram illustrating a method for applying a reduced quadratic transformation to a non-square region according to an embodiment of the present invention.
[0435] Referring to FIG. 29, in one embodiment, the reduced secondary transform may be applied to only a portion of the block, as shown in FIG.
[0436] In Figure 29, each square represents a 4x4 region. Therefore, the encoder / decoder can apply a reduced secondary transform to a region of 10x4 pixels, i.e., 160 pixels. In this case, the reduction factor R=16, and the entire RST matrix corresponds to a 16x160 matrix, thereby reducing the computational complexity of applying the secondary transform.
[0437] Embodiment 10: Reduced Factor
[0438] FIG. 30 is a diagram illustrating a contracted transformation controlled by a contraction factor as an embodiment to which the present invention is applied.
[0439] Referring to FIG. 30, as described above, the contraction transformation according to the embodiment of the present invention can be controlled by a contraction factor, as shown in FIG.
[0440] Specifically, when the reduction factor is modified, the memory complexity and the number of multiplication operations can be modified. As the reduction factor is expressed as R / N in FIG. 15 and Equation 6, the memory and multiplication operations can be reduced by modifying the reduction factor. For example, in the case of an 8x8 NSST where R=16, the memory and multiplication operations can be reduced by 1 / 4.
[0441] High Level Syntax
[0442] In an embodiment of the present invention, we propose a high-level syntactic construct for high-level control of reduced transformations.
[0443] In one embodiment, information regarding whether downscaled conversion is permitted, the size, and / or the downscale factor may be transmitted via a sequence parameter set (SPS), as shown in the example of Table 6 below. However, the present invention is not limited thereto, and the above syntax may also be signaled via a picture parameter set (PPS), a slice header, etc.
[0444] [Table 6]
[0445] Referring to Table 6, if Reduced_transform_enabled_flag is 1, the reduced transform is available and can be applied. If Reduced_transform_enabled_flag is 0, it indicates that the reduced transform cannot be used. If Reduced_transform_enabled_flag is not present, its value can be inferred to be equal to 0.
[0446] Reduced_transform_factor denotes a syntax element that specifies the number of reduced dimensions for the reduced transform.
[0447] min_reduced_transform_size indicates a syntax element that specifies the minimum transform size to apply the reduced transform to. If min_reduced_transform_size is not present, its value can be inferred to be equal to 0.
[0448] max_reduced_transform_size indicates a syntax element that specifies the maximum transform size to which the reduced transform is applied. If max_reduced_transform_size is absent, it can be assumed to be the same as 0.
[0449] reduced_transform_size denotes a syntax element that specifies the number of reduced dimensions for the reduced transform. If Reduced_transform_factor is absent it can be assumed to be equal to 0.
[0450] Secondary transform kernels
[0451] In the embodiments of the present invention, various quadratic transformation kernels are proposed.
[0452] In one embodiment, the 4x4 NSST kernel for DC mode can be defined as follows:
[0453] [Table 7]
[0454] Also, in one embodiment, a 4x4 NSST kernel for the planar mode can be defined as shown in Table 8 below.
[0455] [Table 8]
[0456] Also, in one embodiment, an 8x8 NSST kernel for DC mode can be defined as shown in Table 9 below.
[0457] [Table 9-1]
[0458] [Table 9-2]
[0459] [Table 9-3]
[0460] [Table 9-4]
[0461] [Table 9-5]
[0462] Also, in one embodiment, an 8x8 NSST kernel for planar mode can be defined as shown in Table 10 below.
[0463] [Table 10-1]
[0464] [Table 10-2]
[0465] [Table 10-3]
[0466] [Table 10-4]
[0467] [Table 10-5]
[0468] The transformation kernels in Tables 7-10, which we have looked at carefully above, can be defined into smaller size transformation kernels for reduced transformations.
[0469] For example, for a 4x4 NSST in DC mode with R=8, the memory and multiplications can be reduced by a factor of 2. Therefore, a reduced transform kernel can be defined with a smaller size by keeping only the upper half coefficients (8x16 matrix) of the transform kernel in Table 7 above, as shown in Table 11 below.
[0470] [Table 11]
[0471] In another example, for an 8x8 NSST in DC mode with R=16, the memory and multiplications can be reduced by a factor of 4. Thus, a reduced transform kernel can be defined with an even smaller size by keeping only the upper 1 / 4 of the coefficients (16x64 matrix) of the transform kernel in Table 9 above, as shown in Table 12 below.
[0472] [Table 12-1]
[0473] [Table 12-2]
[0474] [Table 12-3]
[0475] [Table 12-4]
[0476] [Table 12-5]
[0477] In the above example, each transform coefficient is represented by 9 bits (i.e., 1 bit: sign, 8 bits: absolute value from 0 to 255). In one embodiment of the present invention, different precisions are used to represent the transform coefficients. For example, instead of 9 bits, 8 bits are used to represent each coefficient. In this case, the sign bit does not change, but the range of the absolute value can be changed.
[0478] The above-described embodiments of the present invention have been described separately for the sake of convenience, but the present invention is not limited to these. In other words, the embodiments described in the above-described embodiments 1 to 12 may be implemented independently, or one or more of the embodiments may be combined and implemented.
[0479] FIG. 31 is a diagram illustrating an inverse conversion unit according to an embodiment to which the present invention is applied.
[0480] In FIG. 31, for convenience of explanation, the inverse transform unit is illustrated as one block, but the inter prediction unit may be realized in a configuration included in the encoder and / or decoder.
[0481] 31, the inverse transform unit realizes the functions, processes and / or methods proposed in the previous Figures 4 to 30. Specifically, the inverse transform unit may include a transform skip check unit 3101, a transform index acquisition unit 3102 and a primary inverse transform unit 3103.
[0482] A transform skip checker 3101 checks whether a transform skip is applied to the current block.
[0483] The transform index obtainer 3102 obtains a transform index indicating a transform kernel to be applied to a current block from a video signal when transform skip is not applied to the current block.
[0484] The primary inverse transform unit 3103 determines the region to which the primary transform of the current block is applied based on the transform kernel indicated by the transform index and the size (i.e., width and / or height) of the current block.
[0485] In one embodiment, the primary inverse transform unit 3103 may consider coefficients in remaining areas in the current block other than the area to which the primary transform is applied as zero.
[0486] Also, as one embodiment, the primary inverse transform unit 3103 may determine that when the transform kernel indicated by the transform index is a predefined transform and the width and / or height of the current block is greater than the predefined size, an area having a width and / or height of the predefined size is the area to which the primary transform is applied.
[0487] For example, the predefined transform may be any one of a combination of a plurality of transforms including a combination of DCT7 and / or DCT8, and the predefined size may be 16. Or, the predefined transform may be a remaining transform excluding DCT2. As another example, when the transform kernel indicated by the transform index is DCT2 and the width and / or height of the current block is greater than 32, the primary inverse transform unit 3103 may determine a region having a width and / or height of 32 as a region to which the primary transform is applied.
[0488] Also, as an embodiment, when the transform kernel indicated by the transform index belongs to a first transform group, the primary inverse transform unit 3103 may determine the smaller of the width of the current block and the first threshold as the width of the area to which the primary transform is applied, and may determine the smaller of the height of the current block and the first threshold as the height of the area to which the primary transform is applied. As an example, the first threshold may be 32, but the present invention is not limited thereto, and may be 4, 8, or 16 as shown in Table 3 or Table 4.
[0489] If the transform kernel indicated by the transform index belongs to the second transform group, the decoder may determine the smaller of the width of the current block and the second threshold as the width of the region to which the primary transform is applied, and may determine the smaller of the height of the current block and the second threshold as the height of the region to which the primary transform is applied. As an example, the second threshold may be 16, but the present invention is not limited thereto, and may be 4, 6, 8, 12, or 32 as shown in Table 3 or Table 4.
[0490] In one embodiment, the first transform group may include a DCT2, and the second transform group may include a combination of transforms including a combination of DCT7 and / or DCT8.
[0491] The primary inverse transform unit 3103 performs an inverse primary transform on a region to which the primary transform is applied, using a transform kernel indicated by a transform index. The primary inverse transform unit 3103 may obtain primary inverse transformed transform coefficients by performing the inverse primary transform. In one embodiment, the decoder may apply a secondary transform to the inverse quantized transform coefficients before performing the primary transform, and in this case, the methods described above with reference to FIGS. 4 to 20 may be applied.
[0492] FIG. 32 shows a video coding system to which the present invention is applied.
[0493] A video coding system may include a source device and a receiving device. The source device may transmit encoded video / image information or data to the receiving device via a digital storage medium or a network in the form of a file or streaming.
[0494] The source device may include a video source, an encoding apparatus, and a transmitter. The receiving device may include a receiver, a decoding apparatus, and a renderer. The encoding apparatus may be referred to as a video / video encoding apparatus, and the decoding apparatus may be referred to as a video / video decoding apparatus. The transmitter may be included in the encoding apparatus. The receiver may be included in the decoding apparatus. The renderer may include a display unit, which may be a separate device or an external component.
[0495] A video source may acquire video / images through a video / image capture, synthesis, or generation process. A video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated through a computer, etc., in which case the video / image capture process may be substituted for the process in which the associated data is generated.
[0496] An encoding device can encode an input video / image. The encoding device can perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.
[0497] The transmitting unit can transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit of a receiving device via a digital storage medium or a network in a file or streaming form. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit can include elements for generating a media file through a predetermined file format and can include elements for transmitting via a broadcasting / communication network. The receiving unit can extract the bitstream and transmit it to a decoding device.
[0498] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, prediction, etc. that correspond to the operations of the encoding device.
[0499] The renderer can render the decoded video / image. The rendered video / image can be displayed via a display unit.
[0500] FIG. 33 shows a structural diagram of a content streaming system as an embodiment to which the present invention is applied.
[0501] As shown in FIG. 33, a content streaming system to which the present invention is applied mainly includes an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.
[0502] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted.
[0503] The bitstream is generated by an encoding method or a bitstream generating method to which the present invention is applied, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.
[0504] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as an intermediary to inform the user of available services. When a user requests a desired service from the web server, the web server transfers the request to the streaming server, and the streaming server transmits multimedia data to the user. Here, the content streaming system may include a separate control server, and in this case, the control server controls commands / responses between devices in the content streaming system.
[0505] The streaming server receives content from a media repository and / or an encoding server. For example, when receiving content from the encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.
[0506] Examples of the user devices include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, head mounted displays (HMDs)), digital TVs, desktop computers, digital signage, and the like.
[0507] Each server in the content streaming system can be operated as a distributed server, in which case data received by each server can be processed in a distributed manner.
[0508] As described above, the embodiments described in the present invention may be implemented and performed on a processor, microprocessor, controller, or chip. For example, the functional units illustrated in each drawing may be implemented and performed on a computer, processor, microprocessor, controller, or chip.
[0509] In addition, the decoder and encoder to which the present invention is applied can be included in a multimedia broadcasting transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video conversation device, a real-time communication device such as a video communication, a mobile streaming device, a storage medium, a camcorder, a custom video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, and a medical video device, and can be used to process a video signal and a data signal. For example, an over-the-top video (OTT) device includes a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), and the like.
[0510] In addition, the processing method to which the present invention is applied can be produced in the form of a program executed by a computer and can be stored in a computer-readable storage medium. Multimedia data having a data structure according to the present invention can also be stored in a computer-readable storage medium. The computer-readable storage medium includes all kinds of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable storage medium can include, for example, Blu-ray Disc (BD), Universal Serial Bus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, magnetic tape, floppy disk, and optical data storage device. The computer-readable storage medium also includes media realized in the form of a carrier wave (e.g., transmission via the Internet). Also, the bit stream generated by the encoding method can be stored in a computer-readable storage medium or transmitted via a wired or wireless communication network.
[0511] Furthermore, the embodiments of the present invention may be realized as a computer program product with program code, the program code being executable on a computer according to the embodiments of the present invention. The program code may be stored on a computer readable carrier.
[0512] The above-described embodiments are combinations of the components and features of the present invention in a predetermined form. Each component or feature should be considered as an alternative unless otherwise explicitly stated. Each component or feature may be implemented in a form not combined with other components or features. It is also possible to combine some components and / or features to configure an embodiment of the present invention. The order of operations described in the embodiments of the present invention may be changed. Some configurations or features of any embodiment may be included in other embodiments, or may be replaced with corresponding configurations or features of other embodiments. It is obvious that claims that do not have an explicit reference relationship in the claims may be combined to configure an embodiment, or may be included as a new claim by amendment after filing.
[0513] Embodiments of the present invention may be implemented in various ways, such as hardware, firmware, software, or a combination thereof. In a hardware implementation, an embodiment of the present invention may be implemented using one or more application specific integrated circuits (ASICs), digital signal processors (DSPSs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, etc.
[0514] In the case of implementation by firmware or software, an embodiment of the present invention may be embodied in the form of a module, procedure, function, etc. that performs the functions or operations described above. The software code may be stored in a memory and driven by a processor. The memory may be located inside or outside the processor and may transmit and receive data to and from the processor by various means known in the art.
[0515] It is obvious to those skilled in the art that the present invention can be embodied in other specific forms without departing from the essential features of the present invention. Therefore, the above detailed description should not be interpreted as limiting in all respects, but should be regarded as illustrative. The scope of the present invention should be determined by a reasonable interpretation of the appended claims, and all modifications within the equivalent scope of the present invention are included in the scope of the present invention. [Industrial Applicability]
[0516] The above-described preferred embodiments of the present invention have been disclosed for illustrative purposes, and those skilled in the art may improve, modify, substitute or add various other embodiments within the technical spirit and scope of the present invention disclosed in the appended claims.
Claims
1. A video decoding method by a decoding device, comprising: obtaining transform index information indicating a transform kernel of a current block from the bitstream; determining a size of a non-zero region for an inverse linear transform based on the transform kernel indicated by the transform index information and a size of the current block; performing the inverse linear transform on the non-zero region based on the transform kernel indicated by the transform index information; The transformation kernels indicated by the transformation index information include a pair of a horizontal transformation kernel and a vertical transformation kernel; The size of the current block is 32×32, and the size of the non-zero region is determined to be 32×32 based on the transformation kernel to be applied to the current block belonging to a primary transformation group; The size of the current block is 32x32, and the size of the non-zero region is determined to be 16x16 based on the transformation kernel to be applied to the current block belonging to a secondary transformation group.
2. The video decoding method of claim 1 , wherein values of coefficients in remaining regions in the current block other than the non-zero regions are set to zero.
3. 2. The method of claim 1, wherein the primary transform group includes a DCT2 kernel and the secondary transform group does not include a DCT2 kernel.
4. 2. The method of claim 1, wherein the primary transform group includes a DCT2 kernel, and the secondary transform group includes at least one of a DCT7 kernel and a DCT8 kernel.
5. 1. A video encoding method performed by an encoding device, comprising: deriving a transformation kernel applied to the current block; determining a size of a non-zero region for a linear transform based on the transform kernel; performing the linear transform on the current block based on the transform kernel, where non-zero coefficients are located within the non-zero region; generating transform index information indicating that the transform kernel is to be applied to the current block; encoding video information including the transformation index information; The transformation kernels indicated by the transformation index information include a pair of a horizontal transformation kernel and a vertical transformation kernel; The size of the current block is 32×32, and the size of the non-zero region is determined to be 32×32 based on the transformation kernel to be applied to the current block belonging to a primary transformation group; The size of the current block is 32x32, and the size of the non-zero region is determined to be 16x16 based on the transformation kernel to be applied to the current block belonging to a secondary transformation group.
6. The video encoding method of claim 5 , wherein values of coefficients in remaining regions in the current block other than the non-zero regions are set to zero.
7. 6. The method of claim 5, wherein the primary transform group includes a DCT2 kernel and the secondary transform group does not include a DCT2 kernel.
8. 6. The method of claim 5, wherein the primary transform group includes a DCT2 kernel, and the secondary transform group includes at least one of a DCT7 kernel and a DCT8 kernel.
9. A method for transmitting data for a video, comprising the steps of: generating a bitstream of video information, the bitstream being generated by deriving a transform kernel to apply to a current block, determining a size of a non-zero region for a linear transform based on the transform kernel, performing a linear transform on the current block based on the transform kernel, where non-zero coefficients are located within the non-zero region, generating transform index information indicative of the transform kernel to be applied to the current block, and encoding the video information including the transform index information; transmitting said data including a bitstream of said video information; The transformation kernels indicated by the transformation index information include a pair of a horizontal transformation kernel and a vertical transformation kernel; The size of the current block is 32×32, and the size of the non-zero region is determined to be 32×32 based on the transformation kernel to be applied to the current block belonging to a primary transformation group; A method for transmitting data for an image, wherein a size of the current block is 32x32, and a size of the non-zero region is determined to be 16x16 based on the fact that the transformation kernel to be applied to the current block belongs to a secondary transformation group.
