Method and apparatus for non-separable secondary transform-based video coding adapted to primary transform kernel

By using the characteristics of the primary transformation kernel in video encoding technology to select secondary transformation areas and cores, and applying inseparable secondary transformations to low-frequency areas, the problem that encoding efficiency and image quality in the prior art is difficult to meet the needs, and a more efficient and better video encoding effect is achieved.

CN119790656APending Publication Date: 2025-04-08HYUNDAI MOTOR CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202380063228.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-07-26
Filing Date
2023-07-28
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

Existing video encoding technologies work hard to meet the growing demand when processing video data at high resolution and high frame rates.

Method used

By reflecting the characteristics of the primary transformation kernel, selecting appropriate secondary transformation regions and transformation kernels, and applying the transformation coefficients of inseparable secondary transformations in the low-frequency region to improve video encoding efficiency and quality.

Benefits of technology

This method improves video encoding efficiency, enhances video quality, and can more effectively process video data at high resolution and high frame rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119790656A_ABST
    Figure CN119790656A_ABST
Patent Text Reader

Abstract

A method and apparatus for video coding based on inseparable secondary transform adapted to a primary transform kernel are disclosed. In this embodiment, a video decoding device determines primary inverse transform kernels in vertical and horizontal directions for a transform block of a current block. A video decoding apparatus obtains an inversely quantized secondary transform coefficient of a transform block. The video decoding apparatus determines a secondary inverse transform kernel of the transform block based on the size of the transform block, the intra prediction mode of the current block, and the primary inverse transform kernel. The video decoding apparatus generates a primary transform coefficient by applying a secondary inverse transform kernel to a secondary transform coefficient, and then generates a residual signal by applying a primary inverse transform kernel to the primary transform coefficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a video coding method and device based on an inseparable secondary transform applied to a primary transform kernel. Background Art

[0002] The statements in this section merely provide background information related to the present disclosure and may not constitute prior art.

[0003] Since video data has a large amount of data compared to audio or still image data, the video data requires a large amount of hardware resources (including memory) to store or transmit the video data without a process for compression.

[0004] Thus, encoders are generally used to compress and store or transmit video data. A decoder receives compressed video data, decompresses the received compressed video data, and plays the decompressed video data. Video compression technologies include H.264 / Advanced Video Coding (AVC), High Efficiency Video Coding (HEVC), and Versatile Video Coding (VVC), which have improved coding efficiency of about 30% or more compared to HEVC.

[0005] However, as image size, resolution and frame rate gradually increase, the amount of data to be encoded also increases. Thus, a new compression technology that provides higher encoding efficiency and improved image enhancement effect than existing compression technologies is needed.

[0006] The low-frequency non-separable transform (LFNST) technique performs a secondary transform on a low-frequency region in a transform coefficient generated by a primary transform of a transform block or transform unit (TU) during intra prediction. The LFNST technique performs a secondary transform on L low-frequency primary transform coefficients in the W×H primary transform coefficients to generate K secondary transform coefficients (where K≤L). The encoding device may quantize and then encode the generated secondary transform coefficients. The transform kernel has a size of K×L in LFNST, and the type of the kernel may be determined according to the intra prediction mode of the current TU, the size of the TU, and the LFNST index of LFnst_idx.

[0007] Meanwhile, when DCT2 / DCT2 transform kernel is applied as primary transform of TU for intra prediction, LFNST may be applied.Therefore, in order to increase video coding efficiency and enhance video quality, it is necessary to consider further utilizing the characteristics of primary transform when applying secondary transform. Summary of the invention

[0008]

Technical issues

[0009] The present disclosure attempts to provide a video encoding method and apparatus for selecting a secondary transform region and a transform kernel by reflecting the characteristics of a primary transform kernel. The video encoding method and apparatus apply an inseparable secondary transform to transform coefficients in a low frequency region using the selected transform kernel.

[0010]

Technical solution

[0011] At least one aspect of the present invention provides a method for reconstructing a current block by a video decoding device. The method includes determining a primary inverse transform kernel in the vertical and horizontal directions for a transform block. The method also includes obtaining a secondary transform coefficient that is dequantized for the transform block. The method also includes determining a secondary inverse transform kernel for the transform block based on the size of the transform block, the intra-frame prediction mode of the current block, and the primary inverse transform kernel. The method also includes performing a secondary inverse transform by applying the secondary inverse transform kernel to the secondary transform coefficient to generate a primary transform coefficient. The method also includes performing a primary inverse transform by applying the primary inverse transform kernel to the primary transform coefficient to generate a residual signal.

[0012] Another aspect of the present invention provides a method for encoding a current block by a video encoding device. The method includes obtaining a residual signal of a transform block about the current block. The method also includes determining a primary transform kernel in a vertical and horizontal direction relative to the transform block. The method also includes determining a secondary transform kernel of the transform block based on a size of the transform block, an intra-frame prediction mode of the current block, and the primary inverse transform kernel. The method also includes performing a primary transform by applying the primary transform kernel to the residual signal to generate a primary transform coefficient. The method also includes performing a secondary transform by applying the secondary transform kernel to the primary transform coefficient to generate a secondary transform coefficient.

[0013] Another aspect of the present invention provides a computer-readable recording medium storing a bitstream generated by a video encoding method. The video encoding method includes obtaining a residual signal of a transform block with respect to a current block. The video encoding method also includes determining a primary transform kernel in a vertical and horizontal direction relative to the transform block. The video encoding method also includes determining a secondary transform kernel of the transform block based on a size of the transform block, an intra-frame prediction mode of the current block, and the primary inverse transform kernel. The video encoding method also includes performing a primary transform by applying the primary transform kernel to the residual signal to generate a primary transform coefficient. The video encoding method also includes performing a secondary transform by applying the secondary transform kernel to the primary transform coefficient to generate a secondary transform coefficient.

[0014]

Beneficial Effects

[0015] As described above, the present disclosure provides a video encoding method and apparatus for selecting a secondary transform region and a transform kernel by reflecting the characteristics of a primary transform kernel. The video encoding method and apparatus use the selected transform kernel to apply an inseparable secondary transform to transform coefficients in a low frequency region. Thus, the video encoding method and apparatus improve video encoding efficiency and improve video quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a block diagram of a video encoding device that may implement the techniques of this disclosure.

[0017] Figure 2 A method for partitioning blocks using a quadtree plus binary tree ternary tree (QTBTTT) structure is shown.

[0018] Figure 3a and Figure 3b Multiple intra prediction modes are shown including a wide-angle intra prediction mode.

[0019] Figure 4 Neighboring blocks of the current block are shown.

[0020] Figure 5 is a block diagram of a video decoding device that may implement the techniques of this disclosure.

[0021] Figure 6 is a block diagram detailing a portion of a video decoding apparatus according to at least one embodiment of the present disclosure.

[0022] Figure 7a to Figure 7c is a diagram illustrating a scanning sequence of two-dimensional transform coefficients according to some embodiments of the present invention.

[0023] Figure 8a and Figure 8b is a diagram illustrating a scanning sequence of one-dimensional transform coefficients according to some embodiments of the present disclosure.

[0024] Fig. 9 A diagram illustrating scanning positions of one-dimensional transform coefficients according to at least one embodiment of the present disclosure.

[0025] Fig.10 A diagram illustrating a scanning sequence of one-dimensional transform coefficients according to another embodiment of the present disclosure.

[0026] Fig.11 is a flowchart of a method for transforming a transform block by a video encoding apparatus according to another embodiment of the present invention.

[0027] Fig.12 is a flowchart of a method of inversely transforming a transform block by a video decoding apparatus according to at least one embodiment of the present invention. DETAILED DESCRIPTION

[0028] Hereinafter, some embodiments of the present disclosure are described in detail with reference to the accompanying drawings. In the following description, the same reference numerals represent the same elements, although the elements are shown in different drawings. In addition, in the following description of some embodiments, for the purpose of clarity and brevity, detailed descriptions of related known components and functions may be omitted when it is considered to obscure the subject matter of the present disclosure.

[0029] Figure 1 is a block diagram of a video encoding device that can implement the technology of the present disclosure. Figure 1 A diagram of a video encoding apparatus and components of the apparatus is described.

[0030] The encoding device may include an image divider 110, a predictor 120, a subtractor 130, a transformer 140, a quantizer 145, a rearrangement unit 150, an entropy encoder 155, an inverse quantizer 160, an inverse transformer 165, an adder 170, a loop filter unit 180 and a memory 190.

[0031] Each component of the encoding device can be implemented as hardware or software or as a combination of hardware and software. In addition, the function of each component can be implemented as software, and a microprocessor can also be implemented to execute the function of the software corresponding to each component.

