Video coding method and device for selecting transform kernel and inverse transform kernel according to prediction mode
The video coding method selects transformation and inverse transformation kernels based on prediction modes to address the inefficiencies in existing technologies, thereby improving coding efficiency and video quality for larger and higher-resolution video data.
Patent Information
- Application Number
- PCT/KR2024/004885
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-09
- Filing Date
- 2024-04-12
- Publication Date
- 2024-10-24
AI Technical Summary
Current video coding technologies, such as H.264/AVC, HEVC, and VVC, face challenges in achieving better coding efficiency and higher picture quality due to increasing video data sizes, resolutions, and frame rates, necessitating a more effective method for selecting transformation and inverse transformation kernels based on prediction modes.
A video coding method and apparatus that determines non-separable transform and inverse transform kernels according to the prediction mode of a current block, involving the derivation of intra prediction modes and the application of specific transform kernels for efficient encoding and decoding processes.
This approach enhances video coding efficiency and improves video quality by effectively selecting transformation and inverse transformation kernels, optimizing data processing and compression.
Smart Images

Figure KR2024004885_24102024_PF_FP_ABST
Abstract
Description
Method and device for video coding for selecting a transform kernel and an inverse transform kernel according to a prediction mode
[0001] The present disclosure relates to a video coding method and device for selecting a transform kernel and an inverse transform kernel according to a prediction mode.
[0002] The content described below merely provides background information related to the present invention and does not constitute prior art.
[0003] Since video data has a large amount of data compared to voice data or still image data, it requires a lot of hardware resources, including memory, to store or transmit it without processing for compression.
[0004] Therefore, when storing or transmitting video data, an encoder is used to compress the video data and store or transmit it, and a decoder receives the compressed video data, decompresses it, and plays it back. Examples of such video compression technologies include H.264 / AVC, HEVC (High Efficiency Video Coding), and VVC (Versatile Video Coding), which improves encoding efficiency by about 30% compared to HEVC.
[0005] However, as the size, resolution, and frame rate of images are gradually increasing, and the amount of data that needs to be encoded is also increasing, a new compression technology that has better encoding efficiency and better image quality improvement than existing compression technologies is required.
[0006] The LFNST (Low-Frequency Non-Separable Transform) technology applies a secondary transform to the low-frequency region of the transform coefficients generated according to the primary transform of a transform block (TU, Transform Unit). In terms of encoding, the LFNST technology applies the secondary transform to L low-frequency primary transform coefficients among the W×H primary transform coefficients to generate K (wherein, K≤L) secondary transform coefficients. Here, the size of the transform kernel of LFNST is L×K. Meanwhile, the type of the transform kernel can be determined according to the intra prediction mode of the current TU, the size of the TU, and the LFNST index (lfnst_idx). At this time, the directional prediction mode, the DC mode, and the Planar mode are used as the intra prediction mode.
[0007] Non-separable Primary Transform (NSPT) technology applies a non-separable primary transform using a pre-trained transformation kernel instead of applying vertical and horizontal transformations to the residual signals of a block predicted in intra prediction mode. NSPT technology uses non-separable primary transform kernels of different sizes depending on the size of the residual block. For example, if the size of the transform block is 4x4, a 16x16 kernel is applied to generate 4x4 transformation coefficients. The generated transformation coefficients are arranged in the transform block according to a pre-determined scanning order. If the number of transformation coefficients generated after the transformation is less than the number of pixels in the transform block, the remaining area where the transformation coefficients are not arranged is filled with 0.
[0008] For the non-separable primary transform, transform kernels can be defined according to the block shape and intra prediction mode. For example, by leveraging the symmetry of square blocks, there are 35 transform kernel sets for square blocks, depending on the intra prediction mode. The non-separable primary transform can be applied to the luma component. Furthermore, when the non-separable primary transform is applied, the secondary transform (i.e., LFNST) may not be performed.
[0009] As mentioned above, LFNST and NSPT technologies utilize intra prediction modes to select transform kernels. Therefore, a comprehensive operational strategy is needed to select transform kernels based on prediction modes to improve video encoding efficiency and enhance video quality.
[0010] The present disclosure aims to provide a video coding method and device for performing transformation and inverse transformation of a current block by effectively selecting a transformation kernel and an inverse transformation kernel according to a prediction mode of the current block.
[0011] According to an embodiment of the present disclosure, a method for restoring a current block, performed by an image decoding device, is provided, comprising: obtaining inverse quantized transform coefficients for a transform block of the current block; decoding non-separable transform information from a bitstream, wherein the non-separable transform information indicates whether a non-separable inverse transform is applied, and the non-separable inverse transform represents a non-separable first inverse transform or a non-separable second inverse transform; and determining whether the non-separable transform information indicates performance of the non-separable inverse transform, wherein, if the non-separable transform information indicates performance of the non-separable inverse transform, the method comprises: deriving an intra prediction mode of the transform block according to a prediction mode of the current block; and determining a non-separable inverse transform kernel corresponding to a non-separable first inverse transform kernel or a non-separable second inverse transform kernel based on a size of the transform block and the intra prediction mode.
[0012] According to another embodiment of the present disclosure, a method for encoding a current block, performed by a video encoding apparatus, is provided, characterized by comprising: obtaining residual signals for a transform block of the current block; deriving an intra prediction mode of the transform block according to a prediction mode of the current block; determining a non-separable transform kernel corresponding to a non-separable primary transform kernel or a non-separable secondary transform kernel based on a size of the transform block and the intra prediction mode; applying the non-separable primary transform kernel to the residual signals to generate first primary transform coefficients; determining a pair of primary transform kernels in vertical and horizontal directions for the transform block; applying the pair of primary transform kernels to the residual signals to generate second primary transform coefficients; and applying the non-separable secondary transform kernel to the second primary transform coefficients to generate second transform coefficients.
[0013] According to another embodiment of the present disclosure, a computer-readable recording medium storing a bitstream generated by an image encoding method is provided, characterized in that the image encoding method comprises the steps of: obtaining residual signals for a transform block of a current block; deriving an intra prediction mode of the transform block according to a prediction mode of the current block; determining a non-separable transform kernel corresponding to a non-separable first transform kernel or a non-separable second inverse transform kernel based on a size of the transform block and the intra prediction mode; applying the non-separable first transform kernel to the residual signals to generate first first transform coefficients; explicitly or implicitly determining a pair of first transform kernels in vertical and horizontal directions for the transform block; applying the pair of first transform kernels to the residual signals to generate second first transform coefficients; and applying the non-separable second transform kernel to the second first transform coefficients to generate second transform coefficients.
[0014] As described above, according to the present embodiment, by providing a video coding method and device that performs transformation and inverse transformation of a current block by effectively selecting a transformation kernel and an inverse transformation kernel according to a prediction mode of a current block, it is possible to improve video encoding efficiency and enhance video quality.
[0015] FIG. 1 is an exemplary block diagram of an image encoding device capable of implementing the techniques of the present disclosure.
[0016] Figure 2 is a drawing for explaining a method of dividing a block using the QTBTTT (QuadTree plus BinaryTree TernaryTree) structure.
[0017] FIGS. 3A and 3B are diagrams illustrating multiple intra prediction modes, including wide-angle intra prediction modes.
[0018] Figure 4 is an example diagram of the surrounding blocks of the current block.
[0019] FIG. 5 is an exemplary block diagram of an image decoding device capable of implementing the techniques of the present disclosure.
[0020] Figures 6a and 6b are exemplary diagrams showing MIP (Matrix-weighted Intra Prediction) technology.
[0021] FIG. 7 is a block diagram illustrating in detail a portion of an image decoding device according to one embodiment of the present disclosure.
[0022] FIG. 8 is an exemplary diagram showing a method for determining an inverse transform kernel according to one embodiment of the present disclosure.
[0023] FIG. 9 is an exemplary diagram showing determination of a prediction mode of a current TU (Transform Unit) according to one embodiment of the present disclosure.
[0024] FIG. 10 is an exemplary diagram showing determination of a prediction mode of a current TU according to another embodiment of the present disclosure.
[0025] FIG. 11 is an exemplary diagram showing a directional filter according to another embodiment of the present disclosure.
[0026] FIG. 12 is a flowchart illustrating a method by which an image encoding device transforms a transform block according to one embodiment of the present disclosure.
[0027] FIG. 13 is a flowchart illustrating a method for an image decoding device to inversely transform a transform block according to one embodiment of the present disclosure.
[0028] Hereinafter, embodiments of the present invention will be described in detail with reference to exemplary drawings. When designating components in each drawing, it should be noted that, where possible, identical components are given the same reference numerals, even if they appear in different drawings. Furthermore, in describing the present embodiments, detailed descriptions of related known structures or functions will be omitted if they are deemed to obscure the gist of the present embodiments.
[0029] FIG. 1 is an exemplary block diagram of an image encoding device capable of implementing the techniques of the present disclosure. Hereinafter, the image encoding device and its subcomponents will be described with reference to the illustration in FIG. 1.
[0030] The video encoding device may be configured to include a picture segmentation unit (110), a prediction unit (120), a subtractor (130), a transformation unit (140), a quantization unit (145), a reordering unit (150), an entropy encoding unit (155), an inverse quantization unit (160), an inverse transformation unit (165), an adder (170), a loop filter unit (180), and a memory (190).
[0031] Each component of the video encoding device may be implemented in hardware, software, or a combination of hardware and software. Furthermore, the functions of each component may be implemented in software, with a microprocessor executing the software functions corresponding to each component.
[0032] A single image (video) is composed of one or more sequences containing multiple pictures. Each picture is divided into multiple regions, and encoding is performed for each region. For example, a single picture is divided into one or more tiles and / or slices. Here, one or more tiles can be defined as a tile group. Each tile or slice is divided into one or more Coding Tree Units (CTUs). Each CTU is then divided into one or more Coding Units (CUs) by a tree structure. Information applied to each CU is encoded as the syntax of the CU, and information commonly applied to CUs included in a CTU is encoded as the syntax of the CTU. In addition, information commonly applied to all blocks within a single slice is encoded as the syntax of the slice header, and information applied to all blocks constituting one or more pictures is encoded in the Picture Parameter Set (PPS) or the picture header. Furthermore, information commonly referenced by multiple pictures is encoded in a Sequence Parameter Set (SPS). And, information commonly referenced by one or more SPS is encoded in a Video Parameter Set (VPS). In addition, information commonly applied to one tile or tile group may be encoded as syntax of a tile or tile group header. Syntaxes included in an SPS, PPS, slice header, tile or tile group header may be referred to as high level syntax.
[0033] The picture segmentation unit (110) determines the size of the CTU. Information about the size of the CTU (CTU size) is encoded as the syntax of SPS or PPS and transmitted to the image decoding device.
[0034] The picture segmentation unit (110) divides each picture constituting an image into a plurality of CTUs having a predetermined size, and then recursively divides the CTUs using a tree structure. A leaf node in the tree structure becomes a CU, which is a basic unit of encoding.
[0035] The tree structure may be a QuadTree (QT) in which an upper node (or parent node) is divided into four lower nodes (or child nodes) of the same size, a BinaryTree (BT) in which an upper node is divided into two lower nodes, or a TernaryTree (TT) in which an upper node is divided into three lower nodes in a 1:2:1 ratio, or a structure that mixes two or more of the QT structures, BT structures, and TT structures. For example, a QTBT (QuadTree plus BinaryTree) structure may be used, or a QTBTTT (QuadTree plus BinaryTree TernaryTree) structure may be used. Here, BTTT may be combined and referred to as a MTT (Multiple-Type Tree).
[0036] Figure 2 is a drawing for explaining a method of dividing a block using the QTBTTT structure.
[0037] As illustrated in FIG. 2, a CTU may first be split into a QT structure. The quadtree splitting may be repeated until the size of the splitting block reaches the minimum block size (MinQTSize) of the leaf node allowed in the QT. A first flag (QT_split_flag) indicating whether each node of the QT structure is split into four nodes of the lower layer is encoded by the entropy encoding unit (155) and signaled to the image decoding device. If the leaf node of the QT is not larger than the maximum block size (MaxBTSize) of the root node allowed in the BT, it may be further split into one or more of the BT structure or the TT structure. There may be multiple splitting directions in the BT structure and / or the TT structure. For example, there may be two directions in which the block of the corresponding node is split horizontally and two directions in which the block is split vertically. As illustrated in FIG. 2, when MTT splitting begins, a second flag (mtt_split_flag) indicating whether nodes have been split, and if splitting has occurred, a flag indicating the splitting direction (vertical or horizontal) and / or a flag indicating the splitting type (Binary or Ternary) are encoded by the entropy encoding unit (155) and signaled to the image decoding device.
[0038] Alternatively, before encoding the first flag (QT_split_flag) indicating whether each node is split into four nodes of a lower layer, a CU split flag (split_cu_flag) indicating whether the node is split may be encoded. If the CU split flag (split_cu_flag) value indicates that the node is not split, the block of the corresponding node becomes a leaf node in the split tree structure and becomes a CU (coding unit), which is a basic unit of encoding. If the CU split flag (split_cu_flag) value indicates that the node is split, the video encoding device starts encoding from the first flag in the above-described manner.
[0039] As another example of a tree structure, when QTBT is used, there may be two types: a type that horizontally splits the block of the corresponding node into two blocks of the same size (i.e., symmetric horizontal splitting) and a type that vertically splits it (i.e., symmetric vertical splitting). A split flag (split_flag) indicating whether each node of the BT structure is split into blocks of a lower layer and split type information indicating the type of split are encoded by the entropy encoding unit (155) and transmitted to the image decoding device. Meanwhile, there may additionally be a type that splits the block of the corresponding node into two blocks of an asymmetrical shape. The asymmetric shape may include a shape that splits the block of the corresponding node into two rectangular blocks with a size ratio of 1:3, or a shape that splits the block of the corresponding node in a diagonal direction.
[0040] A CU can have various sizes depending on the QTBT or QTBTTT partitioning from the CTU. Hereinafter, the block corresponding to the CU to be encoded or decoded (i.e., the leaf node of the QTBTTT) is referred to as the "current block." Depending on the QTBTTT partitioning employed, the current block may be rectangular as well as square.
[0041] The prediction unit (120) predicts the current block and generates a prediction block. The prediction unit (120) includes an intra prediction unit (122) and an inter prediction unit (124).
[0042] In general, each current block within a picture can be predictively coded. Prediction of the current block can typically be performed using either intra-prediction (using data from the picture containing the current block) or inter-prediction (using data from a picture coded before the picture containing the current block). Inter-prediction encompasses both unidirectional and bidirectional prediction.
[0043] The intra prediction unit (122) predicts pixels within the current block using pixels (reference pixels) located around the current block within the current picture including the current block. There are multiple intra prediction modes depending on the prediction direction. For example, as shown in Fig. 3a, the multiple intra prediction modes may include two non-directional modes including the Planar mode and the DC mode, and 65 directional modes. The surrounding pixels to be used and the calculation formula are defined differently depending on each prediction mode.
[0044] For efficient directional prediction for a rectangular current block, directional modes (intra prediction modes 67 to 80 and -1 to -14) indicated by dotted arrows in Fig. 3b may be additionally used. These may be referred to as "wide-angle intra-prediction modes." In Fig. 3b, the arrows point to corresponding reference samples used for prediction, and do not indicate the prediction direction. The prediction direction is opposite to the direction indicated by the arrows. Wide-angle intra-prediction modes are modes that perform prediction in the opposite direction of a specific directional mode without additional bit transmission when the current block is rectangular. At this time, among the wide-angle intra-prediction modes, some wide-angle intra-prediction modes available for the current block may be determined based on the ratio of the width and height of the rectangular current block. For example, wide-angle intra prediction modes (intra prediction modes 67 to 80) having an angle less than 45 degrees are available when the current block is a rectangular shape whose height is smaller than its width, and wide-angle intra prediction modes (intra prediction modes -1 to -14) having an angle greater than -135 degrees are available when the current block is a rectangular shape whose width is larger than its height.
[0045] The intra prediction unit (122) can determine an intra prediction mode to be used to encode the current block. In some examples, the intra prediction unit (122) can encode the current block using multiple intra prediction modes and select an appropriate intra prediction mode to be used from the tested modes. For example, the intra prediction unit (122) can calculate bit-rate distortion values using rate-distortion analysis for multiple tested intra prediction modes and select an intra prediction mode with the best bit-rate distortion characteristics among the tested modes.
[0046] The intra prediction unit (122) selects one intra prediction mode from among multiple intra prediction modes and predicts the current block using surrounding pixels (reference pixels) and an operation formula determined according to the selected intra prediction mode. Information about the selected intra prediction mode is encoded by the entropy encoding unit (155) and transmitted to the image decoding device.
[0047] The inter prediction unit (124) generates a prediction block for the current block using a motion compensation process. The inter prediction unit (124) searches for a block most similar to the current block within reference pictures that were encoded and decoded before the current picture, and generates a prediction block for the current block using the searched block. Then, a motion vector (MV) corresponding to the displacement between the current block within the current picture and the prediction block within the reference picture is generated. Generally, motion estimation is performed on the luma component, and the motion vector calculated based on the luma component is used for both the luma component and the chroma component. The motion information including information on the reference picture used to predict the current block and information on the motion vector is encoded by the entropy encoding unit (155) and transmitted to the image decoding device.
[0048] The inter prediction unit (124) may perform interpolation on a reference picture or a reference block to improve prediction accuracy. That is, subsamples between two consecutive integer samples are interpolated by applying filter coefficients to a plurality of consecutive integer samples including the two integer samples. When a process of searching for a block most similar to the current block is performed on the interpolated reference picture, the motion vector can be expressed up to a precision in decimal units rather than a precision in integer sample units. The precision or resolution of the motion vector can be set differently for each target region to be encoded, such as a slice, tile, CTU, CU, etc. When such adaptive motion vector resolution (AMVR) is applied, information on the motion vector resolution to be applied to each target region must be signaled for each target region. For example, when the target region is a CU, information on the motion vector resolution applied to each CU is signaled. Information on the motion vector resolution may be information indicating the precision of a differential motion vector, which will be described later.
[0049] Meanwhile, the inter prediction unit (124) can perform inter prediction using bi-prediction. In the case of bi-prediction, two reference pictures and two motion vectors indicating the block position most similar to the current block within each reference picture are used. The inter prediction unit (124) selects a first reference picture and a second reference picture from reference picture list 0 (RefPicList0) and reference picture list 1 (RefPicList1), respectively, and searches for a block similar to the current block within each reference picture to generate a first reference block and a second reference block. Then, the first reference block and the second reference block are averaged or weighted averaged to generate a prediction block for the current block. Then, motion information including information on two reference pictures used to predict the current block and information on two motion vectors is transmitted to the entropy encoding unit (155). Here, reference picture list 0 may be composed of pictures that are before the current picture in display order among the restored pictures, and reference picture list 1 may be composed of pictures that are after the current picture in display order among the restored pictures. However, this is not necessarily limited to this, and restored pictures that are after the current picture in display order may be additionally included in reference picture list 0, and conversely, restored pictures that are before the current picture may be additionally included in reference picture list 1.
[0050] Various methods can be used to minimize the number of bits required to encode motion information.
[0051] For example, if the reference picture and motion vector of the current block are identical to those of a neighboring block, the motion information of the current block can be transmitted to the image decoding device by encoding information that can identify the neighboring block. This method is called 'merge mode'.
[0052] In merge mode, the inter prediction unit (124) selects a predetermined number of merge candidate blocks (hereinafter referred to as 'merge candidates') from the surrounding blocks of the current block.
[0053] As the surrounding blocks for deriving merge candidates, all or part of the left block (A0), the lower left block (A1), the upper block (B0), the upper right block (B1), and the upper left block (B2) adjacent to the current block within the current picture may be used, as illustrated in FIG. 4. In addition, a block located within a reference picture (which may or may not be the same as the reference picture used to predict the current block) other than the current picture in which the current block is located may be used as a merge candidate. For example, a block co-located with the current block within the reference picture or blocks adjacent to the block at the co-located block may be additionally used as a merge candidate. If the number of merge candidates selected by the method described above is less than a preset number, a 0 vector is added to the merge candidates.
[0054] The inter prediction unit (124) uses these surrounding blocks to construct a merge list containing a predetermined number of merge candidates. Among the merge candidates included in the merge list, the merge candidate to be used as motion information of the current block is selected and merge index information for identifying the selected candidate is generated. The generated merge index information is encoded by the entropy encoding unit (155) and transmitted to the video decoding device.
[0055] Merge Skip mode is a special case of merge mode. After quantization, when all transform coefficients for entropy encoding are close to zero, only neighboring block selection information is transmitted without transmitting residual signals. By utilizing merge skip mode, relatively high encoding efficiency can be achieved for low-motion images, still images, and screen content images.
[0056] Hereinafter, merge mode and merge skip mode are collectively referred to as merge / skip mode.
[0057] Another method for encoding motion information is Advanced Motion Vector Prediction (AMVP) mode.
[0058] In AMVP mode, the inter prediction unit (124) derives predicted motion vector candidates for the motion vector of the current block using neighboring blocks of the current block. As neighboring blocks used to derive predicted motion vector candidates, all or some of the left block (A0), the lower left block (A1), the upper block (B0), the upper right block (B1), and the upper left block (B2) adjacent to the current block in the current picture as shown in FIG. 4 may be used. In addition, a block located in a reference picture (which may or may not be the same as the reference picture used to predict the current block) other than the current picture in which the current block is located may be used as the neighboring block used to derive predicted motion vector candidates. For example, a block co-located with the current block in the reference picture or blocks adjacent to the block in the co-located block may be used. If the number of motion vector candidates is less than a preset number by the method described above, a 0 vector is added to the motion vector candidates.
[0059] The inter prediction unit (124) derives predicted motion vector candidates using the motion vectors of these surrounding blocks, and determines a predicted motion vector for the motion vector of the current block using the predicted motion vector candidates. Then, the predicted motion vector is subtracted from the motion vector of the current block to produce a differential motion vector.
[0060] The predicted motion vector can be obtained by applying a predefined function (e.g., median, mean, etc.) to the predicted motion vector candidates. In this case, the image decoding device also knows the predefined function. In addition, since the surrounding blocks used to derive the predicted motion vector candidates are blocks that have already been encoded and decoded, the image decoding device also already knows the motion vectors of the surrounding blocks. Therefore, the image encoding device does not need to encode information to identify the predicted motion vector candidates. Therefore, in this case, information about the differential motion vector and information about the reference picture used to predict the current block are encoded.
[0061] Alternatively, the predicted motion vector can be determined by selecting one of the predicted motion vector candidates. In this case, information for identifying the selected predicted motion vector candidate is additionally encoded, along with information about the differential motion vector and the reference picture used to predict the current block.
[0062] The subtractor (130) subtracts the prediction block generated by the intra prediction unit (122) or inter prediction unit (124) from the current block to generate a residual block.
[0063] The transformation unit (140) transforms residual signals within a residual block having pixel values in a spatial domain into transform coefficients in a frequency domain. The transformation unit (140) may transform the residual signals within the residual block using the entire size of the residual block as a transformation unit, or may divide the residual block into a plurality of sub-blocks and use the sub-blocks as transformation units to perform the transformation. Alternatively, the residual signals may be transformed using only the transformation domain sub-block as a transformation unit by dividing the sub-blocks into two sub-blocks, that is, a transformation domain and a non-transform domain. Here, the transformation domain sub-block may be one of two rectangular blocks having a size ratio of 1:1 with respect to the horizontal axis (or vertical axis). In this case, a flag (cu_sbt_flag) indicating that only a sub-block has been converted, directionality (vertical / horizontal) information (cu_sbt_horizontal_flag), and / or position information (cu_sbt_pos_flag) are encoded by the entropy encoding unit (155) and signaled to the image decoding device. In addition, the size of the conversion area sub-block may have a size ratio of 1:3 with respect to the horizontal axis (or vertical axis), and in this case, a flag (cu_sbt_quad_flag) distinguishing the corresponding division is additionally encoded by the entropy encoding unit (155) and signaled to the image decoding device.
[0064] Meanwhile, the transformation unit (140) can individually perform transformations on the residual block in the horizontal and vertical directions. For the transformation, various types of transformation functions or transformation matrices can be used. For example, a pair of transformation functions for horizontal transformation and vertical transformation can be defined as a Multiple Transform Set (MTS). The transformation unit (140) can select one transformation function pair with the best transformation efficiency among the MTS and transform the residual block in the horizontal and vertical directions, respectively. Information (mts_idx) on the transformation function pair selected among the MTS is encoded by the entropy encoding unit (155) and signaled to the image decoding device.
[0065] The quantization unit (145) quantizes the transform coefficients output from the transform unit (140) using quantization parameters and outputs the quantized transform coefficients to the entropy encoding unit (155). The quantization unit (145) may directly quantize a related residual block without transformation for a certain block or frame. The quantization unit (145) may also apply different quantization coefficients (scaling values) according to the positions of the transform coefficients within the transform block. The quantization matrix applied to the quantized transform coefficients arranged in two dimensions may be encoded and signaled to an image decoding device.
[0066] The rearrangement unit (150) can perform rearrangement of coefficient values for quantized residual values.
[0067] The reordering unit (150) can change a two-dimensional coefficient array into a one-dimensional coefficient sequence by using coefficient scanning. For example, the reordering unit (150) can output a one-dimensional coefficient sequence by scanning from the DC coefficient to the coefficients of the high-frequency region by using a zig-zag scan or a diagonal scan. Depending on the size of the transformation unit and the intra prediction mode, a vertical scan that scans the two-dimensional coefficient array in the column direction or a horizontal scan that scans the two-dimensional block-shaped coefficients in the row direction may be used instead of the zig-zag scan. That is, depending on the size of the transformation unit and the intra prediction mode, the scanning method to be used may be determined among the zig-zag scan, the diagonal scan, the vertical scan, and the horizontal scan.
[0068] The entropy encoding unit (155) generates a bitstream by encoding a sequence of one-dimensional quantized transform coefficients output from the rearrangement unit (150) using various encoding methods such as CABAC (Context-based Adaptive Binary Arithmetic Code) and Exponential Golomb.
[0069] In addition, the entropy encoding unit (155) encodes information related to block division, such as CTU size, CU division flag, QT division flag, MTT division type, and MTT division direction, so that the image decoding device can divide the block in the same manner as the image encoding device. In addition, the entropy encoding unit (155) encodes information about a prediction type indicating whether the current block is encoded by intra prediction or inter prediction, and encodes intra prediction information (i.e., information about an intra prediction mode) or inter prediction information (information about an encoding mode of motion information (merge mode or AMVP mode), a merge index in the case of a merge mode, and a reference picture index and a differential motion vector in the case of an AMVP mode) according to the prediction type. In addition, the entropy encoding unit (155) encodes information related to quantization, that is, information about a quantization parameter and information about a quantization matrix.
[0070] The inverse quantization unit (160) inversely quantizes the quantized transform coefficients output from the quantization unit (145) to generate transform coefficients. The inverse transform unit (165) transforms the transform coefficients output from the inverse quantization unit (160) from the frequency domain to the spatial domain to restore the residual block.
[0071] An adder (170) adds the restored residual block and the predicted block generated by the prediction unit (120) to restore the current block. The pixels within the restored current block are used as reference pixels when intra-predicting the next block.
[0072] The loop filter unit (180) performs filtering on restored pixels to reduce blocking artifacts, ringing artifacts, blurring artifacts, etc. that occur due to block-based prediction and transformation / quantization. The loop filter unit (180) may include all or part of a deblocking filter (182), a sample adaptive offset (SAO) filter (184), and an adaptive loop filter (ALF, 186) as an in-loop filter.
[0073] The deblocking filter (182) filters the boundaries between restored blocks to remove blocking artifacts caused by block-based encoding / decoding, and the SAO filter (184) and the ALF (186) perform additional filtering on the deblocking-filtered image. The SAO filter (184) and the ALF (186) are filters used to compensate for the differences between restored pixels and original pixels caused by lossy coding. The SAO filter (184) improves not only subjective image quality but also encoding efficiency by applying an offset in units of CTUs. In contrast, the ALF (186) performs block-based filtering, and compensates for distortion by applying different filters by distinguishing the edges and degrees of variation of the corresponding block. Information on filter coefficients to be used in the ALF can be encoded and signaled to an image decoding device.
[0074] The restored blocks filtered through the deblocking filter (182), SAO filter (184), and ALF (186) are stored in the memory (190). When all blocks within a picture are restored, the restored picture can be used as a reference picture for inter-predicting blocks within a picture to be encoded later.
[0075] The video encoding device can store the bitstream of encoded video data on a non-transitory storage medium or transmit it to the video decoding device using a communication network.
[0076] FIG. 5 is an exemplary block diagram of an image decoding device capable of implementing the techniques of the present disclosure. Hereinafter, the image decoding device and its subcomponents will be described with reference to FIG. 5.
[0077] The video decoding device may be configured to include an entropy decoding unit (510), a rearrangement unit (515), an inverse quantization unit (520), an inverse transformation unit (530), a prediction unit (540), an adder (550), a loop filter unit (560), and a memory (570).
[0078] Similar to the video encoding device of FIG. 1, each component of the video decoding device may be implemented in hardware, software, or a combination of hardware and software. Furthermore, the functions of each component may be implemented in software, with a microprocessor executing the software functions corresponding to each component.
[0079] The entropy decoding unit (510) decodes the bitstream generated by the image encoding device to extract information related to block division, thereby determining the current block to be decoded, and extracts prediction information, information on residual signals, etc. required to restore the current block.
[0080] The entropy decoding unit (510) extracts information about the CTU size from the Sequence Parameter Set (SPS) or the Picture Parameter Set (PPS), determines the size of the CTU, and divides the picture into CTUs of the determined size. Then, the CTU is determined as the top layer of the tree structure, i.e., the root node, and the CTU is divided using the tree structure by extracting division information about the CTU.
[0081] For example, when splitting a CTU using the QTBTTT structure, first, the first flag (QT_split_flag) related to the splitting of QT is extracted, and each node is split into four nodes of the lower layer. Then, for the nodes corresponding to the leaf nodes of QT, the second flag (mtt_split_flag) related to the splitting of MTT and the split direction (vertical / horizontal) and / or split type (binary / ternary) information are extracted, and the corresponding leaf nodes are split into the MTT structure. Accordingly, each node below the leaf nodes of QT are split recursively into the BT or TT structure.
[0082] As another example, when splitting a CTU using the QTBTTT structure, the CU split flag (split_cu_flag) indicating whether the CU is split is first extracted, and if the block is split, the first flag (QT_split_flag) may be extracted. During the splitting process, each node may undergo zero or more repeated QT splits followed by zero or more repeated MTT splits. For example, a CTU may undergo an MTT split right away, or conversely, may undergo only multiple QT splits.
[0083] As another example, when splitting a CTU using the QTBT structure, the first flag (QT_split_flag) related to the splitting of QT is extracted, and each node is split into four nodes of the lower layer. Furthermore, for nodes corresponding to leaf nodes of QT, a split flag (split_flag) indicating whether to further split into BTs and splitting direction information are extracted.
[0084] Meanwhile, when the entropy decoding unit (510) determines the current block to be decoded by using the division of the tree structure, it extracts information on the prediction type indicating whether the current block is intra-predicted or inter-predicted. If the prediction type information indicates intra-prediction, the entropy decoding unit (510) extracts syntax elements for intra-prediction information (intra-prediction mode) of the current block. If the prediction type information indicates inter-prediction, the entropy decoding unit (510) extracts syntax elements for inter-prediction information, i.e., information indicating a motion vector and a reference picture referenced by the motion vector.
[0085] Additionally, the entropy decoding unit (510) extracts information about the quantized transform coefficients of the current block as information related to quantization and information about residual signals.
[0086] The rearrangement unit (515) can change the sequence of one-dimensional quantized transform coefficients entropy-decoded in the entropy decoding unit (510) back into a two-dimensional coefficient array (i.e., block) in the reverse order of the coefficient scanning performed by the image encoding device.
[0087] The inverse quantization unit (520) inversely quantizes the quantized transform coefficients and inversely quantizes the quantized transform coefficients using the quantization parameters. The inverse quantization unit (520) may also apply different quantization coefficients (scaling values) to the quantized transform coefficients arranged in two dimensions. The inverse quantization unit (520) may perform inverse quantization by applying a matrix of quantized coefficients (scaling values) from an image encoding device to a two-dimensional array of quantized transform coefficients.
[0088] The inverse transform unit (530) inversely transforms the inverse quantized transform coefficients from the frequency domain to the spatial domain to restore residual signals, thereby generating a residual block for the current block.
[0089] In addition, when the inverse transform unit (530) inversely transforms only a portion of a transform block (sub-block), it extracts a flag (cu_sbt_flag) indicating that only a sub-block of the transform block has been transformed, directionality (vertical / horizontal) information (cu_sbt_horizontal_flag) of the sub-block, and / or position information (cu_sbt_pos_flag) of the sub-block, and inversely transforms the transform coefficients of the corresponding sub-block from the frequency domain to the spatial domain to restore residual signals, and fills “0” values with residual signals for areas that have not been inversely transformed, thereby generating a final residual block for the current block.
[0090] In addition, when MTS is applied, the inverse transform unit (530) determines a transform function or a transform matrix to be applied in the horizontal and vertical directions using MTS information (mts_idx) signaled from the image encoding device, and performs inverse transform on the transform coefficients within the transform block in the horizontal and vertical directions using the determined transform function.
[0091] The prediction unit (540) may include an intra prediction unit (542) and an inter prediction unit (544). The intra prediction unit (542) is activated when the prediction type of the current block is intra prediction, and the inter prediction unit (544) is activated when the prediction type of the current block is inter prediction.
[0092] The intra prediction unit (542) determines the intra prediction mode of the current block among a plurality of intra prediction modes from the syntax elements for the intra prediction mode extracted from the entropy decoding unit (510), and predicts the current block using reference pixels around the current block according to the intra prediction mode.
[0093] The inter prediction unit (544) uses the syntax elements for the inter prediction mode extracted from the entropy decoding unit (510) to determine the motion vector of the current block and the reference picture referenced by the motion vector, and predicts the current block using the motion vector and the reference picture.
[0094] An adder (550) adds the residual block output from the inverse transform unit (530) and the predicted block output from the inter prediction unit (544) or the intra prediction unit (542) to restore the current block. The pixels within the restored current block are used as reference pixels when intra-predicting a block to be decoded later.
[0095] The loop filter unit (560) may include a deblocking filter (562), an SAO filter (564), and an ALF (566) as in-loop filters. The deblocking filter (562) deblocks the boundaries between restored blocks to remove blocking artifacts caused by block-by-block decoding. The SAO filter (564) and the ALF (566) perform additional filtering on restored blocks after deblocking filtering to compensate for differences between restored pixels and original pixels caused by lossy coding. The filter coefficients of the ALF are determined using information about filter coefficients decoded from the non-stream.
[0096] The restored blocks filtered through the deblocking filter (562), SAO filter (564), and ALF (566) are stored in the memory (570). When all blocks within a picture are restored, the restored picture is used as a reference picture for inter-predicting blocks within a picture to be encoded later.
[0097]
[0098] The present embodiment relates to encoding and decoding of images (videos) as described above. More specifically, the present invention provides a video coding method and device for performing transformation and inverse transformation of a current block by effectively selecting transformation and inverse transformation kernels according to the prediction mode of the current block.
[0099] The following embodiments may be performed by a conversion unit (140) and an inverse conversion unit (165) within a video encoding apparatus. Additionally, they may be performed by an inverse conversion unit (530) within a video decoding apparatus.
[0100] The video encoding device can generate signaling information related to the present embodiment in terms of rate distortion optimization in encoding the current block. The video encoding device can encode the signaling information using the entropy encoding unit (155) and then transmit it to the video decoding device. The video decoding device can decode the signaling information related to the decoding of the current block from the bitstream using the entropy decoding unit (510).
[0101] In the following description, the term "target block" may be used interchangeably with the current block or coding unit (CU). Alternatively, the term "target block" may also refer to a portion of a coding unit.
[0102] Also, a value of a flag being true indicates that the flag is set to 1. Also, a value of a flag being false indicates that the flag is set to 0.
[0103] I. Conversion Technology - Primary Conversion Technology
[0104] As mentioned above, for efficient video compression, quantization or scaling can be additionally applied to residual signals remaining after prediction using various prediction techniques. At this time, a transform technique can be applied based on the importance of perceptual visual information inherent in the residual signals to cluster the residual signals into one group according to frequency components, and then scaling can be performed. However, for non-natural signals, such as screen contents, this frequency-based transform technique can be inefficient. In such cases, the transform technique can be omitted, and only scaling can be performed, or encoding / decoding can be performed without applying scaling.
[0105] When a transform is applied in HEVC, DCT-II is used as a transform kernel (hereinafter, used interchangeably with transform type) to transform residual signals. However, in order to apply a more appropriate transform technique depending on the diversity of residual signal characteristics, Multiple Transform Selection (MTS) can be used. MTS determines the optimal type among multiple transform types, and then transforms the block according to the determined transform type. For example, in VVC, as shown in Table 1, in addition to DCT-II, two other transform types, DCT-VIII and DST-VII, are added so that residual signals can be transformed in various ways.
[0106]
[0107] Here, basis functions form a transformation matrix that defines each transformation type. Hereinafter, DCT-II, DCT-VIII, and DST-VII are used interchangeably with DCT2, DCT8, and DST7, respectively.
[0108] Meanwhile, the flag determining whether MTS is used can be controlled at the block level. Furthermore, MTS use can be controlled using an activation flag at the higher SPS level.
[0109] When MTS is enabled in SPS, a CU level flag may be displayed to indicate whether MTS is applied. Here, MTS may be applied to the luma component. The CU level flag may be expressed when both the width and height of the Transform Block (TB) are less than or equal to 32 pixels, and the Coded Block Flag (CBF), which indicates whether any of the transform coefficient levels have non-zero values, is true.
[0110] When the CU level flag is 0, DCT2 is used as a bidirectional kernel in both the horizontal and vertical directions. On the other hand, when the CU level flag is not 0, MTS is applied. MTS can be used in two ways: explicit MTS and implicit MTS.
[0111] In explicit MTS, the kernel used for the TB is explicitly transmitted. Typically, the index of the transformation kernel can be transmitted. For example, the kernel index, mts_idx, can be defined as shown in Table 2.
[0112]
[0113] Here, trTypeHor and trTypeVer represent the horizontal and vertical transformation types, respectively. Additionally, 0 represents DCT2, 1 represents DST7, and 2 represents DCT8.
[0114] Meanwhile, in implicit MTS, for example, the transformation type can be determined implicitly even if MTS is not explicitly signaled in the case of an intra block. In VVC, the horizontal and vertical transformation types can be determined implicitly, as in Equation 1.
[0115]
[0116] Here, nTbW and nTbH represent the horizontal and vertical lengths of the transformation block, respectively.
[0117] For example, when a specific encoding technique is applied, either explicit MTS or implicit MTS may be applied. For example, in the case of Matrix-weighted Intra Prediction (MIP) mode, explicit Intra MTS may be used. In the case of Intra Sub-Partitions (ISP) mode, implicit MTS is used, and DST7 or DCT2 is used as the transform type.
[0118] Meanwhile, if the transform block contains at least one non-DC coefficient, mts_idx is signaled. That is, if the position of the last significant coefficient according to the scanning order is greater than 0, mts_idx is signaled. On the other hand, if the transform block contains only one non-DC coefficient, the signaling of mts_idx is omitted, mts_idx = 0 is derived, and DCT2 is applied as the transform kernel.
[0119] The first bin of the signaled mts_idx indicates whether mts_idx is greater than 0. If mts_idx is greater than 0 (i.e., mts_idx indicates one of 1 to 4), an additional 2-bit fixed-length code is signaled to indicate which of the four candidates mts_idx is signaled.
[0120] Meanwhile, the next-generation technology, ECM (Enhanced Compression Model) software, increases the number and types of MTS kernels, adding DST7, DCT8, DCT5, DST4, DST1, and identity transform.
[0121] II. Low-frequency Non-separable Transform (LFNST)
[0122] The LFNST technique applies a secondary transform to the low-frequency region among the transform coefficients generated according to the primary transform of the transform unit (TU) during intra prediction. In terms of encoding, the LFNST technique applies the secondary transform to L low-frequency primary transform coefficients among the W×H primary transform coefficients, thereby generating K (where K ≤ L) secondary transform coefficients. Here, the size of the transform kernel of the LFNST is L×K. That is, the LFNST technique expresses the L low-frequency primary transform coefficients among the W×H primary transform coefficients as a 1×L vector, and then applies the L×K transform kernel to generate a 1×K vector. Thereafter, the LFNST technique expresses the 1×K vector as a two-dimensional array in the low-frequency region for subsequent processes such as quantization.
[0123] Compared to the first-order transformation that applies separate transformation kernels in the horizontal and vertical directions, the LFNST technique performs a non-separable transform that transforms a one-dimensional vector.
[0124] Meanwhile, the type of transformation kernel can be determined based on the intra prediction mode of the current TU, the size of the TU, and the LFNST index (lfnst_idx). For example, in VVC, a set of transformation kernels can be determined based on the intra prediction mode (IntraPredMode) of the current TU, as shown in Table 3.
[0125]
[0126] Here, the intra prediction mode (IntraPredMode) follows the example of Fig. 3b. Additionally, lfnstTrSetIdx is an index indicating a kernel set. In Table 3, IntraPredMode values of 81, 82, and 83 indicate CCLM (Cross-component Linear Model) prediction modes.
[0127] For each kernel set (lfnstTrSetIdx), two types of kernels are defined. Which kernel is selected among the two types of kernels can be indicated by the LFNST index. If the LFNST index is 0, it means that LFNST is not performed, and if the LFNST index is 1 or 2, a different LFNST kernel within the same kernel set is applied. Since there is one more kernel set depending on the size of the TU, there are a total of 4×2×2 = 16 transformation kernels. The kernel sizes of LFNST are defined as 16×16 and 16×48. In addition, the kernel size can be adjusted as shown in Table 4 depending on the size of the TU.
[0128]
[0129] In ECM, a set of transformation kernels can be defined depending on the block shape and intra prediction mode. For example, by utilizing the symmetry property of square blocks, a set of 35 transformation kernels is defined for a square block depending on the intra prediction mode.
[0130] Meanwhile, in VVC, when MIP (Matrix-weighted Intra Prediction) prediction is performed on the current TU, as in the example of Fig. 6a, the image decoding device maps the intra prediction mode of the current TU to the Planar mode and then determines the transformation kernel according to the mapped prediction mode. The MIP technique can be briefly illustrated as in Fig. 6a. In the example of Fig. 6a, 'MIP boundary downsampling' refers to the process of downsampling a specific number of pixels among the boundary pixels of the current block. 'Matrix-Vector multiplication' refers to the process of generating a reduced prediction block by multiplying the downsampled pixels (i.e., 'vector') by a preset matrix. 'MIP prediction upsampling' refers to the process of generating a final prediction block by upsampling the reduced prediction block.
[0131] In addition, when MIP prediction is performed in the next-generation technology, ECM (Enhanced Compression Model), the image decoding device obtains a directional prediction mode by applying DIMD (Decoder-side Intra Mode Derivation) to the MIP-predicted block, i.e., the output of the 'Matrix-Vector Product', as shown in the example of Fig. 6b. The image decoding device maps the intra prediction mode of the current TU to the obtained directional prediction mode, and then determines the transformation kernel according to the mapped prediction mode. The DIMD technology calculates the gradient of each sample for adjacent samples of the current block, generates a HoG (Histogram of Gradient) from the calculated gradients, and derives a prediction mode for intra prediction of the current block according to the generated HoG.
[0132] Additionally, when IntraTMP (Intra Template Matching Prediction) prediction is performed, the image decoding device obtains a directional prediction mode by applying DIMD to the prediction block. The image decoding device maps the intra prediction mode of the current TU to the obtained directional prediction mode, and then determines the transformation kernel based on the mapped prediction mode.
[0133] Meanwhile, when the DCT2 / DCT2 transform kernel is applied as a first transform to the intra-predicted TU in VVC, the LFNST technique can be applied as a second transform.
[0134] In ECM, when the block size of the TUs encoded according to intra prediction is small (e.g., 4×4, 4×8, 8×4, 4×16, 16×4, 8×8, 8×16, 16×8), the non-separable first-order transform technique can be applied. In addition, when the block size is large and the DCT2 / DCT2 transform kernel is applied to the block as the first-order transform, the LFNST technique can be applied.
[0135] III. Non-separable Primary Transform (NSPT)
[0136] The non-separable primary transform technique performs a non-separable primary transform using a pre-learned transform kernel instead of performing vertical and horizontal transforms on the residual signals of a block predicted in the intra prediction mode. As described above, when DCT-2 is applied as a separable primary transform and LFNST is applied as a non-separable secondary transform, the NSPT technique can be applied to a residual block having a preset size (e.g., 4×4, 4×8, 8×4, 4×16, 16×4, 8×8, 8×16, 16×8).
[0137] NSPT technology uses non-separable primary transformation kernels of different sizes depending on the size of the residual block. For example, if the size of the transformation block is 4×4, a 16×16 kernel is applied to generate 4×4 transformation coefficients. As another example, if the size of the transformation block is 4×8, a 32×20 kernel is applied to generate 20 transformation coefficients. The generated transformation coefficients are arranged in the transformation block according to the promised scanning order. If the number of transformation coefficients generated after the transformation is less than the number of pixels in the transformation block, the remaining area where the transformation coefficients are not arranged is filled with 0.
[0138] Similar to LFNST, in NSPT, a kernel set is defined, and the selection of kernels within each kernel set can be indicated by an NSPT index. As described above, when DCT-2 is applied as a separable first-order transform and LFNST is applied as a non-separable second-order transform, NSPT is applied to transform blocks with a preset size. That is, the separable first-order transform and LFNST are replaced by a non-separable first-order transform, and the LFNST index can be reused as the NSPT index.
[0139] For non-separable first-order transformations, transformation kernels can be defined based on the block shape, intra prediction mode, and NSPT index (nspt_idx). For example, by leveraging the symmetry of square blocks, there are 35 sets of transformation kernels for a square block, each with its own intra prediction mode. The NSPT index (i.e., the LFNST index) can be used to indicate one of the candidate kernels within the transformation kernel set.
[0140] A non-separable first-order transform can be applied to the luma component. Furthermore, if a non-separable first-order transform is applied, the second-order transform, i.e., LFNST, may not be performed.
[0141] The following embodiments are described with a focus on an image decoding device, but can be implemented identically or similarly in an image encoding device.
[0142] IV. Embodiments according to the present disclosure
[0143] FIG. 7 is a block diagram illustrating in detail a portion of an image decoding device according to one embodiment of the present disclosure.
[0144] The video decoding device according to the present embodiment determines prediction and transformation units, and performs prediction and inverse transformation on the current block corresponding to the determined unit using the determined prediction technique and prediction mode, thereby finally generating a restoration block of the current block. As illustrated in FIG. 7, this can be performed by the entropy decoding unit (510), the inverse quantization unit (520), the inverse transformation unit (530), the prediction unit (540), and the adder (550) of the video decoding device. Meanwhile, the same operations as illustrated in FIG. 7 can be performed by the inverse quantization unit (160), the inverse transformation unit (165), the picture division unit (110), the prediction unit (120), and the adder (170) of the video encoding device. At this time, the video decoding device uses encoding information parsed from the bitstream, but the video encoding device can use encoding information set from a higher level in terms of minimizing rate distortion. Hereinafter, for convenience, the present embodiment will be described focusing on the video decoding device.
[0145] As in the example of FIG. 5, the prediction unit (540) includes an intra prediction unit (542) and an inter prediction unit (544) depending on the prediction technology, but as illustrated in FIG. 7, the prediction unit (540) may include all or part of the prediction unit determination unit (702), the prediction technology determination unit (704), the prediction mode determination unit (706), and the prediction execution unit (708).
[0146] If the color format of the input video is a YUV format (such as YUV420, YUV411, YUV422, or YUV444), the video decoding device can perform prediction and restoration of the chroma component after performing prediction and restoration of the luma component. That is, the luma component and the chroma component can be sequentially restored by the components illustrated in Fig. 7. Here, in the case of the YUV format, the color format represents the correspondence between the pixels of the luma component and the pixels of the chroma component.
[0147] Hereinafter, the operation of the components within the prediction unit (540) will be described. The prediction unit determination unit (702) determines a prediction unit (PU). The prediction technique determination unit (704) determines a prediction technique (e.g., intra prediction, inter prediction, IBC (Intra Block Copy) mode, palette mode, etc.) for the prediction unit. The prediction mode determination unit (706) determines a detailed prediction mode for the prediction technique. The prediction execution unit (708) generates a prediction block of the current block according to the determined prediction mode.
[0148] The prediction unit determined by the prediction unit determination unit (702) may be the current block or one of the sub-blocks into which the current block is divided. At this time, the prediction unit of the chroma component may have a size corresponding to the prediction unit of the luma component according to the color format. Alternatively, after the prediction units of the luma component and the chroma component are determined separately, prediction may be performed on the prediction unit of the chroma component.
[0149] The prediction technology determination unit (704) determines the prediction technology for each prediction unit. As described above, the prediction technology may be one of inter-prediction, intra-prediction, IBC mode, and palette mode. In this case, the prediction technology for the chroma component can be determined in the same manner as the prediction technology for the corresponding luma component, without separate signaling or parsing of information.
[0150] For example, if the prediction technique of the current block is not intra prediction, the video decoding device parses the 1-bit flag information. For example, if the parsed flag indicates skip mode, the video decoding device determines the prediction mode of the current block as the merge mode of inter prediction or the IBC merge mode. The video decoding device can use the predicted signals as restored signals without performing the inverse transformation process.
[0151] On the other hand, if the parsed flag does not indicate a Skip mode for the current block, the prediction technique determination unit (704) can parse a series of 1-bit flags to determine the prediction technique of the current block as one of techniques such as inter prediction, intra prediction, IBC mode, palette mode, etc.
[0152] For example, if Skip is not applied to the current block and the prediction technique is determined to be Inter-Prediction or IBC mode, the video decoding device parses a 1-bit flag. Depending on the parsed flag, the prediction mode of the current block can be determined as Merge mode or Advanced Motion Vector Prediction (AMVP) mode.
[0153] The prediction mode determination unit (706) determines a detailed prediction mode for the prediction technology.
[0154] For example, if the prediction technique is inter prediction, the mode for generating a prediction block based on parsed motion information may be the prediction mode for the current block. In this case, the video decoding device generates prediction signals using one or more motion compensations based on the parsed motion information. The video decoding device weights and combines multiple prediction signals to generate a prediction block for the current block.
[0155] As another example, if the prediction technique is inter prediction, the prediction mode of the current block may be a geometric partitioning mode that generates a prediction block using motion information parsed according to geometric partitioning. In this case, the image decoding device divides the current block into one or more sub-regions according to the geometric partitioning. The image decoding device generates prediction signals using one or more motion compensations according to the motion information parsed for each sub-region. The image decoding device weights and adds a plurality of prediction signals to generate a prediction block of the current block.
[0156] For example, if the prediction technique is intra prediction, the prediction mode of the current block may be a mode that generates prediction signals using a single directional prediction mode, a planar mode, or a DC mode. In this case, the planar mode may be a horizontal planar mode, a vertical planar mode, or a regular planar mode. When performing linear interpolation to generate prediction signals, the planar mode uses left and top reference samples, the horizontal planar mode uses left and top right reference samples, and the vertical planar mode uses top and bottom left reference samples.
[0157] As another example, if the prediction technique is intra prediction, the geometric partitioning mode that generates a prediction block according to the intra prediction mode determined by the geometric partitioning may be the prediction mode of the current block. In this case, the image decoding device divides the current block into one or more sub-regions according to the geometric partitioning. The image decoding device generates prediction signals using the intra prediction mode (such as directional prediction mode, planar mode, or DC mode) for each sub-region. The image decoding device weights and adds a plurality of prediction signals to generate a prediction block of the current block.
[0158] As another example, if the prediction technique is intra prediction, the prediction mode for the current block may be MIP mode, which utilizes a predefined matrix according to an agreement between the video encoding device and the video decoding device. In this case, the video encoding device may signal the matrix itself to the video decoding device. Alternatively, the video encoding device may signal an index indicating the matrix to the video decoding device.
[0159] As another example, if the prediction technique is intra prediction, template matching-based prediction using template matching may be the prediction mode for the current block. In this case, the image decoding device defines the restoration area surrounding the current block as a template and performs template matching on the area surrounding the current block to generate prediction signals.
[0160] The prediction execution unit (708) generates a prediction block of the current block according to the determined prediction technology and prediction mode.
[0161] Below, the operations related to inverse transformation and restoration are described.
[0162] In relation to the inverse transformation, the entropy decoding unit (510) decodes the transform coefficients. If a secondary transformation is applied, the entropy decoding unit (510) decodes the quantized secondary transform coefficients. If a secondary transformation is not applied, the entropy decoding unit (510) decodes the quantized primary transform coefficients.
[0163] The inverse quantization unit (520) inversely quantizes the decoded quantization transform coefficients for the current transform block to generate inverse quantization signals.
[0164] The inverse transform unit (530) inversely transforms TUs expressed as inverse quantization signals to generate residual signals.
[0165] As shown in the example of Fig. 7, the inverse transform unit (530) includes all or part of the inverse transform unit determination unit (710), the inverse transform kernel determination unit (712), and the inverse transform execution unit (714). The inverse transform unit determination unit (710) determines a transform unit (TU) for the inverse quantization signals of the current block, the inverse transform kernel determination unit (712) determines an inverse transform kernel, and the inverse transform execution unit (714) inversely transforms the transform units expressed by the inverse quantization signals to generate residual signals.
[0166] An adder (550) adds the predicted block and residual signals to generate a reconstruction block. The reconstruction block is then applied to an in-loop filter. The filtered reconstruction block is stored in the Decoded Picture Buffer (DPB) within the memory (570) and can be used to predict other blocks.
[0167] Hereinafter, TU is used interchangeably with the transformation block.
[0168] Below, the operation of the components within the inverse conversion unit (530) is described.
[0169] The transformation unit determined in the inverse transformation unit determination unit (710) can be one TU or one sub-block among the sub-blocks into which the TU is divided.
[0170] The inverse transform kernel determination unit (712) determines a separable first-order inverse transform kernel in the vertical and horizontal directions and / or a non-separable second-order inverse transform kernel. Alternatively, the inverse transform kernel determination unit (712) determines a non-separable first-order inverse transform kernel.
[0171] The inverse transform performing unit (714) inversely transforms the inverse quantized transform coefficients using the determined inverse transform kernel to generate residual signals.
[0172] FIG. 8 is an exemplary diagram showing a method for determining an inverse transform kernel according to one embodiment of the present disclosure.
[0173] The inverse transform kernel decision unit (712) determines the type of inverse transform kernel of the current transform block according to the example of FIG. 8.
[0174] Meanwhile, whether or not to perform a non-separable inverse transform can be determined based on the signaling / parsing of the corresponding flag or index. Here, whether or not to perform a non-separable inverse transform indicates whether or not to perform a non-separable first-order inverse transform or a non-separable second-order inverse transform. In this case, whether or not to perform a non-separable first-order inverse transform can be implicitly determined based on whether or not to perform a non-separable second-order inverse transform and the size of the current TU.
[0175] The inverse transform kernel decision unit (712) determines a separable first-order inverse transform kernel as follows.
[0176] For example, when a separable first inverse transform is performed on the current TU, the inverse transform kernel determination unit (712) determines the vertical kernel and the horizontal kernel of the current TU based on the prediction technique, prediction mode, aspect ratio, size, index (hereinafter referred to as mts_idx) of the current block, etc.
[0177] At this time, if the current block is predicted with the prediction mode of the intra prediction technology (hereinafter, intra prediction mode) and the vertical and horizontal separable first inverse transform kernels are explicitly determined by parsing mts_idx, the types of kernels indicated by mts_idx may be different based on the size of the current TU and the intra prediction mode. That is, the types of the vertical and horizontal first inverse transform kernels indicated by each mts_idx are defined according to the agreement between the image encoding device and the image decoding device for the combination of the size of the current TU (e.g., 4×4, 4×8, 8×4, 4×16, 16×4, …) and the intra prediction mode of the current block. By using the parsing of mts_idx, the inverse transform kernel determination unit (712) determines the final vertical and horizontal first inverse transform kernels.
[0178] When the current block is predicted in a prediction mode within the inter prediction technology (hereinafter, inter prediction mode), and the vertical and horizontal separable first-order inverse transform kernels are explicitly determined by parsing mtx_idx, the type of kernel indicated by mts_idx may be different based on the size of the current TU.
[0179] As another example, when a non-separable second-order inverse transform is applied to the current TU, the inverse transform kernel decision unit (712) implicitly sets the separable first-order inverse transform kernel to a fixed kernel (e.g., vertical and horizontal kernels: DCT2, DCT2). At this time, the fixed kernel can be adaptively changed depending on the size and aspect ratio of the current block.
[0180] The inverse transform kernel decision unit (712) determines the non-separable first-order inverse transform kernel as follows.
[0181] As an example, a non-separable first-order inverse transform can be applied to a block on which intra prediction has been performed. As another example, a non-separable first-order inverse transform can be applied to a block on which inter prediction has been performed.
[0182] For example, if a preset kernel is applied as a separable first-order transform and LFNST is applied as a non-separable second-order transform, the non-separable first-order transform technique can be applied to a transform block having a preset size. In this case, the separable first-order transform and LFNST are replaced with the non-separable first-order transform.
[0183] When a non-separable first-order inverse transform is applied to the current TU, the inverse transform kernel determination unit (712) determines a non-separable first-order inverse transform kernel based on the size and intra prediction mode of the current TU.
[0184] As another example, the type of kernel indicated by lfnst_idx may be different based on one or more of the following information: an index (e.g., nspt_idx (i.e., lfnst_idx)), an intra prediction mode of the current block, an aspect ratio of the current TU, and a size of the current TU.
[0185] In addition, when a non-separable second inverse transform is used, the use of a non-separable first inverse transform is restricted. That is, when a non-separable second inverse transform is applied (i.e., when a parsed non-separable second inverse transform index indicates the use of a non-separable second inverse transform), the inverse transform kernel determination unit (712) does not parse an index related to a non-separable first inverse transform. At this time, the inverse transform kernel determination unit (712) parses a bitstream related to a separable first inverse transform or a transform skip. Therefore, the parsing of a non-separable first inverse transform index is dependent on whether a non-separable second inverse transform is performed. In some embodiments, when a non-separable first inverse transform index is parsed first, the parsing of a non-separable second inverse transform may depend on the index value of the non-separable first inverse transform.
[0186] The inverse transform kernel decision unit (712) determines the non-separable second-order inverse transform kernel as follows.
[0187] As an example, a non-separable second-order inverse transform is applied to blocks on which intra prediction is performed.
[0188] As another example, when a non-separable second-order inverse transform is applied to the current TU, the inverse transform kernel determination unit (712) determines a non-separable second-order inverse transform kernel based on the size of the current TU, the intra prediction mode, and the separable first-order inverse transform kernel.
[0189] As another example, the type of kernel indicated by lfnst_idx may differ based on the index (e.g., lfnst_idx), the intra prediction mode of the current block, the aspect ratio of the current TU, and the size of the current TU.
[0190] Below, the determination of the intra prediction mode of the current TU used in the inverse transform kernel determination process is described.
[0191] For example, if the current TU is square, the symmetry of the square block is utilized. In this case, the intra prediction modes of the current TU used in the inverse transform kernel determination process can be divided into n sets centered around the diagonal mode in the upper left corner (mode 34 in the example of Figure 3b). For example, in the case of a square block, the modes can be divided into four mode sets according to the intra prediction mode, as shown in Table 5.
[0192] In addition, when divided into four mode sets as in Table 5, mode m and mode j (=68-m) are included in the same mode set. Therefore, for mode m and mode j, the inverse transform kernel decision unit (712) can use the same kernel set.
[0193]
[0194] An index indicating a set of modes according to Table 5 can be used as an index indicating a set of kernels.
[0195] As another example, if the current TU is rectangular, the intra prediction modes of the current TU used in the inverse transform kernel determination process can be divided into k sets. For example, in the case of a rectangular block, the intra prediction modes can be divided into six mode sets, as shown in Table 6.
[0196]
[0197] When the mode sets are distinguished as in Table 6 and an inseparable inverse transformation is applied to the current TU, a block predicted with mode q and having a transform block size of A×B can be inversely transformed using the same kernel as a block predicted with mode p(=68-q) and having a transform block size of B×A. An index indicating a mode set according to Table 6 can be used as an index indicating a kernel set.
[0198] As another example, a set of transformation kernels can be defined based on the block shape and intra prediction mode. For example, by leveraging the symmetry characteristics of square blocks, a set of 35 transformation kernels can be defined for square blocks based on the intra prediction mode. The 35 transformation kernel sets can be defined as shown in Table 7.
[0199]
[0200] lfnst_idx may be used to indicate one of the candidates within the set of transformation kernels shown in Table 5, Table 6, or Table 7.
[0201] Since the wide-angle intra prediction (WAIP) mode has less diverse residual characteristics compared to other intra prediction modes, a smaller number of inseparable transform sets and / or kernels can be used. Alternatively, in the case of WAIP mode, an inseparable first-order inverse transform can be applied by mapping to an arbitrary kernel (e.g., mapping to a transform set of an adjacent intra prediction mode). Accordingly, effects such as improved encoding efficiency, reduced memory consumption for storing the inseparable first-order transform kernel, and reduced overhead due to signaling of syntax elements / additional information of the inseparable first-order transform can be expected.
[0202] As described above, when the prediction mode of the current block is a directional mode or a non-directional mode, the image decoding device sets the intra prediction mode of the transformation block to the prediction mode of the current block.
[0203] Meanwhile, if the current block is predicted in MIP mode, the intra prediction mode of the current TU used in the inverse transform kernel determination process may be distinguished by one of the n sets according to Table 5 / Table 6, or by a separate set not presented in Table 5 / Table 6.
[0204] For example, if the current block is predicted in MIP mode, each matrix used for prediction can correspond to one or more directional modes or non-directional modes (e.g., regular Planar mode) according to an agreement between the video encoding device and the video decoding device. If one matrix corresponds to one directional mode or non-directional mode, the intra prediction mode of the current TU used in the inverse transform kernel determination process is set to the corresponding mode, and the inverse transform kernel can be distinguished by a set including the corresponding mode. If one matrix corresponds to multiple directional modes or multiple non-directional modes, the video decoding device parses an index or a flag. At this time, the intra prediction mode of the current TU is set to the prediction mode corresponding to the index or flag, and the inverse transform kernel can be distinguished by a set including the corresponding prediction mode.
[0205] As another example, when the current block is predicted in the MIP mode, the intra prediction mode of the current TU used in the inverse transform kernel determination process can be distinguished by a directional mode or a non-directional prediction mode derived based on intermediate prediction signals or final prediction signals generated in the prediction process according to the MIP mode. For example, an image decoding device applies a DIMD technique to intermediate prediction signals or final prediction signals generated in the prediction process according to the MIP mode. The image decoding device generates a Histogram of Oriented Gradient (HoG) for the prediction signals or the final prediction signals, and extracts a directional prediction mode corresponding to the most accumulated directionality according to the generated HoG. At this time, the intra prediction mode of the current TU is set to the extracted directional prediction mode, and the inverse transform kernel can be distinguished by a set including the extracted directional prediction mode. Alternatively, when all accumulated directionality is less than a preset threshold, the intra prediction mode of the current TU can be set to a non-directional prediction mode. In the example of Fig. 6b, the intermediate prediction signals generated in the prediction process according to the MIP mode are the output of 'Matrix-Vector multiplication', and the final prediction signals are the output of 'MIP prediction upsampling'.
[0206] Meanwhile, when the current block is predicted in a geometric partitioning mode, the intra prediction mode of the current TU used in the inverse transform kernel determination process can be classified according to, for example, a directional prediction mode based on the size of the current block, the aspect ratio of the current block, and / or the direction of the geometric partitioning mode.
[0207] As another example, the intra prediction mode of the current TU can be derived from the prediction signals of the current block generated by weighting. For example, the image decoding device generates an HoG of the prediction signals of the current block, and extracts a directional prediction mode corresponding to the most accumulated directionality according to the generated HoG. At this time, the intra prediction mode of the current TU is set to the extracted directional prediction mode, and the inverse transform kernel can be distinguished by a set including the extracted directional prediction mode. Alternatively, if all accumulated directionality is less than a preset threshold, the intra prediction mode of the current TU can be set to a non-directional prediction mode.
[0208] As another example, among the prediction signals of the current block generated by weighting according to the geometric division mode, the intra prediction mode of the current TU can be derived from some sub-regions among the regions where the weighted sum was performed or the sub-regions within the regions where the weighted sum was performed, as in the example of Fig. 9. For example, the image decoding device generates the HOG of the corresponding prediction signals, and extracts the directional prediction mode corresponding to the most accumulated direction according to the generated HoG. At this time, the intra prediction mode of the current TU is set to the extracted directional prediction mode, and the inverse transform kernel can be distinguished by a set including the extracted directional prediction mode.
[0209] As another example, for the prediction signals of the current block generated by weighting according to the geometric segmentation mode, the intra prediction mode of the current TU can be derived from the surrounding area of the geometric segmentation boundary. In this case, the size of the surrounding area of the geometric segmentation boundary used in the derivation process can be a fixed area depending on the size of the current block.
[0210] As another example, a case is described where the current block is predicted in geometric segmentation mode as in the example of Fig. 10, and at least one sub-region among sub-regions 1 and 2 is predicted in intra prediction mode.
[0211] If one sub-region is predicted with an intra prediction mode, the intra prediction mode of the current TU is set to the intra prediction mode of the sub-region, and the inverse transform kernel can be distinguished by a set including the intra prediction mode of the sub-region.
[0212] If only one sub-region is predicted with an intra prediction mode and the area of the sub-region is larger than the areas of other sub-regions, the intra prediction mode of the current TU is set to the intra prediction mode of the sub-region, and the inverse transform kernel can be distinguished by a set that includes the intra prediction mode of the sub-region.
[0213] If both regions are predicted with an intra prediction mode, the intra prediction mode of the current TU is set to the intra prediction mode of the sub-region with a larger area among the two sub-regions, and the inverse transform kernel can be distinguished by a set that includes the intra prediction mode of the corresponding sub-region.
[0214] If both regions are predicted using an intra prediction mode, a combination of the geometric partitioning mode of the current block and the intra prediction mode of each sub-region is used. The intra prediction mode according to the aforementioned combination is defined as a lookup table according to an agreement between the video encoding device and the video decoding device. The intra prediction mode of the current TU used in the inverse transform kernel determination process is set to the intra prediction mode according to the combination, and the inverse transform kernel can be distinguished by a set that includes the intra prediction mode according to the combination. In addition, the lookup table according to the aforementioned combination may vary depending on the size and aspect ratio of the current block.
[0215] Hereinafter, cases where cross-component prediction is used for intra prediction of chroma blocks are described. Modes such as CCLM (Cross-component Linear Model), CCCM (Convolutional Cross-component Model), MMLM (Multi-mode Linear Model), MDLM (Multi-directional Linear Model), GLM (Gradient Linear Model), and GL-CCCM (Gradient and Location based Convolutional Cross-component Model) are cross-prediction methods that utilize the correlation between chroma components and luma components.
[0216] As an example, the intra prediction mode of the center position of the co-located luma block (hereinafter, the corresponding luma block) is mapped to the intra prediction mode of the current block. At this time, the intra prediction mode of the current TU used in the inverse transform kernel determination process is set to the mapped intra prediction mode, and the inverse transform kernel can be distinguished by a set including the mapped intra prediction mode.
[0217] As another example, the intra prediction mode of the current TU may be set to a directional prediction mode or a non-directional prediction mode derived from intermediate prediction signals or final prediction signals generated during the prediction process of the current block. In this case, the inverse transform kernel may be distinguished by a set that includes the derived directional prediction mode or non-directional prediction mode.
[0218] As another example, when a restoration signal generated using a directional filter such as the example of FIG. 11 is used in the prediction process of the current block, the intra prediction mode of the current TU is set to a directional prediction mode corresponding to the directional filter used, and the inverse transform kernel can be distinguished by a set including the corresponding directional prediction mode.
[0219] As another example, a separate inverse transform kernel can be used for chroma blocks, distinct from luma blocks.
[0220] As another example, depending on the inverse transform information of the corresponding luma block or the inverse transform kernel information of the corresponding luma block, the video decoding device may not parse some or all of the inverse transform related syntax elements of the chroma block.
[0221] Hereinafter, a case in which a non-separable second-order inverse transform is applied to the current TU is described. The inverse transform performing unit (714) packs t inverse quantized transform coefficients into one dimension using a scanning order according to an agreement between the image encoding device and the image decoding device, thereby creating a one-dimensional vector ( ) is configured. The inverse transform performing unit (714) uses the non-separable second-order inverse transform kernel determined by the inverse transform kernel determining unit (712) to create a one-dimensional vector ( having a size of r(t<=r) ) is generated. The inverse transformation performing unit (714) generates a one-dimensional vector ( ) are mapped to the pixel values of the current TU using the scanning order agreed upon between the image encoding device and the image decoding device, thereby generating inverse quantized first-order transform coefficients. At this time, areas within the TU where mapping is not performed are filled with 0.
[0222] Meanwhile, the scanning order according to the agreement between the image encoding device and the image decoding device may change depending on the size of the current TU and the number of inversely quantized transform coefficients.
[0223] Hereinafter, a case in which a separable first-order inverse transform is applied to the current TU is described. The inverse transform performing unit (714) performs the first-order inverse transform by applying a first-order inverse transform kernel that is separable in the vertical and horizontal directions to the first-order transform coefficients generated by performing the second-order inverse transform, thereby generating residual signals of the current block. As described above, the first-order inverse transform kernel that is separable in the vertical and horizontal directions is determined by the inverse transform kernel determining unit (712).
[0224] Hereinafter, a case in which a non-separable first-order inverse transform is performed on the current TU is described. The inverse transform performing unit (714) packs w inverse quantized transform coefficients into one dimension using a scanning order according to an agreement between the image encoding device and the image decoding device, thereby creating a one-dimensional vector ( ) is configured. The inverse transform performing unit (714) uses the non-separable first-order inverse transform kernel determined by the inverse transform kernel determining unit (712) to create a one-dimensional vector ( having a size of z (w<=z) ) is generated. The inverse transformation performing unit (714) generates a one-dimensional vector ( ) are mapped to the pixel values of the current TU using the scanning order agreed upon between the image encoding device and the image decoding device, thereby generating residual signals. At this time, areas within the TU where mapping is not performed are filled with 0.
[0225] Meanwhile, the scanning order according to the agreement between the image encoding device and the image decoding device may change depending on the size of the current TU and the number of inversely quantized transform coefficients.
[0226] Below, a method for transforming and inverting the transformation block of the current block is described.
[0227] FIG. 12 is a flowchart illustrating a method by which an image encoding device transforms a transform block according to one embodiment of the present disclosure.
[0228] The image encoding device obtains residual signals for the transformation block of the current block (S1200).
[0229] The video encoding device derives the intra prediction mode of the transformation block according to the prediction mode of the current block (S1202).
[0230] If the prediction mode of the current block is a directional mode or a non-directional mode, the video encoding device sets the intra prediction mode of the transformation block to the directional mode or the non-directional mode.
[0231] If the prediction mode of the current block is MIP mode, the video encoding device acquires a preset directional mode or a preset non-directional mode corresponding to the matrix used in the MIP mode. The video encoding device sets the intra prediction mode of the transform block to the preset directional mode or the preset non-directional mode.
[0232] When the prediction mode of the current block is the geometric partitioning mode, the image encoding device generates prediction signals of the current block according to the geometric partitioning mode, and derives a directional mode or a non-directional prediction mode based on all or part of the prediction signals. The image encoding device sets the intra prediction mode of the transform block to the derived directional mode or the derived non-directional prediction mode.
[0233] The video encoding device determines a non-separable transform kernel corresponding to a non-separable first transform kernel or a non-separable second transform kernel based on the size of the transform block and the intra prediction mode (S1204).
[0234] The video encoding device selects a mode set that includes the intra prediction mode of the transform block from among preset mode sets. The video encoding device selects a kernel set based on the size of the transform block and the selected mode set.
[0235] If the kernel set includes one transform kernel candidate, the image encoding device determines one kernel candidate as a non-separable transform kernel.
[0236] When a kernel set includes multiple transform kernel candidates, in terms of rate-distortion optimization, an image encoding device can determine one of the multiple transform kernel candidates as a non-separable transform kernel. Subsequently, the image encoding device can encode information indicating the determined candidate.
[0237] The image encoding device applies a non-separable first-order transform kernel to residual signals to generate first first-order transform coefficients (S1206).
[0238] The video encoding device explicitly or implicitly determines a pair of primary transform kernels in the vertical and horizontal directions for the transform block (S1208).
[0239] The image encoding device applies a pair of first-order transform kernels to residual signals to generate second-order transform coefficients (S1210).
[0240] The video encoding device generates second-order transform coefficients by applying a non-separable second-order transform kernel to the second-order first-order transform coefficients (S1212). When generating the second-order transform coefficients, the second-order first-order transform coefficients can be generated by applying a pair of first-order transform kernels implicitly generated in the residual signals to the residual signals.
[0241] The video encoding device determines non-separable transformation information (S1214). Here, the non-separable transformation information indicates whether a non-separable transformation is applied. In this case, the non-separable transformation indicates a non-separable primary transformation or a non-separable secondary transformation.
[0242] The non-separable transformation information may be a flag or an index indicating whether to apply the non-separable transformation. If the non-separable transformation information includes a flag, an index indicating one of the candidates within the transformation kernel set may be additionally determined and then included in the non-separable transformation information. If the non-separable transformation information includes a flag and the value of the flag is true, the non-separable transformation is applied, and if the value of the flag is false, the non-separable transformation is not applied. If the non-separable transformation information is an index and the value of the index is 0, the non-separable transformation is not applied. If the non-separable transformation information is an index and the value of the index is 1 or greater, the non-separable transformation is applied, and the index indicates one of the candidates within the transformation kernel set.
[0243] The video encoding device determines non-separable transform information based on the second primary transform coefficients and the secondary transform coefficients. At this time, the non-separable transform information indicates whether to apply the non-separable secondary transform. In terms of rate distortion optimization, the video encoding device can determine the non-separable transform information. For example, if the secondary transform coefficients are optimal, the video encoding device can set the non-separable transform information so that the non-separable secondary transform is applied. On the other hand, if the second primary transform coefficients are optimal, the video encoding device can set the non-separable transform information so that the non-separable secondary transform is not applied.
[0244] As mentioned above, a non-separable first-order transform can be applied under certain conditions (DCT-2 is applied as a separable first-order transform, LFNST is applied as a non-separable second-order transform, and the transform block has a preset size). Therefore, when the above-mentioned specific conditions are satisfied, the non-separable transform information can indicate the application of a non-separable first-order transform.
[0245] The image encoding device encodes non-separable transformation information (S1216).
[0246] The image encoding device encodes first primary transform coefficients, second primary transform coefficients, or second primary transform coefficients based on non-separable transform information (S1218)
[0247] If the non-separable transform information indicates the application of a non-separable second-order transform, the video encoding device encodes the second-order transform coefficients. At this time, if the above-described specific condition is satisfied, the non-separable transform information indicates the application of a non-separable first-order transform, and therefore the video encoding device encodes the first first-order transform coefficients. On the other hand, if the non-separable transform information does not indicate the application of a non-separable transform, the video encoding device encodes the second first-order transform coefficients.
[0248] FIG. 13 is a flowchart illustrating a method for an image decoding device to inversely transform a transform block according to one embodiment of the present disclosure.
[0249] The image decoding device obtains inverse quantized transform coefficients for the transform block of the current block (S1300).
[0250] The video decoding device decodes non-separable transform information from the bitstream (S1302). Here, the non-separable transform information indicates whether a non-separable inverse transform is applied. In this case, the non-separable inverse transform indicates a non-separable first-order inverse transform or a non-separable second-order inverse transform.
[0251] The non-separable transform information may be a flag or an index indicating whether a non-separable inverse transform is applied. If the non-separable transform information includes a flag, the non-separable transform information may additionally include an index indicating one of the candidates within the transform kernel set. The index can be decoded from the bitstream. If the non-separable transform information includes a flag and the value of the flag is true, the non-separable inverse transform is applied, and if the value of the flag is false, the non-separable inverse transform is not applied. If the non-separable transform information is an index and the value of the index is 0, the non-separable inverse transform is not applied. If the non-separable transform information is an index and the value of the index is 1 or greater, the non-separable inverse transform is applied, and the index indicates one of the candidates within the transform kernel set.
[0252] The video decoding device checks whether the non-separable transformation information instructs the performance of non-separable inverse transformation (S1304).
[0253] When performing non-separable inverse transformation (Yes in S1304), the image decoding device performs the following steps.
[0254] The video decoding device derives the intra prediction mode of the transform block based on the prediction mode of the current block (S1306).
[0255] If the prediction mode of the current block is a directional mode or a non-directional mode, the image decoding device sets the intra prediction mode of the transformation block to the directional mode or the non-directional mode.
[0256] If the prediction mode of the current block is MIP mode, the image decoding device obtains a preset directional mode or a preset non-directional mode corresponding to the matrix used in the MIP mode. The image decoding device sets the intra prediction mode of the transform block to the preset directional mode or the preset non-directional mode.
[0257] When the prediction mode of the current block is the geometric segmentation mode, the image decoding device generates prediction signals of the current block according to the geometric segmentation mode, and derives a directional mode or a non-directional prediction mode based on all or part of the prediction signals. The image decoding device sets the intra prediction mode of the transform block to the derived directional mode or the derived non-directional prediction mode.
[0258] The video decoding device determines a non-separable inverse transform kernel corresponding to a non-separable first inverse transform kernel or a non-separable second inverse transform kernel based on the size of the transform block and the intra prediction mode (S1308).
[0259] The video decoding device selects a mode set that includes the intra prediction mode of the transform block from among the preset mode sets. The video decoding device selects a kernel set based on the size of the transform block and the selected mode set.
[0260] If the kernel set includes one inverse transform kernel candidate, the image decoding device determines one kernel candidate as a non-separable inverse transform kernel.
[0261] Alternatively, when the kernel set includes a plurality of inverse transform kernel candidates, the image decoding device may determine a candidate indicated by the non-separable transform information among the plurality of inverse transform kernel candidates as the non-separable inverse transform kernel.
[0262] The image decoding device generates residual signals from transform coefficients using a non-separable inverse transform kernel (S1310).
[0263] The image decoding device applies a non-separable second-order inverse transform kernel to the transform coefficients to generate first-order transform coefficients. The image decoding device implicitly obtains a pair of first-order inverse transform kernels in the vertical and horizontal directions for the transform block. The image decoding device applies a pair of first-order inverse transform kernels in the vertical and horizontal directions to the first-order transform coefficients to generate residual signals.
[0264] When the above-mentioned specific conditions (DCT-2 is applied as a separable first-order transform, LFNST is applied as a non-separable second-order transform, and the transform block has a preset size) are satisfied, the image decoding device applies a non-separable first-order inverse transform kernel to the transform coefficients to generate residual signals.
[0265] If non-separable inverse transformation is not performed (No in S1304), the image decoding device performs the following steps.
[0266] The image decoding device implicitly or explicitly obtains a pair of first-order inverse transform kernels in the vertical and horizontal directions for the transform block (S1320).
[0267] The image decoding device generates residual signals by applying a pair of first-order inverse transform kernels in the vertical and horizontal directions to the transform coefficients (S1322).
[0268] Although the flowchart / timing diagram of this specification describes each process as being executed sequentially, this is merely an illustrative description of the technical idea of one embodiment of the present disclosure. In other words, a person of ordinary skill in the art to which one embodiment of the present disclosure belongs may modify and apply various modifications and variations by changing the order described in the flowchart / timing diagram without departing from the essential characteristics of one embodiment of the present disclosure, or by executing one or more of the processes in parallel. Therefore, the flowchart / timing diagram is not limited to a chronological order.
[0269] It should be understood that the exemplary embodiments described above can be implemented in many different ways. The functions or methods described in one or more examples can be implemented in hardware, software, firmware, or any combination thereof. It should be understood that the functional components described herein are labeled as "units" to further emphasize their implementation independence.
[0270] Meanwhile, the various functions or methods described in this embodiment may also be implemented as instructions stored on a non-transitory storage medium that can be read and executed by one or more processors. Non-transitory storage media include, for example, all types of storage devices that store data in a form readable by a computer system. For example, non-transitory storage media include storage media such as erasable programmable read-only memory (EPROM), flash drives, optical drives, magnetic hard drives, and solid-state drives (SSDs).
[0271] The above description is merely an example of the technical idea of the present embodiment, and those skilled in the art will appreciate that various modifications and variations can be made without departing from the essential characteristics of the present embodiment. Therefore, the present embodiments are not intended to limit the technical idea of the present embodiment, but rather to explain it, and the scope of the technical idea of the present embodiment is not limited by these embodiments. The scope of protection of the present embodiment should be interpreted by the claims below, and all technical ideas within a scope equivalent thereto should be interpreted as being included in the scope of rights of the present embodiment.
[0272] (Explanation of symbols)
[0273] 530: Inverse transformation section
[0274] 540: Prediction Department
[0275] 702: Prediction Unit Decision Unit
[0276] 704: Prediction Technology Decision Division
[0277] 706: Prediction mode decision unit
[0278] 710: Inverse conversion unit decision unit
[0279] 712: Inverse transform kernel decision unit
[0280] 714: Inverse Transformation Unit
[0281]
[0282] CROSS-REFERENCE TO RELATED APPLICATION
[0283] This patent application claims priority to Korean patent application No. 10-2023-0050448, filed in Korea on April 18, 2023, and Korean patent application No. 10-2024-0047746, filed in Korea on April 9, 2024, the entire contents of which are incorporated herein by reference.
Claims
1. A method for restoring a current block performed by a video decoding device, A step of obtaining inverse quantized transform coefficients for the transform block of the current block; A step of decoding non-separable transform information from a bitstream, wherein the non-separable transform information indicates whether a non-separable inverse transform is applied, and the non-separable inverse transform indicates a non-separable first-order inverse transform or a non-separable second-order inverse transform; and A step of checking whether the above non-separable transformation information instructs the performance of the above non-separable inverse transformation. Including, but not limited to, If the above non-separable transformation information instructs the performance of the above non-separable inverse transformation, A step of deriving an intra prediction mode of the transformation block according to the prediction mode of the current block; A step of determining a non-separable inverse transform kernel corresponding to a non-separable first inverse transform kernel or a non-separable second inverse transform kernel based on the size of the above transformation block and the intra prediction mode. A method, characterized by including:
2. In paragraph 1, A method, characterized in that the above non-separable transformation information is a flag or index indicating whether or not the non-separable inverse transformation is applied.
3. In paragraph 1, If the above non-separable transformation information instructs the performance of the above non-separable inverse transformation, A method characterized by further comprising the step of generating residual signals by applying the non-separable first-order inverse transform kernel to the above transformation coefficients.
4. In paragraph 1, If the above non-separable transformation information instructs the performance of the above non-separable inverse transformation, A step of generating first-order transform coefficients by applying the non-separable second-order inverse transform kernel to the above transform coefficients; A step of implicitly obtaining a pair of first-order inverse transform kernels in the vertical and horizontal directions for the above transformation block; and A step of generating residual signals by applying a pair of vertical and horizontal first-order inverse transform kernels to the first-order transform coefficients. A method, characterized in that it further comprises:
5. In paragraph 1, If the above non-separable transformation information does not instruct the performance of the above non-separable inverse transformation, A step of obtaining a pair of first-order inverse transform kernels in the vertical and horizontal directions for the above transformation block; and A step of generating residual signals by applying a pair of first-order inverse transform kernels in the vertical and horizontal directions to the above transformation coefficients. A method, characterized in that it further comprises:
6. In paragraph 1, The step of determining the above non-separable inverse transform kernel is: A step of selecting a mode set including the intra prediction mode of the transformation block among the preset mode sets; and A step of selecting a kernel set based on the size of the above transformation block and the selected mode set. A method characterized by including:
7. In paragraph 6, The step of determining the above non-separable inverse transform kernel is: A method characterized in that, when the above kernel set includes a plurality of inverse transform kernel candidates, a candidate among the plurality of inverse transform kernel candidates indicated by the non-separable transform information is determined as the non-separable inverse transform kernel.
8. In paragraph 1, If the above prediction mode is MIP (Matrix-weighted Intra Prediction) mode, The step of deriving the intra prediction mode of the above transformation block is: A step of obtaining a preset directional mode or a preset non-directional mode corresponding to a matrix used in the above MIP mode; and A method characterized in that the intra prediction mode of the transformation block is set to the preset directional mode or the preset non-directional mode.
9. In paragraph 1, If the above prediction mode is MIP mode, The step of deriving the intra prediction mode of the above transformation block is: A step of generating intermediate prediction signals or final prediction signals of the current block according to the above MIP mode; A step of generating a Histogram of Oriented Gradient (HoG) based on the intermediate prediction signals or the final prediction signals and deriving a directional prediction mode corresponding to the most accumulated direction according to the HoG; and A step of setting the intra prediction mode of the above transformation block to the above-described directional prediction mode. A method, characterized by including:
10. In paragraph 1, If the above prediction mode is geometric segmentation mode, The step of deriving the intra prediction mode of the above transformation block is: A step of generating prediction signals of the current block according to the geometric division mode; A step of generating a HoG based on the above prediction signals and deriving a directional prediction mode corresponding to the most accumulated direction according to the HoG; and A step of setting the intra prediction mode of the above transformation block to the above-described directional prediction mode. A method, characterized by including:
11. In paragraph 1, The step of deriving the intra prediction mode of the above transformation block is: A method characterized in that, when the above prediction mode is a geometric division mode and one of the sub-regions divided according to the geometric division mode is intra-predicted, the intra prediction mode of the transform block is set to the intra prediction mode of the one sub-region.
12. In paragraph 1, The step of deriving the intra prediction mode of the above transformation block is: A method characterized in that, when the above prediction mode is a geometric division mode and all sub-regions divided according to the geometric division mode are intra-predicted, the intra prediction mode of the transformation block is set to the intra prediction mode of the sub-region having the largest area.
13. A method for encoding a current block performed by a video encoding device, A step of obtaining residual signals for the transformation block of the current block; A step of deriving an intra prediction mode of the transformation block according to the prediction mode of the current block; A step of determining a non-separable transform kernel corresponding to a non-separable first transform kernel or a non-separable second transform kernel based on the size of the transform block and the intra prediction mode; A step of generating first first-order transform coefficients by applying the non-separable first-order transform kernel to the above residual signals; A step of determining a pair of first-order transformation kernels in the vertical and horizontal directions for the above transformation block; A step of generating second first-order transform coefficients by applying the first-order transform kernel pair to the above residual signals; and A step of generating second-order transform coefficients by applying the non-separable second-order transform kernel to the second-order transform coefficients. A method, characterized by including:
14. In paragraph 13, A step of determining the non-separable transformation information based on the second primary transformation coefficients and the second secondary transformation coefficients, wherein the non-separable transformation information indicates whether to apply the non-separable transformation, and the non-separable transformation indicates a non-separable secondary transformation, and if the preset conditions are satisfied, indicates a non-separable primary transformation; and A step of encoding the above non-separable transformation information A method, characterized in that it further comprises:
15. In paragraph 14, A method, characterized in that the above non-separable transformation information is a flag or index indicating whether to apply the non-separable transformation.
16. In paragraph 14, A method characterized by further comprising a step of encoding the first primary transform coefficients, the second primary transform coefficients or the second secondary transform coefficients based on the non-separable transform information.
17. A computer-readable recording medium storing a bitstream generated by an image encoding method, wherein the image encoding method comprises: A step of obtaining residual signals for the transformation block of the current block; A step of deriving an intra prediction mode of the transformation block according to the prediction mode of the current block; A step of determining a non-separable transform kernel corresponding to a non-separable first transform kernel or a non-separable second inverse transform kernel based on the size of the transform block and the intra prediction mode; A step of generating first first-order transform coefficients by applying the non-separable first-order transform kernel to the above residual signals; A step of explicitly or implicitly determining a pair of first-order transformation kernels in the vertical and horizontal directions for the above transformation block; A step of generating second first-order transform coefficients by applying the first-order transform kernel pair to the above residual signals; and A step of generating second-order transform coefficients by applying the non-separable second-order transform kernel to the second-order transform coefficients. A recording medium, characterized by including:
Citation Information
Patent Citations
Transform-based video coding method and apparatus
JP7240476B2
Non-separable secondary transform for video coding with reorganizing
KR1020180063187A
Method and apparatus for video encoding and decoding applying merge mode using geometric partitioning mode
KR1020230049568A
Method and system for alleviating motion sickness in passengers
KR1020240081515A
KR20230034191A