[0032] A video is composed of one or more sequences including multiple images. Each picture is divided into multiple regions, and encoding is performed on each region. For example, a picture is divided into one or more tiles or / and slices. Here, one or more tiles can be defined as a tile group. Each tile or / and slice is divided into one or more coding tree units (CTUs). In addition, each CTU is divided into one or more coding units (CUs) through a tree structure. The information applied to each coding unit (CU) is encoded as the syntax of the CU, and the information commonly applicable to the CU contained in a CTU is encoded as the syntax of the CTU. In addition, the information commonly applicable to all blocks in a slice is encoded as the syntax of the slice header, and the information applied to all blocks constituting one or more pictures is encoded as a picture parameter set (PPS) or a picture header. In addition, the information commonly referenced by multiple pictures is encoded into a sequence parameter set (SPS). In addition, the information commonly referenced by one or more SPSs is encoded into a video parameter set (VPS). Further, the information commonly applicable to a tile or tile group can also be encoded as the syntax of a tile or tile group header. The syntax included in the SPS, PPS, tile header, tile or tile group header may be referred to as a high-level syntax.

[0033] The image divider 110 determines the size of a coding tree unit (CTU). Information on the size of the CTU (CTU size) is encoded as a syntax of an SPS or a PPS and delivered to a video decoding device.

[0034] The image divider 110 divides each picture constituting a video into a plurality of coding tree units (CTUs) having a predetermined size, and then recursively divides the CTUs by using a tree structure. A leaf node in the tree structure becomes a coding unit (CU), which is a basic unit of encoding.

[0035] The tree structure can be a quadtree (QT), in which a higher node (or parent node) is divided into four lower nodes (or child nodes) of the same size. The tree structure can also be a binary tree (BT), in which a higher node is divided into two lower nodes. The tree structure can also be a ternary tree (TT), in which a higher node is divided into three lower nodes at a ratio of 1:2:1. The tree structure can also be a structure mixed with two or more of the QT structure, the BT structure, and the TT structure. For example, a quadtree plus a binary tree (QTBT) structure can be used or a quadtree plus a binary tree ternary tree (QTBTTT) structure can be used. Here, a binary tree ternary tree (BTTT) is added to the tree structure to be referred to as a multi-type tree (MTT).

[0036] Figure 2 is a diagram for describing a method of partitioning a block by using a QTBTTT structure.

[0037] like Figure 2 As shown in , the CTU can be first divided into a QT structure. The quadtree partitioning can be recursive until the size of the partitioned block reaches the minimum block size (MinQTSize) of the leaf node allowed in QT. The 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 encoder 155 and sent to the video decoding device. When the leaf node of QT is not larger than the maximum block size (MaxBTSize) of the root node allowed in BT, the leaf node can be further split into at least one of the BT structure or the TT structure. There may be multiple partitioning directions in the BT structure and / or the TT structure. For example, there may be two directions, namely, the direction in which the blocks of the corresponding node are horizontally partitioned and the direction in which the blocks of the corresponding node are vertically partitioned. As Figure 2 As shown, when MTT splitting starts, a second flag (mtt_split_flag) indicating whether the node is split and a flag further indicating the split direction (vertical or horizontal) and / or a flag indicating the split type (binary or ternary) if the node is split are encoded by the entropy encoder 155 and notified to the video decoding device with a signal.

[0038] Alternatively, before encoding the first flag (QT_split_flag) indicating whether each node is split into four nodes of the lower layer, a CU split flag (split_cu_flag) indicating whether the node is split may also be encoded. When the value of the CU split flag (split_cu_flag) indicates that each node is not split, the block of the corresponding node becomes a leaf node in the split tree structure and becomes a CU as a basic unit of encoding. When the value of the CU split flag (split_cu_flag) indicates that each node is split, the video encoding device first starts encoding the first flag through the above scheme.

[0039] When QTBT is used as another example of a tree structure, there may be two types, namely, a type in which the block of the corresponding node is horizontally split into two blocks of the same size (i.e., symmetrical horizontal splitting) and a type in which the block of the corresponding node is vertically split into two blocks of the same size (i.e., symmetrical vertical splitting). A split flag (split_flag) indicating whether each node of the BT structure is split into blocks of the lower layer and split type information indicating the split type are encoded by the entropy encoder 155 and delivered to the video decoding device. At the same time, a type in which the block of the corresponding node is split into two blocks that are asymmetric to each other may be presented in addition. The asymmetric form may include a form in which the block of the corresponding node is split into two rectangular blocks having a size ratio of 1:3, or may also include a form in which the block of the corresponding node is split in a diagonal direction.

[0040] A CU may have different sizes depending on the QTBT or QTBTTT partition from a CTU. Hereinafter, a block corresponding to a CU to be encoded or decoded (i.e., a leaf node of a QTBTTT) is referred to as a "current block". Due to the QTBTTT partition, the shape of the current block may be a rectangular shape in addition to a square shape.

[0041] The predictor 120 predicts the current block to generate a predicted block. The predictor 120 includes an intra predictor 122 and an inter predictor 124.

[0042] In general, each of the current blocks in a picture may be predictively encoded. Typically, the prediction of the current block may be performed using intra-prediction techniques (using data from the picture including the current block) or inter-prediction techniques (using data from a picture coded before the picture including the current block). Inter-prediction includes both unidirectional prediction and bidirectional prediction.

[0043] The intra-frame predictor 122 predicts the pixels in the current block by using the pixels (reference pixels) located at the neighboring positions of the current block in the current picture including the current block. There are a plurality of intra-frame prediction modes according to the prediction direction. For example, Figure 3aAs shown, the plurality of intra prediction modes may include 2 non-directional modes including a planar mode and a DC mode, and may include 65 directional modes. Neighboring pixels and an arithmetic expression to be used are defined differently according to each prediction mode.

[0044] In order to perform effective directional prediction for a current block having a rectangular shape, it is possible to additionally use Figure 3b The directional modes are shown by the dotted arrows in FIG. 67 (#67 to #80, intra-frame prediction modes #-1 to #-14). The directional modes may be referred to as "wide angle intra-frame prediction modes". Figure 3b , the arrows indicate the corresponding reference samples used for prediction and do not represent the prediction direction. The prediction direction is opposite to the direction indicated by the arrow. When the current block has a rectangular shape, the wide-angle intra prediction mode is a mode in which prediction is performed in a direction opposite to the specific direction mode without additional bit transmission. In this case, in the wide-angle intra prediction mode, some wide-angle intra prediction modes available for the current block can be determined by the ratio of the width and height of the current block having a rectangular shape. For example, when the current block has a rectangular shape with a height less than the width, a wide-angle intra prediction mode (intra prediction modes #67 to #80) with an angle less than 45 degrees is available. When the current block has a rectangular shape with a width greater than the height, a wide-angle intra prediction mode with an angle greater than -135 degrees can be used.

[0045] The intra-frame predictor 122 may determine an intra-frame prediction to be used for encoding the current block. In some examples, the intra-frame predictor 122 may encode the current block by using multiple intra-frame prediction modes, and may also select an appropriate intra-frame prediction mode to be used from a test mode. For example, the intra-frame predictor 122 may calculate a rate-distortion value by using a rate-distortion analysis for multiple tested intra-frame prediction modes, and may also select an intra-frame prediction mode with the best rate-distortion characteristics in the test mode.

[0046] The intra-frame predictor 122 selects an intra-frame prediction mode from among a plurality of intra-frame prediction modes and predicts the current block by using adjacent pixels (reference pixels) and an arithmetic expression determined according to the selected intra-frame prediction mode. Information about the selected intra-frame prediction mode is encoded by the entropy encoder 155 and delivered to the video decoding device.

[0047] The inter-frame predictor 124 generates a prediction block for the current block by using a motion compensation process. The inter-frame predictor 124 searches for a block most similar to the current block in a reference picture that is encoded and decoded earlier than the current picture, and generates a prediction block for the current block by using the searched block. In addition, a motion vector (MV) is generated, which corresponds to the displacement between the current block in the current picture and the prediction block in the reference picture. Typically, motion estimation is performed on the luminance component, and the motion vector calculated based on the luminance component is used for both the luminance component and the chrominance component. Motion information including information about the reference picture and information about the motion vector for predicting the current block is encoded by the entropy encoder 155 and delivered to the video decoding device.

[0048] The inter-frame predictor 124 may also perform interpolation on a reference picture or a reference block in order to increase the accuracy of the prediction. In other words, the sub-samples between two consecutive integer samples are interpolated by applying the filter coefficients to a plurality of consecutive integer samples including the two integer samples. When the process of searching for the block most similar to the current block is performed for the interpolated reference picture, the decimal unit precision may be used instead of the integer sample unit precision for the motion vector representation. The precision or resolution of the motion vector may be set differently for each target region to be encoded (e.g., units such as slices, tiles, CTUs, CUs, etc.). When this adaptive motion vector resolution (AMVR) is applied, information about the motion vector resolution to be applied to each target region should be signaled for each target region. For example, when the target region is a CU, information about the motion vector resolution applied to each CU is signaled. The information about the motion vector resolution may be information representing the precision of the motion vector difference to be described below.

[0049] Meanwhile, the inter-frame predictor 124 may perform inter-frame prediction by using bidirectional prediction. In the case of bidirectional prediction, two reference pictures and two motion vectors representing the block position most similar to the current block in each reference picture are used. The inter-frame predictor 124 selects a first reference picture and a second reference picture from a reference picture list 0 (RefPicList0) and a reference picture list 1 (RefPicList1), respectively. The inter-frame predictor 124 also searches for a block most similar to the current block in the corresponding reference picture to generate a first reference block and a second reference block. In addition, a prediction block of the current block is generated by averaging or weighted averaging the first reference block and the second reference block. In addition, motion information including information about two reference pictures for predicting the current block and including information about two motion vectors is delivered to the entropy encoder 155. Here, the reference picture list 0 may be composed of pictures before the current picture in the display order among the pre-reconstructed pictures, and the reference picture list 1 may be composed of pictures after the current picture in the display order among the pre-reconstructed pictures. However, although not particularly limited thereto, a pre-reconstructed picture after the current picture in the display order may be additionally included in the reference picture list 0. Conversely, a pre-reconstructed picture before the current picture may also be additionally included in the reference picture list 1.

[0050] In order to minimize the number of bits consumed for encoding motion information, various methods may be used.

[0051] For example, when the reference picture and motion vector of the current block are the same as those of the neighboring block, information capable of identifying the neighboring block is encoded to deliver the motion information of the current block to the video decoding device. This method is called merge mode.

[0052] In the merge mode, the inter predictor 124 selects a predetermined number of merge candidate blocks (hereinafter, referred to as “merge candidates”) from the neighboring blocks of the current block.

[0053] As in Figure 4 As shown in , 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 can be used as adjacent blocks for deriving merge candidates. Further, blocks located in a reference picture other than the current picture where the current block is located (which may be the same as or different from the reference picture used to predict the current block) can also be used as merge candidates. For example, a block located at the same location as the current block or a block adjacent to a block located at the same location in the reference picture can be used as a merge candidate in addition. If the number of merge candidates selected by the method described above is less than the preset number, a zero vector is added to the merge candidate.

[0054] The inter-frame predictor 124 configures a merge list including a predetermined number of merge candidates by using neighboring blocks. A merge candidate to be used as motion information of the current block is selected from the merge candidates included in the merge list, and merge index information for identifying the selected candidate is generated. The generated merge index information is encoded by the entropy encoder 155 and delivered to the video decoding device.

[0055] Merge skip mode is a special case of merge mode. After quantization, when all transform coefficients for entropy coding are close to zero, only neighbor block selection information is transmitted without transmitting residual signals. By using merge skip mode, relatively high coding efficiency can be achieved for images with slight motion, still images, screen content images, etc.

[0056] Hereinafter, the merge mode and the merge skip mode are collectively referred to as the merge / skip mode.

[0057] Another method for encoding motion information is the Advanced Motion Vector Prediction (AMVP) mode.

[0058] In the AMVP mode, the inter-frame predictor 124 derives a motion vector predictor candidate for a motion vector of a current block by using neighboring blocks of the current block. As neighboring blocks for deriving motion vector predictor candidates, the neighboring blocks in the Figure 4 All or some of the left block A0, lower left block A1, upper block B0, upper right block B1, and upper left block B2 adjacent to the current block in the current picture shown in . In addition, blocks located in a reference picture other than the current picture where the current block is located (which may be the same as or different from the reference picture used to predict the current block) may also be used as adjacent blocks for deriving motion vector predictor candidates. For example, blocks co-located with the current block or blocks adjacent to co-located blocks within the reference picture may be used. If the number of motion vector candidates selected by the above method is less than the preset number, a zero vector is added to the motion vector candidates.

[0059] The inter predictor 124 derives a motion vector predictor candidate by using the motion vectors of the neighboring blocks, and determines a motion vector predictor for the motion vector of the current block by using the motion vector predictor candidate. In addition, a motion vector difference is calculated by subtracting the motion vector predictor from the motion vector of the current block.

[0060] The motion vector predictor can be obtained by applying a predefined function (e.g., center value and average value calculation, etc.) to the motion vector predictor candidate. In this case, the video decoding device also knows the predefined function. In addition, since the neighboring blocks used to derive the motion vector predictor candidate are blocks for which encoding and decoding have been completed, the video decoding device may also already know the motion vectors of the neighboring blocks. Therefore, the video encoding device does not need to encode the information for identifying the motion vector predictor candidate. Thus, in this case, information about the motion vector difference and information about the reference picture used to predict the current block are encoded.

[0061] Meanwhile, the motion vector predictor may also be determined by selecting any one of the motion vector predictor candidates. In this case, information for identifying the selected motion vector predictor candidate is additionally encoded jointly with information about the motion vector difference and information about the reference picture used to predict the current block.

[0062] The subtractor 130 generates a residual block by subtracting a prediction block generated by the intra predictor 122 or the inter predictor 124 from the current block.

[0063] The transformer 140 converts the residual signal in the residual block having the pixel value in the spatial domain into a transform coefficient in the frequency domain. The transformer 140 may transform the residual signal in the residual block by using the total size of the residual block as a transform unit, or may further divide the residual block into a plurality of sub-blocks, and may perform the transform by using the sub-block as a transform unit. Optionally, the residual block is divided into two sub-blocks, namely a transform region and a non-transform region, so as to transform the residual signal using only the transform region sub-block as a transform unit. Here, the transform region sub-block may be one of two rectangular blocks having a size ratio of 1:1 based on the horizontal axis (or vertical axis). In this case, the flag (cu_sbt_flag) indicates that only the sub-block is transformed, and the directional (vertical / horizontal) information (cu_sbt_horizontal_flag) and / or the position information (cu_sbt_pos_flag) are encoded by the entropy encoder 155 and signaled to the video decoding device. In addition, the size of the transform region sub-block may have a size ratio of 1:3 based on the horizontal axis (or vertical axis). In this case, a flag (cu_sbt_quad_flag) for dividing the corresponding partition is additionally encoded by the entropy encoder 155 and signaled to the video decoding apparatus.

[0064] Meanwhile, the transformer 140 may perform transformation on the residual block separately in the horizontal direction and the vertical direction. For the transformation, different types of transformation functions or transformation matrices may be used. For example, a pair of transformation functions for horizontal transformation and vertical transformation may be defined as a multiple transformation set (MTS). The transformer 140 may select a transformation function pair with the highest transformation efficiency in the MTS, and may transform the residual block in each of the horizontal and vertical directions. Information (mts_idx) of the transformation function pair in the MTS is encoded by the entropy encoder 155 and notified to the video decoding device with a signal.

[0065] The quantizer 145 quantizes the transform coefficients output from the transformer 140 using the quantization parameter and outputs the quantized transform coefficients to the entropy encoder 155. The quantizer 145 can also immediately quantize the relevant residual block without transforming any block or frame. The quantizer 145 can also apply different quantization coefficients (scaling values) according to the position of the transform coefficient in the transform block. The quantization matrix applied to the quantized transform coefficients arranged in 2 dimensions can be encoded and notified to the video decoding device with a signal.

[0066] The rearrangement unit 150 may perform rearrangement of coefficient values ​​with respect to the quantized residual value.

[0067] The rearrangement unit 150 may change the 2D coefficient array into a 1D coefficient sequence by using coefficient scanning. For example, the rearrangement unit 150 may output an ID coefficient sequence by scanning the DC coefficient into a high frequency domain coefficient using a zigzag scan or a diagonal scan. Depending on the size of the transform unit and the intra prediction mode, a vertical scan that scans the 2D coefficient array in the column direction and a horizontal scan that scans the 2D block type coefficients in the row direction may also be used instead of the zigzag scan. In other words, depending on the size of the transform unit and the intra prediction mode, the scanning method to be used may be determined among zigzag scanning, diagonal scanning, vertical scanning, and horizontal scanning.

[0068] The entropy encoder 155 generates a bitstream by encoding the sequence of ID-quantized transform coefficients output from the rearrangement unit 150 using various encoding schemes including context-based adaptive binary arithmetic coding (CABAC), Indexed Golomb, and the like.

[0069] In addition, the entropy encoder 155 encodes information related to block segmentation (such as CTU size, CTU segmentation mark, QT segmentation mark, MTT segmentation type, MTT segmentation direction, etc.) to allow the video decoding device to equally segment the block to the video encoding device. In addition, the entropy encoder 155 encodes information about the prediction type indicating whether the current block is encoded by intra-frame prediction or inter-frame prediction. The entropy encoder 155 encodes intra-frame prediction information (i.e., information about intra-frame prediction mode) or inter-frame prediction information (in the case of merge mode, merge index, and in the case of AMVP mode, information about reference picture index and motion vector difference) according to the prediction type. In addition, the entropy encoder 155 encodes information related to quantization (i.e., information about quantization parameters and information about quantization matrices).

[0070] The inverse quantizer 160 inversely quantizes the quantized transform coefficient output from the quantizer 145 to generate a transform coefficient. The inverse transformer 165 transforms the transform coefficient output from the inverse quantizer 160 from the frequency domain to the spatial domain to reconstruct a residual block.

[0071] The adder 170 reconstructs the current block by adding the reconstructed residual block and the prediction block generated by the predictor 120. When intra prediction is performed on a next sequential block, pixels in the reconstructed current block may be used as reference pixels.

[0072] The loop filter unit 180 performs filtering on the reconstructed pixels in order to reduce block artifacts, ringing artifacts, blur artifacts, etc. that occur due to block-based prediction and transform / quantization. The loop filter unit 180 as a loop filter may include all or some of the deblocking filter 182, the sample adaptive offset (SAO) filter 184, and the adaptive loop filter (ALF) 186.

[0073] The deblocking filter 182 filters the boundaries between the reconstructed blocks to remove the block effect caused by block unit encoding / decoding, and the SAO filter 184 and the ALF 186 perform additional filtering for the deblocked filtered video. The SAO filter 184 and the ALF 186 are filters for compensating the difference between the reconstructed pixels and the original pixels, which is caused by lossy encoding. The SAO filter 184 applies an offset as a CTU unit to enhance subjective image quality and coding efficiency. On the other hand, the ALF 186 performs block unit filtering and applies different filters to compensate for distortion by dividing the boundaries of the corresponding blocks and the degree of variation. Information about the filter coefficients to be used for the ALF can be encoded and notified to the video decoding device with a signal.

[0074] The reconstructed blocks filtered by the deblocking filter 182, the SAO filter 184, and the ALF 186 are stored in the memory 190. When all blocks in one picture are reconstructed, the reconstructed picture can be used as a reference picture for inter-frame prediction of blocks within a picture to be encoded later.

[0075] The video encoding device may store a bitstream of encoded video data in a non-transitory storage medium or transmit the bitstream to a video decoding device through a communication network.

[0076] Figure 5 is a functional block diagram of a video decoding device that can implement the technology of the present disclosure. Figure 5 , describing a video decoding apparatus and components of the apparatus.

[0077] The video decoding device may include an entropy decoder 510 , a rearrangement unit 515 , an inverse quantizer 520 , an inverse transformer 530 , a predictor 540 , an adder 550 , a loop filter unit 560 , and a memory 570 .

[0078] and Figure 1 Similar to the video encoding device of the present invention, each component of the video decoding device can be implemented as hardware or software or as a combination of hardware and software. In addition, the function of each component can be implemented as software, and a microprocessor can also be implemented to execute the function of the software corresponding to each component.

[0079] The entropy decoder 510 extracts information related to block partitioning by decoding a bitstream generated by a video encoding apparatus to determine a current block to be decoded, and extracts prediction information required to reconstruct the current block and information about a residual signal.

[0080] The entropy decoder 510 determines the size of the CTU by extracting information about the CTU size from a sequence parameter set (SPS) or a picture parameter set (PPS), and partitions the picture into CTUs of a determined size. In addition, the CTU is determined to be the highest level of the tree structure, i.e., the root node, and partition information of the CTU can be extracted to partition the CTU using the tree structure.

[0081] For example, when a CTU is segmented using a QTBTTT structure, a first flag (QT_split_flag) associated with the segmentation of the QT is first extracted to segment each node into four nodes of the lower layer. In addition, for a node corresponding to a leaf node of the QT, a second flag (mtt_split_flag) associated with the segmentation of the MTT, a segmentation direction (vertical / horizontal) and / or a segmentation type (binary / ternary) are extracted to segment the corresponding leaf node into the MTT structure. As a result, each node below the leaf node of the QT is recursively segmented into a BT or TT structure.

[0082] As another example, when a CTU is split by using a QTBTTT structure, a CU split flag (split_cu_flag) indicating whether the CU is split is extracted. When the corresponding block is split, a first flag (QT_split_flag) may also be extracted. During the splitting process, for each node, 0 or more recursive MTT splits may occur after 0 or more recursive QT splits. For example, for a CTU, MTT splitting may occur immediately, or conversely, only multiple QT splits may occur.

[0083] For another example, when the CTU is split using the QTBT structure, the first flag (QT_split_flag) related to the splitting of the QT is extracted to split each node into four nodes of the lower layer. In addition, the split flag (split_flag) indicating whether the node corresponding to the leaf node of the QT is further split into BTs and the split direction information are extracted.

[0084] Meanwhile, when the entropy decoder 510 determines the current block to be decoded by partitioning using a tree structure, the entropy decoder 510 extracts information about a prediction type indicating whether the current block is intra-predicted or inter-predicted. When the prediction type information indicates intra-prediction, the entropy decoder 510 extracts syntax elements of intra-prediction information (intra-prediction mode) for the current block. When the prediction type information indicates inter-prediction, the entropy decoder 510 extracts information representing syntax elements for inter-prediction information (i.e., motion vectors and reference pictures referenced by motion vectors).

[0085] Furthermore, the entropy decoder 510 extracts quantization-related information and extracts information on a quantized transform coefficient of the current block as information on a residual signal.

[0086] The rearrangement unit 515 may change the sequence of 1D quantized transform coefficients entropy-decoded by the entropy decoder 510 into a 2D coefficient array (ie, block) again in the reverse order of the coefficient scanning order performed by the video encoding device.

[0087] The inverse quantizer 520 inversely quantizes the quantized transform coefficients, and inversely quantizes the quantized transform coefficients by using quantization parameters. The inverse quantizer 520 may also apply different quantization coefficients (scaling values) to the quantized transform coefficients arranged in 2D. The inverse quantizer 520 may perform inverse quantization by applying a matrix (scaling value) of quantization coefficients from a video encoding device to a 2D array of quantized transform coefficients.

[0088] The inverse transformer 530 generates a residual block for the current block by reconstructing a residual signal by inversely transforming the inverse quantized transform coefficient from the frequency domain into the spatial domain.

[0089] In addition, when the inverse transformer 530 inversely transforms a partial region (sub-block) of the transform block, the inverse transformer 530 extracts a flag (cu_sbt_flag) that only the sub-block of the transform block is transformed, direction (vertical / horizontal) information (cu_sbt_horizontal_flag) of the sub-block, and / or position information (cu_sbt_pos_flag) of the sub-block. The inverse transformer 530 also inversely transforms the transform coefficient of the corresponding sub-block from the frequency domain to the spatial domain to reconstruct the residual signal and fills the region that is not inversely transformed with a value of "0" as the residual signal to generate a final residual block for the current block.

[0090] In addition, when MTS is applied, the inverse transformer 530 determines a transform index or a transform matrix applied in each of the horizontal and vertical directions by using MTS information (mts_idx) signaled from the video encoding device. The inverse transformer 530 also performs inverse transform on the transform coefficients in the transform block in the horizontal and vertical directions by using the determined transform function.

[0091] The predictor 540 may include an intra predictor 542 and an inter predictor 544. The intra predictor 542 is activated when the prediction type of the current block is intra prediction, and the inter predictor 544 is activated when the prediction type of the current block is inter prediction.

[0092] The intra predictor 542 determines an intra prediction mode of a current block among a plurality of intra prediction modes according to the syntax element of the intra prediction mode extracted from the entropy decoder 510. The intra predictor 542 also predicts the current block by using neighboring reference pixels of the current block according to the intra prediction mode.

[0093] The inter predictor 544 determines a motion vector of a current block and a reference picture to which the motion vector refers by using a syntax element for the inter prediction mode extracted from the entropy decoder 510 .

[0094] The adder 550 reconstructs the current block by adding the residual block output from the inverse transformer 530 and the prediction block output from the inter predictor 544 or the intra predictor 542. When intra prediction is performed on a block to be decoded later, pixels within the reconstructed current block are used as reference pixels.

[0095] The loop filter unit 560 as a loop filter may include a deblocking filter 562, an SAO filter 564, and an ALF 566. The deblocking filter 562 performs deblocking filtering on the boundary between the reconstructed blocks in order to remove the block effect that occurs due to block unit decoding. The SAO filter 564 and the ALF 566 perform additional filtering on the reconstructed blocks after deblocking filtering in order to compensate for the difference between the reconstructed pixels and the original pixels that occurs due to lossy encoding. The filter coefficients of the ALF are determined by using information about the filter coefficients decoded from the bitstream.

[0096] The reconstructed blocks filtered by the deblocking filter 562, the SAO filter 564, and the ALF 566 are stored in the memory 570. When all blocks in one picture are reconstructed, the reconstructed picture can be used as a reference picture for inter-frame prediction of blocks in a picture to be encoded later.

[0097] In some embodiments, the present invention relates to encoding and decoding a video image as described above. More specifically, the present disclosure provides a video encoding method and apparatus for selecting a secondary transform region and a transform kernel by reflecting the characteristics of a primary transform kernel. The video encoding method and apparatus use the selected transform kernel to apply an inseparable secondary transform to transform coefficients in a low frequency region.

[0098] The following embodiments may be performed by the transformer 140 and the inverse transformer 165 in the video encoding apparatus. The following embodiments may also be performed by the inverse transformer 530 in the video decoding apparatus.

[0099] The video encoding device may generate signaling information associated with the present embodiment in terms of optimizing rate distortion when encoding the current block. The video encoding device may encode the signaling information using the entropy encoder 155 and send the encoded signaling information to the video decoding device. The video decoding device may decode the signaling information associated with decoding of the current block from the bitstream using the entropy decoder 510.

[0100] In the following description, the term 'target block' may be used interchangeably with a current block or a coding unit (CU), or may refer to a certain region of a coding unit.

[0101] In addition, a value of a flag is true indicating when the flag is set to 1. In addition, a value of a flag is false indicating when the flag is set to 0.

[0102] I. Conversion Technology - Primary Conversion Technology

[0103] As described above, for efficient video compression, quantization or scaling may be further applied to the residual signal remaining after prediction according to different prediction techniques. In this case, based on the importance of the perceived visual information inherent in the residual signal, a transform technique may be applied to cluster the residual signal according to its frequency components, and scaling may then be performed. However, for non-natural signals such as screen content, this frequency-based transform may be inefficient. In such a case, the transform technique may be omitted and only scaling may be performed, or encoding / decoding may be performed without applying scaling.

[0104] In HEVC, when a transform is applied, DCT-II is used as a transform kernel (hereinafter, used interchangeably with transform type) for transforming a residual signal. However, in order to apply a more appropriate transform technique to the diversity of residual signal characteristics, a multi-transform selection (MTS) may be used. MTS determines the best one or both of the multiple transform types, and then transforms the block according to the determined transform type. For example, in VVC (Versatile Video Coding), in addition to DCT-II, two other transform types DCT-VIII and DST-VII are added as shown in Table 1 to allow the residual signal to be transformed in different ways.

[0105]

Table 1

[0106]

[0107] Here, the basis functions form a transform matrix that defines each transform type. In the following, DCT-II, DCT-VIII, and DST-VII may be used interchangeably with DCT2, DCT8, and DCT7, respectively.

[0108] At the same time, a flag that determines whether MTS (Multiple Transform Selection) will be used or enabled can be controlled on a block-by-block basis. In addition, the use or non-use of MTS can be controlled by using an enable flag at a higher SPS level.

[0109] When MTS at SPS is enabled, a CU level flag may be expressed to indicate whether MTS is applied. Here, MTS may be used for luma components. If both the width and height of the TB are less than or equal to 32 pixels and if the coded block flag (CBF) (indicating whether any of the transform coefficient levels has a non-zero value) is true, then the CU level flag may be expressed.

[0110] If the CU level flag is 0, then DCT2 is used for the kernel in both horizontal and vertical directions. On the other hand, if the CU level flag is non-zero, then MTS is applied. MTS can be used in two ways: explicit MTS and implicit MTS.

[0111] In explicit MTS, the kernel for a TB is explicitly transmitted. Typically, the index of the transform kernel may be transmitted. For example, mts_idx (index of the kernel) may be defined as shown in Table 2.

[0112]

Table 2

[0113] mts_idx 0 1 2 3 4 trTypeHor 0 1 2 1 2 trTypeVer 0 1 1 2 2

[0114] Here, trTypeHor and trTypeVer represent a transform type in the horizontal direction and a transform type in the vertical direction. In addition, 0 indicates DCT2, 1 indicates DCT7, and 2 indicates DCT8.

[0115] On the other hand, in implicit MTS, for example, in the case of intra blocks, the transform type may be implicitly determined without explicitly signaling the MTS. In VVC, the transform types in the horizontal and vertical directions may be implicitly determined, as shown in Equation 1.

[0116] [Formula 1]

[0117] trTypeHor=(nTbW>=4&&nTbW<=16)? DST7:DCT2

[0118] trTypeVer=(nTbH>=4&&nTbH<=16)? DST7:DCT2

[0119] Here, nTbW and nTbH represent the horizontal length and vertical length of the transform block, respectively.

[0120] As an example, when a specific coding technique is applied, explicit MTS or implicit MTS may be applied. For example, in the case of matrix weighted intra prediction (MIP), explicit intra MTS may be used. In intra sub-partitioning (ISP) mode, implicit intra MTS is used, where DST7 or DCT2 is used as the transform type.

[0121] If the transform block contains at least one or more non-DC coefficients, then mts_idx is signaled. In other words, if the position of the last significant coefficient in the scan sequence is greater than 0, then 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.

[0122] The first bin of the signaled mts_idx indicates whether mts_idx is greater than 0. If mts_idx is greater than 0 (ie, mts_idx indicates one of 1 to 4), additional two bits of the fixed length code are signaled to indicate the signaled mts_idx among the four candidates.

[0123] At the same time, in the next generation technology, the enhanced compression model (ECM) software has been added, the number and type of MTS cores have been increased, and DST7, DCT8, DCT5, DST4, DST1 and identity transform have been added.

[0124] II. Low-Frequency Non-Separable Transform (LFNST)

[0125] The LFNST technique performs a secondary transform on the low-frequency region of the transform coefficients generated by the primary transform of the transform block (transform unit TU) during intra prediction. On the encoding side, the LFNST technique performs a secondary transform on the L low-frequency primary transform coefficients in the W×H primary transform coefficients to generate K (K≤L) secondary transform coefficients. Here, the size of the transform kernel of the LFNST is L×K. In other words, the LFNST technique represents the L low-frequency primary transform coefficients of 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. The LFNST technique then represents the 1×K vector by a two-dimensional array in the low-frequency region for further processing, such as quantization.

[0126] Compared to the primary transform that applies separate transform kernels in the horizontal and vertical directions, the LFNST technique performs a non-separable transform for transforming a one-dimensional vector.

[0127] Meanwhile, the type of transform kernel may be determined based on the intra prediction mode of the current TU, the size of the TU, and the LFNST index (Lffnst_idx). For example, based on the intra prediction mode (IntraPredMode) of the current TU, the set of transform kernels may be determined as shown in Table 2.

[0128]

Table 3

[0129] IntraPredMode LfsntTrSetIdx IntraPredMode<0 1 0≤IntraPredMode≤1 0 2≤IntraPredMode≤12 1 13≤IntraPredMode≤23 2 24≤IntraPredMode≤44 3 45≤IntraPredMode≤55 2 56≤IntraPredMode≤80 1 81≤IntraPredMode≤83 0

[0130] Here, the intra-frame prediction mode (IntraPredMode) is based on Figure 3b In addition, lfnstTrSetIdx is an index indicating a kernel set. In Table 3, the intra prediction modes of 81, 82, and 83 indicate a cross-component linear model (CCLM) prediction mode.

[0131] For each kernel set (lfsntTrSetIdx), two types of kernels are defined. Which of these two types of kernels is selected can be indicated by the LFNST index. LFNST index 0 means that LFNST is not performed, and LFNST index 1 or 2 means that different LFNST kernels within the same kernel set are applied. There is more than one kernel set depending on the size of the TU, so there are a total of 4×2×2=16 transform kernels. The kernel size of LFNST is defined as 16×16 and 16×48. In addition, depending on the size of the TU, the kernel size can be adjusted as shown in Table 4.

[0132]

Table 4

[0133]

[0134]

[0135] On the other hand, if the DCT2 / DCT2 transform kernel is applied as a primary transform for an intra-prediction TU, the LFNST technique may be applied as a secondary transform.

[0136] The following embodiments are described with reference to a video decoding device, but may be equally or similarly implemented in a video encoding device.

[0137] III. Implementations according to the present disclosure

[0138] Figure 6 is a block diagram detailing a portion of a video decoding apparatus according to at least one embodiment of the present disclosure.

[0139] According to some embodiments, the video decoding device can determine the prediction unit and the transformation unit, and with respect to the current block corresponding to the determined unit, perform prediction and inverse transformation by using the determined prediction technology and prediction mode to finally generate a reconstructed block of the current block. Figure 6 The operations shown in FIG. 5 can be performed by the inverse transformer 530, the predictor 540, and the adder 550 of the video decoding device. Figure 6 The same operations shown in the figure can be performed by the inverse transformer 165, the image divider 110, the predictor 120, and the adder 170 of the video encoding device. In this case, the video decoding device uses the encoding information parsed from the bit stream, but the video encoding device can use the encoding information set from a higher level in terms of minimizing rate distortion. Hereinafter, for convenience, the embodiment is described with the video decoding device as the center.

[0140] like Figure 5 As shown in FIG. 5 , the predictor 540 includes an intra-frame predictor 542 and an inter-frame predictor 544 according to the prediction technique, and as shown in FIG. Figure 6As shown in , the predictor 540 may include a prediction mode determiner 602 and a prediction executor 604 .

[0141] When the color format of the input video is a YUV format (YUV420, YUV411, YUV422, YUV444, etc.), the video decoding apparatus may perform prediction and reconstruction of the luminance component, and then may perform prediction and reconstruction of the chrominance component. In other words, the luminance component and the chrominance component may be obtained by Figure 6 The components shown in are sequentially reconstructed. Here, in the case of the YUV format, the color format indicates the correspondence between the pixels of the luminance component and the pixels of the chrominance component.

[0142] The prediction mode determiner 602 determines a prediction technique, such as intra prediction, inter prediction or intra block copy (IBC) mode, palette mode, etc. The prediction mode determiner 602 also determines a detailed prediction mode for the prediction technique. The prediction executor 604 generates a prediction block of the current block according to the determined prediction technique and prediction mode.

[0143] The inverse transformer 530 inversely transforms the TU represented by the inverse quantized signal to generate a residual signal.

[0144] The adder 550 sums the predicted block and the residual signal to generate a reconstructed block. The reconstructed block is stored in a memory and can be used for subsequent prediction of other blocks.

[0145] Hereinafter, TU and transform block are used interchangeably.

[0146] As in Figure 6 As shown in the example of , the inverse transformer 530 may include all or part of a primary inverse transform kernel determiner 610, a secondary inverse transform process determiner 612, a secondary inverse transform kernel determiner 614, a secondary inverse transformer 616, and a primary inverse transformer 618. By using these components, the inverse transformer 530 performs an inseparable secondary inverse transform applicable to the primary transform kernel on the transform coefficients in the low frequency region.

[0147] As described above, the primary inverse transform kernel determiner 610 may determine the primary inverse transform kernels in the vertical and horizontal directions based on the prediction technique and prediction mode of the current block, the size of the current transform block, mts_idx, and the like.

[0148] The primary inverse transform kernel may be explicitly determined based on the parsed mts_idx. Alternatively, the primary inverse transform kernel may be implicitly determined based on whether to transform a subblock, the size of a TU, etc. In this case, if the current block is predicted according to an intra prediction mode and the primary inverse transform kernels in the vertical and horizontal directions are explicitly determined according to the parsed mts_idx, then the type of kernel indicated by mts_idx may be determined based on the size of the current TU and the intra prediction mode. For example, after defining the type of a one-dimensional inverse transform kernel in the vertical and horizontal directions represented by mts_idx for a combination of possible TU sizes (4×4, 4×8, 8×4, 8×8, ...) and intra prediction modes according to an agreement, the primary inverse transform kernel determiner 610 may parse mts_idx to determine the final inverse transform kernel.

[0149] At this time, the intra-frame prediction mode (IntraPredMode) can be divided into a set of A modes centered on the upper left diagonal mode (mode 34). When A=4, based on Figure 3b An example of a pattern set is shown in Table 5.

[0150]

Table 5

[0151] IntraPredMode Mode Settings IntraPredMode<0 1 0≤IntraPredMode≤1 0 2≤IntraPredMode≤12 1 13≤IntraPredMode≤23 2 24≤IntraPredMode≤44 3 45≤IntraPredMode≤55 2 56≤IntraPredMode≤80 1

[0152] The matrix-based prediction mode may be included in the set of non-directional modes (mode set 0), or may be classified as a separate set. In addition, if the chroma block is predicted using a cross-component prediction mode that uses the relationship between the chroma component and the luminance component, the primary inverse transform kernel determiner 610 maps the intra-prediction mode at the center position of the corresponding luminance block to the intra-prediction mode of the current chroma block. The primary inverse transform kernel determiner 610 may establish a mode set from the mapped intra-prediction mode based on Table 5, and may determine the primary inverse transform kernel using the mode set.

[0153] If the current block is predicted based on inter prediction, the transform kernel represented by mts_idx according to the TU size may be determined based on an agreement between the video encoding device and the video decoding device. Alternatively, the kernel represented by mts_idx may be fixed.

[0154] For example, if the current block is predicted according to a combined inter-intra prediction mode (CIIP mode), the primary inverse transform kernel of the current TU can be determined by the same method as determining the kernel of the intra prediction block according to the intra prediction mode and the TU size. Here, CIIP is an example mode of generating a final prediction block of the current block by weighted summing of a prediction block based on inter prediction and a prediction block based on intra prediction. Alternatively, if the current block is predicted by CCIP mode, the primary inverse transform kernel of the current TU can be determined in the same manner as inter prediction.

[0155] According to an embodiment, if the weight of the intra prediction block is greater than the weight of the inter prediction block, the primary inverse transform kernel of the current TU can be determined in the same manner as the intra prediction. At this time, based on the transform block size and the intra prediction mode, some of the kernels of DCT-N (N=1, ..., 8), DST-N and IDT (identity transform) can be selected as primary inverse transform kernels in the vertical and horizontal directions, respectively. For example, DCT-2, DCT-5, DCT-8, DST-1, DST-4, DST-7, IDT kernels can be used as primary inverse transform kernels.

[0156] The secondary inverse transform process determiner 612 may parse a 1-bit flag (Lffnst_flag, hereinafter "LFNST flag") or a LFNST index (Lffnst_idx) indicating whether the secondary inverse transform is applied, and thereby determine whether the secondary inverse transform is applied. When parsing the LFNST index, a specific index value (e.g., Lffnst_idx=0) may be pre-arranged to indicate that the secondary inverse transform is not applied.

[0157] In one example, application or non-application of the secondary inverse transform may be implicitly determined by the type of the primary transform kernel in the vertical and horizontal directions. If the secondary inverse transform is applied for a specific primary transform kernel, the transmission of the LFNST flag or LFNST index may be omitted. In addition, the secondary inverse transform may not be implicitly applied to the remaining transform kernels other than the specific primary transform kernel.

[0158] The secondary inverse transform kernel determiner 614 may be responsive to a determination to perform a secondary inverse transform for determining a secondary inverse transform kernel based on a size of a current TU, an intra prediction mode, and a primary inverse transform kernel.

[0159] In one example, the size of the secondary inverse transform kernel may depend on a set S of kernel sizes having C different sizes based on the size of the TU.

[0160] For example, the size of the kernel can be determined based on the following condition (the size of the TU), and the criteria for distinguishing the groups can vary according to the implementation.

[0161] <Embodiment 1>

[0162] S 0 : 4×N / N×4 (N≥4), S 1 : 8×N / N×8 (N≥8), S 2 : M×N (M, N≥16)

[0163] <Embodiment 2>

[0164] S 0 : 4×4, S 1 : 4×N / N×4 (N≥8), S 2 : 8×8, S 3 : M×N (except M, N≥8,

[0165] M = N = 8)

[0166] The inverse transform kernel of each group has a size of p i ×q i (0≤i<C). Here, p i represents the size of the primary transform coefficient of the output, q i represents the size of the secondary transform coefficient of the input, and p i ≥ q i .

[0167] As described above, with respect to the set S of kernel sizes determined by the TU size, based on the intra prediction mode in the current block and the type of the primary transform kernel, there may be A (intra prediction mode groups) × K (primary transform kernel sets) = T groups of secondary inverse transform kernels (or "kernel sets").

[0168] The intra prediction mode can be classified into a set of A modes centered on the upper left diagonal mode, as shown in an example in Table 5. The matrix-based prediction mode can be included in the non-directional mode set (mode set 0) or can be classified into a separate set. In addition, if the chrominance block is predicted based on cross-component prediction (e.g., CCLM mode) that utilizes the relationship between the chrominance component and the luminance component, the secondary inverse transform kernel determiner 614 maps the intra prediction mode at the center position of the corresponding luminance block to the intra prediction mode of the current chrominance block. The secondary inverse transform kernel determiner 614 can establish a mode set from the mapped intra prediction mode based on Table 5, and can use the mode set to determine the secondary inverse transform kernel.

[0169] According to an embodiment, the K{vertical, horizontal} sets of kernels may be grouped according to the type of primary transform / inverse transform kernel. Kernel sets may be classified as follows, and the criteria for classifying the sets may vary with the embodiment.

[0170] <Implementation Method 1>

[0171] S 0 :{DCT-2,DCT-2},S 1 :{DCT-2,IDT},S 2 :{IDT,DCT-2}

[0172] <Implementation Method 2>

[0173] S 0 : {DCT-2, DCT-2}, S 1 : Other kernels

[0174] <Implementation Method 3>

[0175] S 0 : {DCT-2, DCT-2}, S 1 :{DST-7,DST-7},S 2 : Other kernels

[0176] <Implementation Method 4>

[0177] S 0 :{DCT-2,DCT-2},S 1 :{DST-N,DCT-M},{DCT-M,DST-N},

[0178] S 2 : {DCT-N, IDT}, {IDT, DCT-N}, S 3 : Other kernels,

[0179] N, M = {1 and / or 2 and / or, ..., 8}

[0180] <Implementation method 5>

[0181] S 0 :{DCT-2,DCT-2},S 1 :{DST-7,DST-7},S 2 :{DCT-N,IDT},{IDT,DCT-N},

[0182] S 3 : {DST-N, IDT}, {IDT, DST-N}, S 4 : Other kernels,

[0183] N = {1 and / or 2 and / or, ..., 8}

[0184] Here, the other kernels may be a combination of primary transform kernels not included in the previous set among the combinations of primary kernels subjected to secondary transform / inverse transform.

[0185] The C×T set of secondary intra-kernels determined based on the TU size, the intra prediction mode, and the primary inverse transform kernel may include one or more secondary inverse transform kernels. If multiple kernels are included, the secondary inverse transform kernel determiner 614 may parse the LFNST index and may determine the secondary inverse transform kernel in the current set of kernels based on the parsed LFNST index. Thus, as described above, when the secondary inverse transform is applied for a specific primary transform kernel, but when the kernel set includes multiple secondary inverse transform kernels, the transmission of the LFNST index may not be omitted.

[0186] In this case, a LFNST index of 0 means that a secondary inverse transform is not performed, and if Lffnst_idx≥1, a secondary inverse transform may be applied based on the LFNST index.

[0187] Meanwhile, when the secondary inverse transform is applied, the entropy decoder 510 can reconstruct the quantized secondary transform coefficients. Alternatively, the entropy decoder 510 can reconstruct the quantized primary transform coefficients when the secondary inverse transform is not applied. In this case, both the secondary transform coefficients and the primary transform coefficients are data in the form of a two-dimensional matrix.

[0188] The inverse secondary transformer 616 receives the inverse quantized secondary transform coefficients and applies an inverse secondary transform kernel to reconstruct the primary transform coefficients.

[0189] Based on the size and type of the secondary inverse transform kernel, the secondary inverse transformer 616 may generate a secondary transform coefficient vector by packing "q" reconstructed secondary transform coefficients in one dimension according to a scan order. Here, the scanning sequence may be pre-arranged between the video encoding device and the video decoding device. For example, if the size "q" of the secondary inverse transform coefficient is 8 ( Figure 7a )、M×N( Figure 7b ) or 48( Figure 7c ), then we can generate Figures 7a to 7c According to an embodiment, the scanning for generating the sub-transform coefficient vector may be performed in the reverse order.

[0190] exist Figure 7b In the example of , if the size of the sub-transform coefficient vector is 16, then M=N=4, and if the size of the sub-transform coefficient vector is 32, then M=8, N=4, or M=4, N=8.

[0191] exist Figure 7a to Figure 7cIn the example, W tb represents the width of the transform block, and H tb Indicates the height of the transform block.

[0192] The secondary inverse transformer 616 performs an inverse transform by using a matrix product between a secondary transform coefficient vector of size "q" and a secondary inverse transform kernel F of size p×q. As shown in Equation 2, the secondary inverse transformer 616 may perform a secondary inverse transform to generate a primary transform coefficient vector of size p

[0194] [Formula 2]

[0195]

[0196] The secondary inverse transformer 616 may generate a two-dimensional matrix from the primary transform coefficient vector generated according to the secondary inverse transform based on the size of the current TU. Figure 8a to Figure 8b As shown in the example of , based on the size "p" of the primary transform coefficient vector, the primary transform coefficients can be allocated to the upper left side of the TU in a scanning order. Depending on the scanning sequence of the primary transform coefficients for the secondary transform by the video encoding device, the scanning sequence used by the secondary inverse transformer 616 may vary.

[0197] At this time, the video decoding apparatus may derive the transform coefficients of the remaining TU regions where the primary transform coefficients do not exist as zero.

[0198] In one example, when an IDT (identity transform) is applied as a primary transform kernel in a vertical direction or a horizontal direction, the secondary inverse transformer 616 may allocate the primary transform coefficients by considering the direction in which the IDT is applied. The secondary inverse transformer 616 may use the primary transform coefficient vector to allocate a plurality of "p" primary transform coefficients to the primary transform coefficients in the vertical direction or the horizontal direction according to the scanning order. Fig. 9 Here, the scanning sequence may be preset according to the arrangement between the video encoding device and the video decoding device. When the transformation of the IDT is applied in the horizontal direction, p=W tb ×L, and when IDT is performed in the vertical direction, p = L × H tb In this case, the size of "p" may be defined according to the secondary inverse transform kernel determined in the secondary inverse transform kernel determiner 614. Fig. 9 In the example of , the video decoding device may derive the transform coefficients of the remaining TU regions where there are no “p” primary transform coefficients as zero.

[0199] As another example, if the primary transform kernel in the vertical direction is different from the primary transform kernel in the horizontal direction, the scanning sequence for allocating the primary transform coefficient vector within the TU may be determined based on the type of the kernel in the vertical direction and the type of the kernel in the horizontal direction. If the same secondary transform kernel is applied to a block to which the B kernel is applied in the vertical direction and the A kernel is applied in the horizontal direction, and if the same secondary transform kernel is applied to a block to which the A kernel is applied in the vertical direction and the B kernel is applied in the horizontal direction, the secondary inverse transformer 616 may map the primary transform coefficient vector to the transform coefficient of the TU block by first scanning a specific kernel direction, such as Fig.10 as shown in the example.

[0200] The primary inverse transformer 618 may perform primary inverse transform in vertical and horizontal directions with respect to primary transform coefficients allocated as pixel values ​​of the TU block according to secondary inverse transform by using the primary inverse transform kernel determined in the primary inverse transform kernel determiner 610 .

[0201] See now Fig.11 and Fig.12 , describing a method for transforming and inversely transforming a transform block of a current block.

[0202] Fig.11 is a flowchart of a method for transforming a transform block by a video encoding apparatus according to another embodiment of the present invention.

[0203] The video encoding apparatus obtains a residual signal of a transformed block of a current block ( S1100 ).

[0204] The video encoding apparatus determines a primary transform kernel of a transform block in vertical and horizontal directions ( S1102 ).

[0205] The video encoding apparatus determines a secondary transform kernel of the transform block based on the size of the transform block, the intra prediction mode of the current block, and the primary transform kernel (S1104).

[0206] The video encoding device selects a mode set including an intra prediction mode of a current block from a preset mode set. The video encoding device selects a primary kernel set including the primary transform kernel from a preset primary kernel set. The video encoding device selects a kernel size set including the size of the transform block from a preset kernel size set. The video encoding device selects a secondary kernel set according to the selected mode set, the selected primary kernel set, and the selected kernel size set.

[0207] If the set of sub-kernels includes a single sub-kernel, the video encoding device sets the sub-transform kernel to the single sub-kernel.If the set of sub-kernels includes a plurality of sub-kernels, the video encoding device may set the sub-transform kernel to one of the plurality of sub-kernels.

[0208] The video encoding apparatus performs a primary transform by applying a primary transform kernel to the residual signal to generate a primary transform coefficient ( S1106 ).

[0209] The video encoding apparatus performs secondary transform by applying the secondary transform kernel to the primary transform coefficient to generate secondary transform coefficient ( S1108 ).

[0210] Based on the size and type of the secondary transform kernel, the video encoding device generates a primary transform coefficient vector by packing a portion of the primary transform coefficient in one dimension according to a preset scanning sequence. The video encoding device performs a matrix product between the primary transform coefficient vector and the secondary transform kernel to generate the secondary transform coefficient vector. The video decoding device may generate a secondary transform coefficient by allocating the secondary transform coefficient vector according to a scanning sequence preset at the upper left of the transform block.

[0211] Based on the primary transform coefficient and the secondary transform coefficient, the video encoding apparatus determines an LFNST index (S1110). Here, the LFNST index indicates whether the secondary transform is applied.

[0212] In terms of rate-distortion optimization, the video encoding device may determine the value of the LFNST index. For example, if the primary transform coefficient is optimal, the video encoding device may set the LFNST index to 0. On the other hand, if the secondary transform coefficient is optimal, the video encoding device may set the LFNST index according to the number of secondary kernels included in the set of secondary kernels. If the set of secondary kernels includes a single secondary kernel, the video encoding device may set the LFNST index to 1. If the set of secondary kernels includes multiple secondary kernels, the video encoding device may set the LFNST index to indicate one of the multiple secondary kernels.

[0213] The video encoding apparatus encodes the LFNST index ( S1112 ).

[0214] The video encoding apparatus checks the LFNST index ( S1114 ).

[0215] If the LFNST index is 0 (Yes in S1114 ), the video encoding apparatus encodes the primary transform coefficient ( S1116 ). The video encoding apparatus may quantize and entropy encode the primary transform coefficient to generate a bitstream of the primary transform coefficient.

[0216] On the other hand, if the LFNST index is greater than 0 (No in S1114), the video encoding apparatus encodes the secondary transform coefficient (S1118). The video encoding apparatus may quantize and entropy encode the secondary transform coefficient to generate a bitstream of the secondary transform coefficient.

[0217] Fig.12 is a flowchart of a method of inversely transforming a transform block by a video decoding apparatus according to at least one embodiment of the present invention.

[0218] The video decoding apparatus determines a primary inverse transform kernel in a vertical direction and a horizontal direction for a transform block of a current block ( S1200 ).

[0219] The video decoding apparatus decodes an LFNST index from a bitstream (S1202). Here, the LFNST index indicates whether a secondary inverse transform is applied.

[0220] The video decoding apparatus checks the LFNST index ( S1204 ).

[0221] If the LFNST index is 0 (Yes in S1204 ), the video decoding apparatus performs the following steps ( S1206 and S1208 ).

[0222] The video decoding apparatus obtains an inverse-quantized primary transform coefficient for the transform block (S1206).

[0223] The video decoding apparatus performs a primary inverse transform by applying a primary inverse transform kernel to a primary transform coefficient to generate a residual signal ( S1208 ).

[0224] If the LFNST index is greater than 0 (No in S1204 ), the video decoding apparatus performs the following steps ( S1220 to S1224 , S1208 ).

[0225] The video decoding apparatus obtains a sub-transform coefficient for inverse quantization of the transform block (S1220).

[0226] The video decoding apparatus determines a secondary inverse transform kernel of the transform block based on the size of the transform block, the intra prediction mode of the current block, and the primary inverse transform kernel (S1222).

[0227] The video decoding device selects a mode set including an intra prediction mode of a current block from a preset mode set. The video decoding device selects a primary kernel set including a primary inverse transform kernel from a preset set of primary kernels. The video decoding device selects a kernel size set including a size of the transform block from the preset kernel size set. The video decoding device selects a secondary kernel set according to the selected mode set, the selected primary kernel set, and the selected kernel size set.

[0228] If the secondary kernel set includes one secondary kernel, the video decoding device sets the secondary transform kernel to the one secondary kernel. In this case, the LFNST index may be decoded as 1. If the secondary kernel set includes multiple secondary kernels, the video decoding device may set the secondary transform kernel to the secondary kernel indicated by the LFNST index.

[0229] The video decoding apparatus performs secondary inverse transform by applying a secondary inverse transform kernel to secondary transform coefficients to generate primary transform coefficients ( S1224 ).

[0230] Based on the size and type of the secondary inverse transform kernel, the video decoding apparatus generates a secondary transform coefficient vector by packing a portion of the secondary transform coefficients in one dimension according to a preset scanning order. The video decoding apparatus performs a matrix product between the secondary transform coefficient vector and the secondary inverse transform kernel to generate a primary transform coefficient vector. The video decoding apparatus may generate the primary transform coefficient by allocating the primary transform coefficient vector according to a scanning sequence preset at the upper left of the transform block.

[0231] The video decoding apparatus performs a primary inverse transform by applying a primary inverse transform kernel to a primary transform coefficient to generate a residual signal ( S1208 ).

[0232] The video decoding device may then sum the residual signal with the prediction block for the current block to generate a reconstructed block for the current block.

[0233] Although the steps in each flowchart are described as being performed sequentially, these steps are merely illustrative of the technical concepts of some embodiments of the present disclosure. Therefore, a person of ordinary skill in the art to which the present disclosure belongs can perform the steps by changing the order described in each figure or by performing two or more steps in parallel. Therefore, the steps in each flowchart are not limited to the time series order shown.

[0234] It should be understood that the above description presents illustrative embodiments that can be implemented in various other ways. The functions described in some embodiments can be implemented by hardware, software, firmware and / or a combination thereof. It should also be understood that the functional components described in this disclosure are marked with "... units" to strongly emphasize the possibility of their independent implementation.

[0235] At the same time, the various methods or functions described in some embodiments may be implemented as instructions stored in a non-transitory recording medium that can be read and executed by one or more processors. For example, the non-transitory recording medium may include various types of recording devices, in which data is stored in a form readable by a computer system. For example, the non-transitory recording medium may include a storage medium such as an erasable programmable read-only memory (EPROM), a flash drive, an optical drive, a magnetic hard drive, and a solid-state drive (SSD).

[0236] Although the embodiments of the present disclosure have been described for illustrative purposes, however, those of ordinary skill in the art to which the present disclosure belongs should recognize that various modifications, additions, and substitutions are possible without departing from the concept and scope of the present disclosure. Therefore, for the sake of brevity and clarity, the embodiments of the present disclosure have been described. The scope of the technical concept of the embodiments of the present disclosure is not limited by the diagrams. Therefore, those of ordinary skill in the art to which the present disclosure belongs should understand that the scope of the present disclosure should not be limited by the embodiments explicitly described above, but by the claims and their equivalents.

[0237] (reference number)

[0238] 140 Converter

[0239] 165 Inverter

[0240] 530 Inverter

[0241] 610 Primary Inverse Transform Kernel Determiner

[0242] 612 Secondary inverse transform process determiner

[0243] 614 Secondary Inverse Transform Kernel Determiner

[0244] 616 Secondary Inverter

[0245] 618 Primary Inverter

[0246] CROSS-REFERENCE TO RELATED APPLICATIONS

[0247] This application claims priority to and the benefit of Korean Patent Application No. 10-2022-0108550, filed on August 29, 2022, and Korean Patent Application No. 10-2023-0097617, filed on July 26, 2023, the entire contents of each of which are incorporated herein by reference.

Claims

1. A method for reconstructing a current block by a video decoding device, the method comprising: Determine a primary inverse transform kernel in a vertical direction and a horizontal direction for a transform block of the current block; Obtaining inverse quantized secondary transform coefficients of the transform block; determining a secondary inverse transform kernel for the transform block based on a size of the transform block, an intra prediction mode of the current block, and the primary inverse transform kernel; performing an inverse secondary transform by applying the inverse secondary transform kernel to the secondary transform coefficients to generate primary transform coefficients; and A primary inverse transform is performed by applying the primary inverse transform kernel to the primary transform coefficients to generate a residual signal.

2. The method according to claim 1, further comprising: decoding a low frequency non-separable transform index (LFNST index) from a bitstream, the low frequency non-separable transform index indicating whether the secondary inverse transform is to be applied; and Check the LFNST index, If the LFNST index is greater than 0, a process of obtaining the secondary transform coefficient or a process of performing the secondary inverse transform is performed.

3. The method according to claim 2, further comprising, when the LFNST index is 0: Obtaining inverse quantized primary transform coefficients of the transform block; and The primary inverse transform kernel is determined and the primary inverse transform process is performed.

4. The method according to claim 1, wherein: Determining the primary inverse transform kernel comprises: decoding an index indicating the primary inverse transform kernel; and The primary inverse transform kernel is set according to the index.

5. The method according to claim 4, wherein: The primary inverse transform kernel is characterized in that the kind of the transform kernel indicated by the index is predefined based on the intra prediction mode of the current block and the size of the transform block.

6. The method according to claim 2, wherein: Determining the secondary inverse transform kernel comprises: Selecting a mode set including the intra prediction mode of the current block from among preset mode sets; and A primary kernel set including the primary inverse transform kernel is selected from among preset primary kernel sets.

7. The method according to claim 6, wherein: Determining the secondary inverse transform kernel further comprises: Selecting a kernel size set including the size of the transform block from among a preset kernel size set; and A secondary kernel set is selected based on the selected mode set, the selected primary kernel set, and the selected kernel size set.

8. The method according to claim 7, wherein: Determining the secondary inverse transform kernel comprises: When the set of secondary kernels includes a single secondary kernel, the inverse secondary transform kernel is set by the single secondary kernel.

9. The method according to claim 7, wherein: Determining the secondary inverse transform kernel comprises: When the secondary kernel set includes a plurality of secondary kernels, the secondary inverse transform kernel is set by a secondary kernel indicated by the LFNST index.

10. The method according to claim 1, wherein: Performing the secondary inverse transform comprises: generating a secondary transform coefficient vector by one-dimensionally packing a portion of the secondary transform coefficients according to a predetermined first scanning order based on a size and a type of the secondary inverse transform kernel; generating a primary transform coefficient vector by performing a matrix product between the secondary transform coefficient vector and the secondary inverse transform kernel; and The primary transform coefficients are generated by allocating the primary transform coefficient vector at the upper left of the transform block according to a preset second scanning sequence.

11. The method according to claim 10, wherein: Generating the primary transform coefficients comprises: When an identity transform IDT is applied as the primary transform kernel in a horizontal direction or a vertical direction with respect to the transform block, the primary transform coefficient vector is allocated by considering a direction in which the IDT is applied.

12. The method according to claim 10, wherein: Generating the primary transform coefficients comprises: When the primary transform kernels for each of the vertical and horizontal directions are different, the primary transform coefficient vectors are allocated for the transform block by first scanning the direction of a specific primary transform kernel.

13. A method for encoding a current block by a video encoding device, the method comprising: Obtaining a residual signal of a transformed block of the current block; Determining a primary transform kernel in a vertical direction and a horizontal direction for the transform block; determining a secondary transform kernel for the transform block based on a size of the transform block, an intra prediction mode of the current block, and a primary inverse transform kernel; performing a primary transform by applying the primary transform kernel to the residual signal to generate primary transform coefficients; and A secondary transform is performed by applying the secondary transform kernel to the primary transform coefficients to generate secondary transform coefficients.

14. The method according to claim 12, further comprising: determining a low frequency non-separable transform index (LFNST index) based on the primary transform coefficient and the secondary transform coefficient, the low frequency non-separable transform index indicating application of a secondary transform; and The LFNST index is encoded.

15. The method according to claim 13, further comprising: Check LFNST index; and The primary transform coefficient is encoded when the LFNST index is 0, and the secondary transform coefficient is encoded when the LFNST index is greater than 0.

16. A computer-readable recording medium storing a bit stream generated by a video encoding method, the video encoding method comprising: Obtaining a residual signal of a transformed block of a current block; determining a primary transform kernel in vertical and horizontal directions relative to the transform block; determining a secondary transform kernel for the transform block based on a size of the transform block, an intra prediction mode of the current block, and a primary inverse transform kernel; performing a primary transform by applying the primary transform kernel to the residual signal to generate primary transform coefficients; as well as A secondary transform is performed by applying the secondary transform kernel to the primary transform coefficients to generate secondary transform coefficients.

Citation Information

Patent Citations

  • Moisturizing composition containing metal aminoclay nanoparticles and Opuntia humifusa extract

    KR1020220108550A

  • Method for performing exposure notification service in bluetooth and apparatus supporting the same

    KR1020230097617A