Video decoding method and device

The video decoding method addresses the challenge of determining the primary transform type by using a multiple transform set (MTS) based on block dimensions, resulting in optimized inverse transformation and enhanced compression performance.

JP7656110B2Active Publication Date: 2025-04-02SAMSUNG ELECTRONICS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024025878
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-11-25
Filing Date
2024-02-22
Publication Date
2025-04-02
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

Existing video coding technologies face challenges in efficiently determining the type of primary transform during the decoding process, especially with the increasing complexity of high-resolution and high-quality video data.

Method used

A video decoding method that determines whether a multiple transform set (MTS) is applicable to a block, obtains information about the block's width and height, and based on this information, determines the conversion type for the block to perform an optimized inverse transformation.

Benefits of technology

This method allows for justified inverse transformation based on specific conditions, leading to improved compression performance by applying the optimized conversion type during decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007656110000007
    Figure 0007656110000007
  • Figure 0007656110000008
    Figure 0007656110000008
  • Figure 0007656110000009
    Figure 0007656110000009
Patent Text Reader

Abstract

To provide a method and a device for video decoding by applying a transform type optimized to a target block.SOLUTION: A video decoding method comprises the steps of: acquiring a parameter indicating whether a multiple-transform set (MTS) is applicable to a block to be decoded, as well as information about a width of the block to be decoded and a height of the block to be decoded; determining a transform type of the block to be decoded on the basis of the parameter indicating whether a multiple-transform set is applicable and / or the information about the width and the height of the block to be decoded, and setting a zero-out region of the block to be decoded; and inverse-transforming the block to be decoded on the basis of the zero-out region of the block to be decoded and the result of determining the transform type.SELECTED DRAWING: Figure 10
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a video coding technology, and more particularly, to a method for determining a type of primary transform of a block to be decoded during a video decoding process. [Background technology]

[0002] Recently, the demand for high-resolution, high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images is increasing in various fields. As the resolution and quality of image data increases, the amount of information or bits to be transmitted increases relatively compared to existing image data, and therefore, when the image data is stored using a medium such as an existing wired or wireless broadband line, the transmission cost and storage cost increase.

[0003] Since the establishment of the High Efficiency Video Coding (HEVC) video codec in 2013, the spread of 4K and 8K video images and virtual reality services has led to the standardization of Versatile Video Coding (VVC), a next-generation video codec that aims to improve performance by more than twice that of HEVC. Standardization work is currently underway. VVC is being developed by the Joint Video Exploration Team (JVET), a joint effort of the ISO / ICE Moving Picture Experts Group (MPEG) and the ITU-T Video Coding Experts Group (VCEG), which are video coding standardization groups, with the goal of improving coding compression performance by more than twice that of HEVC. A call for proposal for VVC standardization was announced at the 121st Gwangju MPEG and 9th JVET meetings in January 2018, and full-scale video standardization began with a total of 23 organizations proposing video codec technologies at the 122nd San Diego MPEG and 10th JVET meetings. At the 122nd MPEG and 10th JVET meetings, technical reviews, objective compression performance, and subjective image quality evaluations were conducted on the video codec technologies proposed by each organization, and some of the many technologies were adopted to announce Working Draft (WD) 1.0 and video reference software VTM (VVC Test Mode) 1.0. After the 127th MPEG and 15th JVET meetings ended in July 2019, the Committee Draft (CD) of the VVC standard was completed, and standardization is currently underway with the goal of establishing the Final Draft International Standard (FDIS) in October 2020.

[0004] Conventionally, HEVC's coding structure is hierarchically divided by a quadtree, but VVC adopts a divided block structure combining QTBT (Quadtree Binary Tree) and TT (Ternary Tree). This allows prediction residual signals to be generated or processed more flexibly than HEVC, and provides improved compression performance compared to HEVC. In addition to this basic block structure, new technologies not used in existing codecs, such as Adaptive Loop Filter (ALF) technology, Affine Motion Prediction (AMP) technology as a motion prediction technology, and Decoder-side Motion Vector Refinement (DMVR) technology, are adopted as standard technologies. As a transform and quantization technology, DCT-II, a transform kernel that has been widely used in existing video codecs, continues to be used, and the size of the applied block has been changed to be applicable to a larger block size. In addition, the DST-7 kernel, which has been applied to small transform blocks such as 4x4 in the existing HEVC, has been expanded to larger transform blocks, and a new transform kernel, DCT-8, has been added as a transform kernel.

[0005] On the other hand, in the HEVC standard, when encoding or decoding video, conversion is performed using one transform type, so there was no need to transmit information regarding the transform type for the video. However, in the new technology, multiple transform selection using DCT-II, DCT-8, and DCT-7 can be applied, so there is a demand for technology to define whether to apply MTS when decoding and what primary transform type is applied. Summary of the Invention [Problem to be solved by the invention]

[0006] The technical problem to be solved by the present invention is to perform an inverse transformation in a predetermined manner under specific conditions.

[0007] Another technical object of the present invention is to perform decoding by applying a transform type optimized for a block to be decoded. [Means for solving the problem]

[0008] According to one aspect of the present invention, there is provided a video decoding method performed by a video decoding device, the video decoding method including the steps of: acquiring information on a parameter indicating whether a multiple transform set (MTS) for a block to be decoded is applicable, a width of the block to be decoded, and a height of the block to be decoded; determining a transform type of the block to be decoded based on at least one of the parameter indicating whether a multiple transform set for the block to be decoded is applicable, the width of the block to be decoded, and the height of the block to be decoded; setting a zero-out region of the block to be decoded based on at least one of the parameter indicating whether a multiple transform set for the block to be decoded is applicable, the width of the block to be decoded, and the height of the block to be decoded; and performing an inverse transform on the block to be decoded based on a result of the determination on the zero-out region and the transform type of the block to be decoded.

[0009] According to another aspect of the present invention, in the step of determining the transformation type of the block to be decoded, if at least one of the width or height of the block to be decoded has a value greater than 32, it is determined that the block to be decoded has been transformed using a default transformation.

[0010] According to yet another aspect of the present invention, in the step of setting a zero-out area of ​​the block to be decoded, if one of the width or height of the block to be decoded has a value greater than 32, the area in which the width or height of the block to be decoded is greater than 32 is set as the zero-out area.

[0011] According to still another aspect of the present invention, the parameter indicating whether or not a multiple transform set is applicable to the block to be decoded is sps_mts_enabled_flag.

[0012] According to another aspect of the present invention, there is provided a video decoding method performed by a video decoding device, the video decoding method including the steps of: acquiring at least one of information on whether a multiple transform set is applied to a block to be decoded, information on a prediction mode, information on whether a secondary transform is applied, information on whether a prediction using a matrix is ​​applied, and information on a size of the block to be decoded; determining whether an implicit multiple transform set is applied to the block to be decoded based on at least one of information on whether a multiple transform set is applied to the block to be decoded, information on a prediction mode, information on whether a secondary transform is applied, and information on whether a prediction using a matrix is ​​applied; acquiring information on a transform type based on information on whether an implicit multiple transform set is applied to the block to be decoded and information on the size of the block to be decoded; and performing an inverse transform based on the information on the transform type.

[0013] According to another aspect of the present invention, the step of determining whether the implicit multiple transform set is applied determines whether the implicit multiple transform set is applied using information regarding whether a multiple transform set is applied to the block to be decoded, information regarding a prediction mode, information regarding whether a secondary transform is applied, and information regarding whether prediction using a matrix is ​​applied.

[0014] According to yet another aspect of the invention, the set of implicit multiple transforms includes one default transform and at least one extra transform.

[0015] According to yet another aspect of the present invention, the step of obtaining information regarding the transform type based on information regarding the size of the block to be decoded includes, when the horizontal axis lengths of the block to be decoded are all greater than or equal to 4 and less than or equal to 16, applying at least one of extra transform types to the block to be decoded in the horizontal axis direction.

[0016] According to yet another aspect of the present invention, the step of acquiring information regarding the transformation type based on information regarding the size of the block to be decoded includes, when the vertical axis lengths of the blocks to be decoded are all greater than or equal to 4 and less than or equal to 16, applying at least one of the additional transformation types to the blocks to be decoded in the vertical axis direction.

[0017] According to still another aspect of the present invention, the information on whether a multiple transform set is applied to the block to be decoded includes at least one of sps_mts_enabled_flag and sps_explicit_mts_intra_enabled_flag.

[0018] According to yet another aspect of the present invention, the information on the prediction mode includes CuPredMode.

[0019] According to yet another aspect of the present invention, the information regarding whether the secondary transformation is applied includes lfnst_idx.

[0020] According to yet another aspect of the present invention, the information on whether prediction using the matrix is ​​applied includes intra_mip_flag.

[0021] According to still another aspect of the present invention, the information on the transformation type of the block to be decoded includes information on a horizontal axis transformation type and information on a vertical axis transformation type.

[0022] According to yet another aspect of the present invention, the step of determining whether an implicit multiple transform set is applied to the block to be decoded is obtained by further checking whether the block to be decoded is a luma block.

[0023] According to yet another aspect of the present invention, there is provided a video decoding device including a memory and at least one processor, the video decoding device including at least one processor including an inverse transform unit that acquires at least one of information on whether a multiple transform set is applied to a block to be decoded, information on a prediction mode, information on whether a secondary transform is applied, information on whether a prediction using a matrix is ​​applied, and information on a size of the block to be decoded, determines whether an implicit multiple transform set is applied to the block to be decoded based on at least one of information on whether a multiple transform set is applied to the block to be decoded, information on the prediction mode, information on whether a secondary transform is applied, and information on whether a prediction using a matrix is ​​applied, acquires information on a transform type based on information on whether an implicit multiple transform set is applied to the block to be decoded and information on the size of the block to be decoded, and performs an inverse transform based on the information on the transform type. Effect of the Invention

[0024] According to the present invention, the inverse transformation can be performed in a predetermined manner under specific conditions.

[0025] Moreover, by performing decoding by applying a transform type optimized for the block to be decoded, it is possible to expect an improvement in compression performance. [Brief description of the drawings]

[0026] [Figure 1]1 is a diagram illustrating a schematic configuration of a video encoding device to which the present invention is applied. [Diagram 2] FIG. 1 is a diagram showing an example of a video encoding method performed by a video encoding device. [Diagram 3] 1 is a diagram illustrating a schematic configuration of a video decoding device to which the present invention is applied. [Figure 4] FIG. 2 is a diagram showing an example of a video decoding method performed by a decoding device. [Diagram 5] FIG. 2 illustrates the scan order of sub-blocks and coefficients for a diagonal scan scheme. [Figure 6] FIG. 13 is a diagram illustrating an example of a 32×32 coding target block after quantization. [Figure 7] FIG. 2 is a diagram showing the remaining zero-out region excluding m×n in the region of an M×N block to be decoded. [Figure 8] FIG. 2 illustrates a method for determining whether to apply an implicit MTS feature according to an embodiment of the present invention. [Figure 9] A diagram showing a method for deriving transformation information according to the width and height of the block of an implicit MTS in accordance with one embodiment of the present invention. [Figure 10] FIG. 2 illustrates a method for performing an inverse transformation based on transformation-related parameters according to an embodiment of the present invention. [Figure 11] FIG. 13 is a diagram showing a valid MTS area marked with a thick line within a 32×32 block to be decoded. [Figure 12] FIG. 2 illustrates a method for determining a valid MTS according to an embodiment of the present invention. [Figure 13] FIG. 13 illustrates a method for determining a valid MTS according to another embodiment of the present invention. [Figure 14] FIG. 13 is a diagram illustrating a method for determining a valid MTS according to another embodiment of the present invention. [Figure 15] FIG. 2 illustrates a method for determining whether to apply an explicit MTS feature according to an embodiment of the present invention. [Figure 16]FIG. 13 illustrates a method for performing an inverse transformation based on transformation-related parameters according to another embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0027] Since the present invention may be modified in various ways and may have various embodiments, a specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit the present invention to a specific embodiment. The terms used in this specification are merely used to describe a specific embodiment and are not intended to limit the technical idea of ​​the present invention. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, the terms "include" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0028] Meanwhile, each component in the drawings described in the present invention is shown independently for the convenience of describing separate characteristic functions, and does not mean that each component is realized by separate hardware or software. For example, two or more components among the components may be combined to form one component, or one component may be divided into multiple components. An embodiment in which each component is integrated and / or separated is also included in the scope of the present invention as long as it does not deviate from the essence of the present invention.

[0029] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following, the same reference numerals are used to refer to the same components in the drawings, and duplicated descriptions of the same components will be omitted.

[0030] Meanwhile, the present invention relates to video / image coding. For example, the methods / embodiments disclosed in the present invention may be applied to methods disclosed in the versatile video coding (VVC) standard, the essential video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the second generation of audio video coding standard (AVS2), or the next generation video / image coding standard (e.g., H.267, H.268, etc.).

[0031] In this specification, a picture generally means a unit showing one image in a specific time period, and a slice is a unit constituting a part of a picture in coding. One picture may be composed of multiple slices, and pictures and slices may be mixed together as necessary.

[0032] A pixel or a pel may mean the smallest unit that constitutes one picture (or image). A term corresponding to a pixel may be "sample." A sample may generally indicate a pixel or a pixel value, or may indicate only a pixel / pixel value of a luma component, or may indicate only a pixel / pixel value of a chroma component.

[0033] A unit refers to a basic unit of video processing. A unit may include at least one of a specific region of a picture and information about the region. A unit may be mixed with terms such as a block or an area depending on the case. In a general case, an M×N block may refer to a set of samples or transform coefficients consisting of M columns and N rows.

[0034] FIG. 1 is a diagram illustrating a schematic configuration of a video encoding device to which the present invention is applied.

[0035] 1, a video encoding device 100 may include a picture division unit 105, a prediction unit 110, a residual processing unit 120, an entropy encoding unit 130, an adder 140, a filter unit 150, and a memory 160. The residual processing unit 120 may include a subtraction unit 121, a transform unit 122, a quantization unit 123, a realignment unit 124, an inverse quantization unit 125, and an inverse transformation unit 126.

[0036] The picture division unit 105 divides an input picture into at least one processing unit.

[0037] As an example, the processing unit may be called a coding unit (CU). In this case, the coding unit may be recursively divided from a coding tree unit (CTU) according to a quad-tree binary-tree (QTBT) structure. For example, one coding unit may be divided into a plurality of nodes at a deeper depth based on a quad-tree structure and / or a binary tree structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure may be applied later. Alternatively, the binary tree structure may be applied first. A coding procedure according to the present invention may be performed based on the final coding unit that is not further divided. In this case, based on coding efficiency according to image characteristics, the largest coding unit may be immediately used as the final coding unit, or the coding unit may be recursively divided into coding units at a lower depth as necessary, and a coding unit with an optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later.

[0038] As another example, the processing unit may include a coding unit (CU), a prediction unit (PU), or a transform unit (TU). The coding units may be split into lower depth coding units from a largest coding unit (LCU) according to a quad tree structure. In this case, the largest coding unit may be used as a final coding unit immediately based on coding efficiency according to image characteristics, or the coding unit may be recursively further split into lower depth coding units as necessary, and a coding unit with an optimal size may be used as a final coding unit. When a smallest coding unit (SCU) is set, the coding unit is not split into coding units smaller than the smallest coding unit. Here, the final coding unit refers to a coding unit that is a base for partitioning or splitting into prediction units or transform units. The prediction unit is a unit partitioned from the coding unit and may be a unit of sample prediction. In this case, the prediction unit may be divided into subblocks. The transform unit may be divided from the coding unit according to a quad tree structure, and may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients. Hereinafter, the coding unit may be referred to as a coding block (CB), the prediction unit may be referred to as a prediction block (PB), and the transform unit may be referred to as a transform block (TB). A prediction block or a prediction unit refers to a specific region in a block form within a picture, and may include an array of prediction samples.A transform block or transform unit also refers to a specific region in block form within a picture and may contain an array of transform coefficients or residual samples.

[0039] The prediction unit 110 performs prediction on a current block to be processed (hereinafter, referred to as a current block) and generates a predicted block including a prediction sample for the current block. The unit of prediction performed by the prediction unit 110 may be a coding block, a transform block, or a prediction block.

[0040] The prediction unit 110 determines whether intra prediction or inter prediction is applied to the current block. For example, the prediction unit 110 determines whether intra prediction or inter prediction is applied on a CU basis.

[0041] In the case of intra prediction, the prediction unit 110 may derive a prediction sample for the current block based on a reference sample outside the current block in a picture to which the current block belongs (hereinafter, referred to as a current picture). In this case, the prediction unit 110 may (i) derive a prediction sample based on an average or an interpolation of neighboring reference samples of the current block, or (ii) derive the prediction sample based on a reference sample that exists in a specific (prediction) direction with respect to the prediction sample among the neighboring reference samples of the current block. The case (i) is called a non-directional mode or a non-angular mode, and the case (ii) is called a directional mode or an angular mode. Prediction modes in intra prediction may include, for example, 33 directional prediction modes and at least two non-directional modes. The non-directional modes may include a DC prediction mode and a planar mode. The prediction unit 110 may determine a prediction mode applied to the current block using a prediction mode applied to a neighboring block.

[0042] In the case of inter prediction, the prediction unit 110 may derive a prediction sample for the current block based on a sample specified by a motion vector on a reference picture. The prediction unit 110 may derive a prediction sample for the current block by applying any one of a skip mode, a merge mode, and a motion vector prediction (MVP) mode. In the case of the skip mode and the merge mode, the prediction unit 110 may use motion information of a neighboring block as motion information of the current block. In the case of the skip mode, unlike the merge mode, a difference (residual) between a prediction sample and an original sample is not transmitted. In the case of the MVP mode, a motion vector of a neighboring block may be used as a motion vector predictor, and a motion vector of the current block may be induced by using the motion vector of the neighboring block as a motion vector predictor.

[0043] In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks in the current picture and temporal neighboring blocks in a reference picture. The reference picture including the temporal neighboring blocks may be called a collocated picture (colPic). The motion information may include a motion vector and a reference picture index. Information such as prediction mode information and motion information may be (entropy) encoded and output in the form of a bitstream.

[0044] When motion information of temporally neighboring blocks is used in skip mode and merge mode, the top picture on a reference picture list may be used as a reference picture. Reference pictures included in a reference picture list may be ordered based on a difference in picture order count (POC) between the current picture and the reference picture. POC corresponds to a display order of pictures and may be distinguished from a coding order.

[0045] The subtractor 121 generates a residual sample, which is the difference between the original sample and the predicted sample. When the skip mode is applied, it is not necessary to generate the residual sample, as described above.

[0046] The transform unit 122 transforms the residual samples in units of transform blocks to generate transform coefficients. The transform unit 122 may perform the transform according to the size of the transform block and the prediction mode applied to the coding block or the predictive block that spatially overlaps with the transform block. For example, if intra prediction is applied to the coding block or the predictive block that overlaps with the transform block and the transform block is a 4×4 residual array, the residual samples are transformed using a Discrete Sine Transform (DST) transform kernel, and otherwise, the residual samples are transformed using a Discrete Cosine Transform (DCT) transform kernel.

[0047] The quantization unit 123 quantizes the transform coefficients to generate quantized transform coefficients.

[0048] The rearrangement unit 124 rearranges the quantized transform coefficients. The rearrangement unit 124 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form by a coefficient scanning method. Here, the rearrangement unit 124 has been described as a separate configuration, but may be a part of the quantization unit 123.

[0049] The entropy encoding unit 130 performs entropy encoding on the quantized transform coefficients. The entropy encoding may include encoding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoding unit 130 may encode information required for video restoration (e.g., syntax element values, etc.) together with or separately from the quantized transform coefficients. The entropy encoded information may be transmitted or stored in the form of a bitstream in network abstraction layer (NAL) unit units.

[0050] The inverse quantization unit 125 inverse quantizes the values ​​quantized by the quantization unit 123 (quantized transformation coefficients), and the inverse transform unit 126 inverse transforms the values ​​inverse quantized by the inverse quantization unit 125 to generate residual samples.

[0051] The adder 140 combines the residual samples and the prediction samples to reconstruct a picture. The residual samples and the prediction samples are added in units of blocks to generate reconstructed blocks. Here, the adder 140 has been described as a separate configuration, but may be a part of the prediction unit 110. Meanwhile, the adder 140 may also be referred to as a reconstruction unit or a reconstructed block generation unit.

[0052] The filter unit 150 may apply a deblocking filter and / or a sample adaptive offset to the reconstructed picture. By the deblocking filtering and / or the sample adaptive offset, artifacts at block boundaries in the reconstructed picture and distortion in the quantization process may be corrected. The sample adaptive offset may be applied on a sample-by-sample basis or may be applied after the deblocking filtering process is completed. The filter unit 150 may also apply an adaptive loop filter (ALF) to the reconstructed picture. The ALF may be applied to the reconstructed picture after the deblocking filter and / or the sample adaptive offset are applied.

[0053] The memory 160 stores a reconstructed picture (decoded picture) or information required for encoding / decoding. Here, the reconstructed picture may be a reconstructed picture for which a filtering procedure has been completed by the filter unit 150. The stored reconstructed picture may be used as a reference picture for (inter) prediction of another picture. For example, the memory 160 may store (reference) pictures used for inter prediction. In this case, the pictures used for inter prediction may be specified by a reference picture set or a reference picture list.

[0054] FIG. 2 illustrates an example of a video encoding method performed by a video encoding device. Referring to FIG. 2, the video encoding method may include block partitioning, intra / inter prediction, transform, quantization, and entropy encoding processes. For example, a current picture may be divided into a plurality of blocks, a prediction block of a current block may be generated by intra / inter prediction, and a residual block of the current block may be generated by subtracting an input block of the current block from the prediction block. Then, a coefficient block, i.e., a transform coefficient of the current block may be generated by transforming the residual block. The transform coefficient may be quantized and entropy encoded and stored in a bitstream.

[0055] FIG. 3 is a diagram for explaining the outline of the configuration of a video decoding device to which the present invention is applied.

[0056] 3, the video decoding apparatus 300 may include an entropy decoding unit 310, a residual processing unit 320, a prediction unit 330, an adder 340, a filter unit 350, and a memory 360. Here, the residual processing unit 320 may include a realignment unit 321, an inverse quantization unit 322, and an inverse transform unit 323.

[0057] When a bitstream including video information is input, the video decoding device 300 can restore the video corresponding to the process by which the video information was processed in the video encoding device.

[0058] For example, the video decoding device 300 may perform video decoding using a processing unit applied in a video encoding device. Thus, a processing unit block of the video decoding may be a coding unit as an example, or may be a coding unit, a prediction unit, or a transform unit as another example. The coding units may be divided from the largest coding unit into a quad tree structure and / or a binary tree structure.

[0059] A prediction unit and a transform unit may also be used depending on the case, in which case the prediction block may be a block derived or partitioned from the coding unit and may be a unit of sample prediction. In this case, the prediction unit may be divided into sub-blocks. The transform unit may be divided from the coding unit by a quadtree structure and may be a unit for deriving transform coefficients or a unit for deriving a residual signal from the transform coefficients.

[0060] The entropy decoding unit 310 parses the bitstream and outputs information required for video reconstruction or picture reconstruction. For example, the entropy decoding unit 310 may decode information in the bitstream based on a coding method such as Exponential Golomb Coding, CAVLC, or CABAC, and output values ​​of syntax elements required for video reconstruction and quantized values ​​of transform coefficients for residuals.

[0061] More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element in a bitstream, determines a context model using information on the syntax element to be decoded and decoding information on adjacent and blocks to be decoded or information on symbols / bins decoded in a previous step, predicts the occurrence probability of the bins according to the determined context model, and performs arithmetic decoding of the bins to generate symbols corresponding to the values ​​of each syntax element. In this case, the CABAC entropy decoding method can update the context model using information on the decoded symbols / bins for the context model of the next symbol / bin after determining the context model.

[0062] Among the information decoded by the entropy decoding unit 310, prediction information is provided to the prediction unit 330, and the residual values ​​entropy decoded by the entropy decoding unit 310, i.e., the quantized transform coefficients, are input to the reordering unit 421.

[0063] The rearrangement unit 321 rearranges the quantized transform coefficients in a two-dimensional block form. The rearrangement unit 321 may perform rearrangement in response to coefficient scanning performed in the encoding device. Here, the rearrangement unit 321 has been described as a separate configuration, but may be a part of the inverse quantization unit 322.

[0064] The inverse quantization unit 322 may inversely quantize the quantized transform coefficients based on the (inverse) quantization parameter to output the transform coefficients. In this case, information for deriving the quantization parameter may be signaled from an encoding device.

[0065] An inverse transform unit 323 may inverse transform the transform coefficients to derive residual samples.

[0066] The prediction unit 330 may perform prediction on a current block and generate a predicted block including prediction samples for the current block. The unit of prediction performed by the prediction unit 330 may be a coding block, a transform block, or a prediction block.

[0067] The prediction unit 330 determines whether to apply intra prediction or inter prediction based on the information on the prediction. At this time, the unit for determining which of intra prediction and inter prediction to apply is different from the unit for generating a prediction sample. In addition, the unit for generating a prediction sample is also different in inter prediction and intra prediction. For example, which of inter prediction and intra prediction to apply can be determined in units of CU. Also, for example, in inter prediction, a prediction mode may be determined in units of PU to generate a prediction sample, and in intra prediction, a prediction mode may be determined in units of PU to generate a prediction sample.

[0068] In the case of intra prediction, the prediction unit 330 may derive a prediction sample for the current block based on adjacent reference samples in the current picture. The prediction unit 330 may derive a prediction sample for the current block by applying a directional mode or a non-directional mode based on adjacent reference samples of the current block. In this case, a prediction mode to be applied to the current block may be determined using the intra prediction mode of the adjacent block. Meanwhile, MIP (Matrix-based Intra Prediction) that performs prediction based on a pre-trained matrix may be used. In this case, the number of MIP modes and the size of the matrix are defined for each block size, and the reference sample is downsampled according to the size of the matrix, and then multiplied by a matrix determined according to the mode number, and interpolated according to the size of the prediction block to generate a prediction value.

[0069] In the case of inter prediction, the prediction unit 330 may derive a prediction sample for the current block based on a sample identified on the reference picture by a motion vector on the reference picture. The prediction unit 330 may derive a prediction sample for the current block by applying any one of a skip mode, a merge mode, and an MVP mode. In this case, motion information required for inter prediction of the current block provided from the video encoding device, such as information on a motion vector, a reference picture index, etc., may be obtained or induced based on information on the prediction.

[0070] In the case of the skip mode and the merge mode, the motion information of the neighboring blocks may be used as the motion information of the current block, where the neighboring blocks may include spatial neighboring blocks and temporal neighboring blocks.

[0071] The prediction unit 330 may construct a merge candidate list with the motion information of available neighboring blocks, and use information indicated by a merge index on the merge candidate list as a motion vector of the current block. The merge index may be signaled from an encoding device. The motion information may include a motion vector and a reference picture. In the skip mode and the merge mode, when the motion information of the temporal neighboring blocks is used, the top picture on the reference picture list may be used as a reference picture.

[0072] In skip mode, unlike merge mode, the difference (residual) between the predicted samples and the original samples is not transmitted.

[0073] In the MVP mode, a motion vector of a current block may be derived using a motion vector of a neighboring block as a motion vector predictor, where the neighboring block may include a spatial neighboring block and a temporal neighboring block.

[0074] For example, when a merge mode is applied, a merge candidate list may be generated using the motion vectors of the reconstructed spatial neighboring blocks and / or the motion vector corresponding to the Col block, which is a temporal neighboring block. In the merge mode, a motion vector of a candidate block selected from the merge candidate list is used as the motion vector of the current block. The prediction information may include a merge index indicating a candidate block having an optimal motion vector selected from among the candidate blocks included in the merge candidate list. In this case, the prediction unit 330 may derive a motion vector of the current block using the merge index.

[0075] As another example, when a Motion Vector Prediction (MVP) mode is applied, a motion vector predictor candidate list may be generated using the motion vector of the restored spatial neighboring block and / or the motion vector corresponding to the Col block, which is a temporal neighboring block. That is, the motion vector of the restored spatial neighboring block and / or the motion vector corresponding to the Col block, which is a temporal neighboring block, may be used as a motion vector candidate. The prediction information may include a predicted motion vector index indicating an optimal motion vector selected from the motion vector candidates included in the list. In this case, the prediction unit 330 may select a predicted motion vector of the current block from the motion vector candidates included in the motion vector candidate list using the motion vector index. A prediction unit of the encoding device obtains a motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor, encodes the MVD, and outputs it in the form of a bitstream. That is, the MVD is obtained by subtracting the motion vector predictor from the motion vector of the current block. In this case, the prediction unit 330 may obtain a motion vector differential included in the prediction information, and derive the motion vector of the current block by adding the motion vector differential and the motion vector predictor. Also, the prediction unit may obtain or induce a reference picture index indicating a reference picture from the prediction information.

[0076] The adder 340 adds the residual samples and the prediction samples to reconstruct the current block or the current picture. The adder 340 may add the residual samples and the prediction samples in units of blocks to reconstruct the current picture. When the skip mode is applied, the residual is not transmitted, and the prediction samples become the reconstructed samples. Here, the adder 340 is described as a separate component, but may be a part of the prediction unit 330. Meanwhile, the adder 340 is also referred to as a reconstruction unit or a reconstructed block generation unit.

[0077] The filter unit 350 may apply deblocking filtering, sample adaptive offset, and / or ALF to the reconstructed picture. In this case, the sample adaptive offset may be applied on a sample-by-sample basis or may be applied after deblocking filtering. The ALF may be applied after deblocking filtering and / or sample adaptive offset.

[0078] The memory 360 stores a reconstructed picture (a decoded picture) or information required for decoding. Here, the reconstructed picture may be a reconstructed picture for which a filtering procedure by the filter unit 350 has been completed. For example, the memory 360 may store a picture used for inter prediction. At this time, the picture used for inter prediction may be specified by a reference picture set or a reference picture list. The reconstructed picture may be used as a reference picture for another picture. Also, the memory 360 may output the reconstructed picture according to an output order.

[0079] FIG. 4 is a diagram illustrating an example of an image decoding method performed by a decoding device. Referring to FIG. 4, the image decoding method may include entropy decoding, inverse quantization, inverse transform, and intra / inter prediction processes. For example, the decoding device may perform the inverse process of the encoding method. Specifically, quantized transform coefficients may be obtained by entropy decoding of a bitstream, and a coefficient block of a current block, i.e., transform coefficients, may be obtained by an inverse quantization process of the quantized transform coefficients. A residual block of the current block may be derived by inverse transform of the transform coefficients, and a reconstructed block of the current block may be derived by adding a prediction block of the current block derived by intra / inter prediction and the residual block.

[0080] On the one hand, the operator in the embodiments described below may be defined as follows in the following table.

[0081]

Table 1

[0082] Referring to Table 1, Floor(x) represents the largest integer value less than or equal to x, Log2(u) represents the logarithm value of u with base 2, and Ceil(x) represents the smallest integer value greater than or equal to x. For example, in the case of Floor(5.93), the largest integer value less than or equal to 5.93 is 5, so it represents 5.

[0083] Also, referring to Table 1, x>>y represents an operator that right-shifts x by y bits, and x<<y represents an operator that left-shifts x by y bits.

[0084] <Introduction> The HEVC standard generally uses DCT, which is one type of transform type. Therefore, there is no need to transmit a separate determination process for the transform type and information regarding the determined transform type. However, currently, when the size of the luma block is 4x4 and intra prediction is performed, the DST transform type is used exceptionally.

[0085] Among the quantized coefficients that have undergone the transformation and quantization processes, the information representing the positions of non-zero coefficients can be broadly classified into three types.

[0086] 1. The position (x, y) of the last significant coefficient: The position of the lowest-ranked non-zero coefficient (hereinafter defined as the last position) in the scan order within the block to be coded

[0087] 2. Coded sub-block flag: A flag that divides the block to be coded into multiple sub-blocks and indicates whether each sub-block contains one or more non-zero coefficients (or whether it contains all zero coefficients)

[0088] 3. Significant coefficient flag: A flag that indicates whether each coefficient in a subblock is non-zero or zero.

[0089] Here, the position of the last significant coefficient is represented by dividing it into an x-axis component and a y-axis component, and each component is expressed by dividing it into a prefix and a suffix. That is, the syntax for notifying the non-zero position of the quantized coefficient includes a total of six syntaxes as follows:

[0090] 1.last_sig_coeff_x_prefix 2.last_sig_coeff_y_prefix 3.last_sig_coeff_x_suffix 4.1ast_sig_coeff_y_suffix 5. coded_sub_block_flag 6.sig_coeff_flag

[0091] The last_sig_coeff_x_prefix indicates a prefix of the x-axis component indicating the position of the last significant coefficient, the last_sig_coeff_y_prefix indicates a prefix of the y-axis component indicating the position of the last significant coefficient, the last_sig_coeff_x_suffix indicates a suffix of the x-component indicating the position of the last significant coefficient, and the last_sig_coeff_y_suffix indicates a suffix of the y-component indicating the position of the last significant coefficient.

[0092] Meanwhile, coded_sub_block_flag indicates "0" if all coefficients in the sub-block are all zero, and indicates "1" if there is one or more non-zero coefficients. sig_coeff_flag indicates "0" for zero coefficients and "1" for non-zero coefficients. Considering the position of the last significant coefficient in the block to be coded, coded_sub_block_flag syntax is transmitted only for sub-blocks that exist earlier in the scan order. If coded_sub_block_flag is "1", i.e., if there is one or more non-zero coefficients, sig_coeff_flag syntax is transmitted for each of all coefficients in the sub-block.

[0093] The HEVC standard supports three types of scanning for coefficients:

[0094] 1) Upright diagonal 2) horizontal 3) vertical

[0095] If the block to be coded is coded using inter-frame prediction, the coefficients of the block are scanned in an upright diagonal manner, and if the block is coded using intra-frame prediction, one of the three types of formats is selected according to the intra-frame prediction mode to scan the coefficients of the block.

[0096] That is, when a block to be coded is coded by a video coding apparatus, if an inter-frame prediction method is used, the coefficients of the block are scanned in an upright diagonal manner, and if an intra-frame prediction method is used in coding the block to be coded, the video coding apparatus selects one of the three types of formats according to an intra-frame prediction mode to scan the coefficients of the block. The scanning may be performed by the reordering unit 124 in the video coding apparatus of FIG. 1, and the coefficients in a two-dimensional block format may be changed to a one-dimensional vector format by the scanning.

[0097] FIG. 5 is a diagram illustrating the scanning order of sub-blocks and coefficients for the diagonal scan scheme.

[0098] 5, when the blocks in FIG. 5 are scanned in a diagonal scan manner by the rearrangement unit 124 of the video encoding device, scanning is performed from the 1st subblock, which is the upper leftmost subblock, downward and diagonally upward, and finally scanning the 16th subblock, which is the lower rightmost subblock. That is, the rearrangement unit 124 scans the subblocks in the order of 1, 2, 3, ..., 14, 15, 16, and rearranges the quantized transform coefficients in a 2-dimensional block form into a 1-dimensional vector form. Similarly, the rearrangement unit 124 of the video encoding device scans the coefficients in each subblock in the same diagonal scan manner as the subblock scan manner. For example, in the 1st subblock, scanning is performed in the order of 0, 1, 2, ..., 13, 14, 15.

[0099] However, when the scanned coefficients are stored in the bitstream, they are stored in the reverse order of the scan order. That is, when the block in Fig. 10 is scanned by the reordering unit 124 of the video encoding device, the coefficients are scanned in the order of 0 to 255, but the pixels are stored in the bitstream in the order of pixel position 255 to 0.

[0100] FIG. 6 is a diagram illustrating an example of a 32×32 block to be coded after quantization by a video coding apparatus. Here, the 32×32 block illustrated in FIG. 6 is optionally scanned in a diagonal manner by the video coding apparatus. In FIG. 6, pixels marked with diagonal lines indicate non-zero coefficients, and pixels marked with x indicate the last significant coefficient. All other white coefficients have a value of zero. Here, if the coded_sub_block_flag syntax is substituted into the block illustrated in FIG. 6, coded_sub_block_flag information is required for 24 sub-blocks that exist before the last position in the scanning order among a total of 64 sub-blocks, i.e., the sub-blocks marked with bold lines in FIG. 6. Among the 24 sub-blocks, the coded_sub_block_flag values ​​for the first sub-block including a DC value and the 24th sub-block including the last position coefficient are induced to be "1", and the coded_sub_block_flag values ​​for the remaining 22 sub-blocks are transmitted to the video decoding apparatus by a bitstream. In this case, for any of the 22 sub-blocks that contain one or more non-zero coefficients, the video encoding device sets the coded_sub_block_flag value to '1.' In Figure 6, of the 22 sub-blocks excluding the 1st and 24th sub-blocks, the coded_sub_block_flag values ​​of the 4th, 5th, 11th, and 18th sub-blocks that contain pixels marked in gray are set to '1.'

[0101] 1. How to determine the primary transformation type of the block to be decoded This specification discloses a method for determining a type of primary transform of a block to be decoded during a video decoding process. That is, when a block to be decoded is decoded by a video decoding device, a process of determining with what transform type the block has been primarily transformed and encoded in a transform process by a video encoding device is required. The primary transform type is composed of one default transform and multiple additional transforms. The block to be decoded may use a default transform or a multiple transform set including a default transform and an additional transform depending on a condition. That is, the block to be decoded may be transformed using only a default transform in a transform process, or may be transformed using a multiple transform set including a default transform and an additional transform. Conversely, from the viewpoint of a video decoding device, decoding may be performed by determining whether the block to be decoded uses only a default transform or a multiple transform set including a default transform and an additional transform. When the block to be decoded uses MTS, information on a transform actually used among multiple transforms is transmitted or guided. Here, the information on the transform actually used may separately include a horizontal axis transform type and a vertical axis transform type. That is, when the current block to be decoded has been transformed using MTS, the video decoding device may receive or determine which transformation type, out of a plurality of transformation types, has been used for the transformation and perform decoding.

[0102] According to an embodiment, DCT-II may be set as the default transform, and DST-7 and DCT-8 may be set as the additional transform. In this case, the maximum size of DCT-II, which is the default transform, is supported up to 64×64, and the maximum size of DST-7 and DCT-8, which are the additional transforms, is supported up to 32×32. For example, when the size of the block to be decoded is 64×64, one 64×64 DCT-II is applied to the transform process. That is, when one or more of the width and height of the block to be decoded is greater than 32 (exceeds 32), the default transform (*) is immediately applied without applying the MTS. That is, from the viewpoint of the video decoding device, it is only necessary to determine whether or not the block to be decoded has been transformed using the MTS when both the horizontal and vertical sizes of the block to be decoded are 32 or less. On the other hand, when one of the horizontal or vertical sizes of the block to be decoded is greater than 32, it may be determined that the block to be decoded has been transformed using the default transform. In this way, when the block to be decoded is transformed using the default transform, there is no syntax information transmitted in association with the MTS. For convenience, but not limited to, the present invention sets the transform type value of DCT-II to "0", the transform type value of DST-7 to "1", and the transform type value of DCT-8 to "2". Table 2 below defines the transform types assigned to each value of the trType syntax.

[0103] [Table 2]

[0104] Tables 3 and 4 show examples of transform kernels for DST-7 and DCT-8 when the size of the block to be decoded is 4×4.

[0105] Table 3 shows the coefficient values ​​of the transform kernel when tyType is “1” (DST-7) and the size of the block to be decoded is 4×4, and Table 4 shows the coefficient values ​​of the transform kernel when tyType is “2” (DCT-8) and the size of the block to be decoded is 4×4.

[0106] [Table 3]

[0107] [Table 4]

[0108] The entire transform region of the block to be decoded may include a zero-out region. The transform converts pixel domain values ​​into frequency domain values, where the upper left frequency region is called the low frequency region and the lower right frequency region is called the high frequency region. The low frequency components reflect the general (average) characteristics of the block, and the high frequency components reflect the sharp (unique) characteristics of the block. Therefore, the low frequency components have many large values, and the high frequency components have a small number of small values. Due to the quantization process after the transform, the small number of small values ​​in the high frequency region mostly have a value of 0. Here, in addition to the low frequency region belonging to the upper left, the remaining region having almost 0 values ​​is called a zero-out region, and the zero-out region may be excluded in the signaling process. The region in the block to be decoded excluding the zero-out region is called a valid region.

[0109] FIG. 7 is a diagram showing the remaining zero-out region excluding m×n in the region of an M×N block to be decoded.

[0110] Referring to FIG. 7, the grey area on the upper left side indicates the low frequency area, and the white area indicates the high frequency zero-out.

[0111] As another example, if the block to be decoded is 64×64, the 32×32 area on the upper left side becomes a valid area, and the remaining area excluding this becomes a zero-out area and is not signaled.

[0112] Also, if the size of the block to be decoded is one of 64x64, 64x32, and 32x64, the 32x32 region at the top left becomes a valid region, and the remaining part except this becomes a zero-out region. Since the size of the block is known when the decoder parses the syntax for the quantized coefficients, the zero-out region is not signaled. That is, the region in which the width or height of the block to be decoded is greater than 32 is set as the zero-out region. In this case, since the horizontal or vertical size of the block to be decoded is greater than 32, the transform used is the default transform, DCT-II. Since the maximum size of the additional transforms DST-7 and DCT-8 is supported up to 32x32, MTS is not applied to the target block of such a size.

[0113] Also, when the size of the block to be decoded is one of 32x32, 32x16, and 16x32, and MTS is applied to the block to be decoded (for example, when DST-7 or DCT-8 is used), the 16x16 region on the upper left side becomes a valid region, and the remaining part except this is set as a zero-out region. Here, the zero-out region may be signaled according to the position of the last valid coefficient and the scanning method. This is because the encoder signals the MTS index (mts_idx) value after finishing the signaling of the quantized coefficient related syntax, and therefore, when the decoder parses the syntax for the quantized coefficient, information on the transform type is not known. In this way, when the zero-out region is signaled, the decoder can ignore or remove the quantized coefficients corresponding to the zero-out region and then perform transform only on the valid region. Here, the information on the transform type actually used may separately include a horizontal axis transform type and a vertical axis transform type. For example, if the horizontal axis transform type of the block to be decoded is DST-7 or DCT-8, the horizontal axis (width) effective area of ​​the block to be decoded is 16, and if the vertical axis transform type of the block to be decoded is DST-7 or DCT-8, the vertical axis (height) effective area of ​​the block to be decoded is 16.

[0114] On the other hand, when the size of the block to be decoded is one of 32×32, 32×16, and 16×32, and MTS is not applied to the block to be decoded (for example, when DCT-II, which is the default transform, is used), all areas are valid areas, there are no zero-out areas, and the block is transformed using DCT-II, which is the default transform. Here, the information on the transform actually used may separately include a horizontal axis transform type and a vertical axis transform type. For example, when the horizontal axis transform type of the block to be decoded is DCT-II, the horizontal axis (width) valid area of ​​the block to be decoded is the width of the block, and when the vertical axis transform type of the block to be decoded is DCT-II, the vertical axis (height) valid area of ​​the block to be decoded is the height of the block. That is, all areas (width x height) of the block to be decoded are valid areas.

[0115] On the other hand, if the block to be decoded has a size smaller than 16, which is not defined above, all the regions are valid regions and there are no zero-out regions. The application of MTS and the transform type value of the block to be decoded are determined by the implementation, which may be implicit and / or explicit.

[0116] In the present invention, the content of the syntax expressing the position of a non-zero coefficient among quantized coefficients that have undergone a transform and quantization process is the same as that of the HEVC method, except that the syntax name of coded_sub_block_flag is changed to sb_coded_flag. Also, the method of scanning the quantized coefficients is an upright diagonal method.

[0117] In the present invention, MTS may be applied to luma blocks (but not to chroma blocks). Also, the MTS function can be turned on / off using a flag indicating whether MTS is used, i.e., sps_mts_enabled_flag. When the MTS function is used, sps_mts_enabled_flag=on is set, and whether to use the explicit MTS function for each of intra prediction and inter prediction can be set. That is, a flag sps_explicit_mts_intra_enabled_flag indicating whether MTS is used during intra prediction and a flag sps_explicit_mts_inter_enabled_flag indicating whether MTS is used during inter prediction may be set separately. For convenience, this specification describes that the values ​​of the flags sps_mts_enabled_flag, sps_explicit_mts_intra_enabled_flag, and sps_explicit_mts_inter_enabled_flag indicating whether three types of MTS are used are located in a sequence parameter set (SPS), but is not limited to this. That is, the three flags may be set at one or more positions of the decoding capability information (DCI), video parameter set (VPS), sequence parameter set (SPS), picture parameter set (PPS), picture header (PH), and slice header (SH). Also, the flags indicating whether the three MTS are used may be defined as high level syntax (HLS).

[0118] The use of MTS is divided into an explicit method and an implicit method. In the use of explicit MTS, a flag value indicating whether intra-picture and / or inter-picture MTS is used is set to on in the SPS, and MTS-related information (e.g., transformation information actually used) is transmitted when a specific condition is met. That is, a video decoding device receives MTS-related information, and based on this, it can check what transformation type was used to transform the block to be decoded, and perform decoding based on this. For example, in an environment where explicit MTS is used, the three flags may be set as follows:

[0119] 1.sps_mts_enabled_flag=on 2.sps_explicit_mts_intra_enabled_flag=on 3.sps_explicit_mts_inter_enabled_flag=on

[0120] The use of implicit MTS induces MTS-related information (e.g., conversion information actually used) when the value of sps_mts_enabled_flag is set to on among three flags in the SPS and certain conditions are met. For example, in an environment where implicit MTS is used, the three flags may be set as follows:

[0121] 1.sps_mts_enabled_flag=on 2.sps_explicit_mts_intra_enabled_flag=off 3. sps_explicit_mts_inter_enabled_flag=off (either on or off)

[0122] In the following, an implicit MTS method and an explicit MTS method are described according to some embodiments.

[0123] 2. First embodiment (implicit MTS) The implicit MTS described in this embodiment may be used when the block to be decoded is encoded by an intra-picture prediction method. That is, when the block to be decoded is encoded by a video encoding device, if the block is encoded by an intra-picture prediction method, the video encoding device and / or the video decoding device may use the implicit MTS to encode and / or decode the block. On the other hand, whether or not to use the implicit MTS when decoding the block to be decoded may be indicated by the implicitMtsEnabled parameter. The video decoding device may check the value of the implicitMtsEnabled parameter to determine whether or not to perform decoding using the implicit MTS. For example, if the implicit MTS is used for decoding, the implicitMtsEnable parameter may have a value of 1, and if not, the implicitMtsEnable parameter may have a value of 0. On the other hand, in this specification, the implicitMtsEnabled may be displayed as "implicit_MTS_enabled" depending on the case.

[0124] When examining the conditions of HLS (high level syntax) for applying such an implicit MTS, sps_mts_enabled_flag is a flag indicating whether MTS is applied, regardless of whether it is implicit or explicit, and therefore must be set to "on" in order for the implicit MTS to be applied. On the other hand, the implicit MTS is used when the block to be decoded is encoded by the video encoding device using an intra-frame prediction method. Therefore, the video decoding device can determine whether to use the implicit MTS by checking the value of sps_explicit_mts_intra_enabled_flag. However, sps_explicit_mts_intra_enabled_flag is set to "on" when the block to be decoded is encoded by the video encoding device using an intra-frame prediction method and an explicit MTS is applied. Therefore, when the block to be decoded is encoded by the video encoding device using implicit MTS, sps_explicit_mts_intra_enabled_flag is set to "off". On the other hand, as described above, the implicit MTS is used when the block to be decoded is encoded by the video encoding device using an intra-prediction method. Therefore, it is not important what value the sps_explicit_mts_inter_enabled_flag, which indicates the explicit MTS when the block to be decoded is encoded by the video encoding device using an intra-prediction method, has. On the other hand, the implicit MTS may be used when the block to be decoded is encoded by the video encoding device using an intra-prediction method, and therefore may be applied when CuPredMode has a value of MODE_INTRA.

[0125] In summary, the conditions for the current block to be decoded to be decoded by the video decoding device using the implicit MTS can be listed as follows:

[0126] 1) sps_mts_enabled_flag is equal to 1 2) sps_explicit_mts_intra_enabled_flag is equal to 0 3) CuPredMode is equal to MODE_INTRA (intra-frame prediction method)

[0127] On the other hand, CuPredMode[0][xTbY][yTbY], which indicates the prediction mode of the current position in the luma block, may have the value MODE_INTRA.

[0128] Additional conditions under which Implicit MTS can be used are:

[0129] 4) lfnst_idx is equal to 0 5) intra_mip_flag is equal to 0

[0130] Here, the lfnst_idx value indicates a secondary transform, and when lfnst_idx=0, it means that the secondary transform is not used. The Intra_mip_flag value indicates whether or not a matrix-based intra prediction (mip) method, which is one of the intra prediction methods, is used. When intra_mip_flag=0, it means that a matrix-based prediction is not used, and when intra_mip_flag=1, it means that a matrix-based prediction is used.

[0131] That is, this embodiment describes a method for setting a primary transform type (or MTS) for a block to be decoded that does not use secondary transform while predicting with a general intra prediction method. When all the above five conditions are satisfied, the implicit MTS function is activated (see FIG. 13).

[0132] 8 is a diagram illustrating a method for determining whether to apply an implicit MTS function according to an embodiment of the present invention. Each step in FIG. 8 may be performed in a video decoder.

[0133] 8, the video decoding apparatus determines whether sps_mts_enable_flag has a value of 1, sps_explicit_mts_intra_enable_flag has a value of 0, and CuPredMode has a value of MODE_INTRA (S810). If all the conditions of S810 are met as a result of the determination, the video decoding apparatus determines whether lfnst_idx has a value of 0 and intra_mip_flag has a value of 0 (S820), and sets the implicit_MTS_enabled value to 1 if both the conditions of S810 and S820 are met (S830). On the other hand, if any of the conditions of S810 or S820 are not met, the video decoding apparatus sets the implicit_MTS_enabled value to 0 (S840).

[0134] When the implicit MTS function for the block to be decoded is activated (implicit_MTS_enabled=on), the MTS value (transformation information actually used) is derived according to the width and height of the block (see FIG. 9). At this time, the transformation must not be a sub-block transform (sbt) in which only a part of the block to be decoded undergoes the transformation process. In other words, the cu_sbt_flag value of the block to be decoded is "0".

[0135] 9 is a diagram illustrating a method for deriving transformation information according to the width and height of the block of an implicit MTS according to an embodiment of the present invention. Each step in FIG. 9 may be performed in a video decoding device.

[0136] Referring to FIG. 9, the video decoding apparatus determines whether the implicit_MTS_enabled value is '1' (S910). At this time, although not shown, the video decoding apparatus may further check whether the cu_sbt_flag value has a value of '0'. At this time, if the cu_sbt_flag has a value of '1', it indicates that the block to be decoded has been transformed by sub-block transformation in which only a portion of the block to be decoded undergoes a transformation process. On the other hand, if the cu_sbt_flag has a value of '0', it indicates that the block to be decoded has not been transformed by sub-block transformation in which only a portion of the block to be decoded undergoes a transformation process. Therefore, the operation according to FIG. 14 may be set to operate only when the cu_sbt_flag has a value of '0'.

[0137] If the implicit_MTS_enabled value is 1, it is determined whether the value of nTbW is 4 or more and 16 or less (S920), and the operation ends if the implicit_MTS_enabled value is not "1". nTbW indicates the width of the transform block and is used to determine whether DST-7, which is an additional transform type in the horizontal direction, is used.

[0138] As a result of the determination in step S920, if the value of nTbW is between 4 and 16, trTypeHor is set to "1" (S930), and if the value of nTbW is not between 4 and 16, trTypeHor is set to "0" (S940). At this time, nTbW indicates the width of the transform block and is used to determine whether DST-7, which is an additional transform type in the horizontal axis direction, is used. At this time, if tyTypeHor is set to "0", it can be determined that the transform block has been transformed in the horizontal axis direction using DCT-II transform, which is a default type transform. On the other hand, if trTypeHor is set to "1", it can be determined that the transform block has been transformed in the horizontal axis direction using DST-7 transform, which is one of the additional transform types.

[0139] The video decoding apparatus also determines whether nTbH has a value between 4 and 16 (S950), sets trTypeVer to '1' if nTbH has a value between 4 and 16 (S960), and sets trTypeVer to '0' if nTbW does not have a value between 4 and 16 (S970). The nTbH indicates the height of the transform block and is used to determine whether DST-7, which is an additional transform type, is used in the vertical axis direction. In this case, if trTypeVer is set to '0', it can be determined that the transform block has been transformed in the vertical axis direction using DCT-II transform, which is a default type transform. On the other hand, if trTypeVer is set to '1', it can be determined that the transform block has been transformed in the vertical axis direction using DST-7 transform, which is one of the additional transform types.

[0140] 10 is a diagram illustrating a method for performing an inverse transform based on transform-related parameters according to an embodiment of the present invention. Each step of FIG. 10 may be performed in a video decoding device, for example, in an inverse transform unit of the decoding device.

[0141] Referring to Fig. 10, the video decoding apparatus obtains sps_mts_enabled_flag, sps_explicit_mts_intra_enabled_flag, CuPredMode[0][xTbY][yTbY], lfnst_idx, IntraMipFlag[x0,Y0], NTbW, and nTbH (S1010). At this time, what sps_mts_enabled_flag, sps_explicit_mts_intra_enabled_flag, CuPredMode[0][xTbY][yTbY], lfnst_idx, and IntraMipFlag[x0,Y0] indicate is explained in detail in the related description of Fig. 8, and the parameters are used to determine whether the block to be decoded can apply implicit MTS. In addition, NTbW and nTbH indicate the width and height of the transform block, respectively, and are used to determine whether the additional transform type DST-7 is used.

[0142] Next, the video decoding device sets implicit_MTS_enabled based on the values ​​of sps_mts_enabled_flag, sps_explicit_mts_intra_enabled_flag, CuPredMode[0][xTbY][yTbY], Lfnst_idx, and IntraMipFlag[x0,Y0] (S1020). At this time, implicit_MTS_enable may be set by performing the process of FIG.

[0143] Next, the video decoding apparatus sets trTypeHor and trTypeVer based on the values ​​of implicit_MTS_enabled, nTbW, and nTbH (S1030). At this time, the trTypeHor and trTypeVer may be set by performing the process of FIG.

[0144] Next, the video decoding apparatus performs inverse transformation based on trTypeHor and trTypeVer (S1040). The inverse transformation applied by trTypeHor and trTypeVer may be configured according to Table 2. For example, when trTypeHor is "1" and trTypeVer is "0", DST-7 may be applied to the horizontal axis direction and DST-II may be applied to the vertical axis direction.

[0145] On the other hand, although not shown in the figure, from the perspective of the video encoding device, sps_mts_enabled_flag, sps_explicit_mts_intra_enabled_flag, CuPredMode[0][xTbY][yTbY], lfnst_idx, IntraMipFlag[x0, Y0], NTbW, and nTbH may be set to determine whether or not to use implicit MTS.

[0146] 3. Second embodiment (explicit MTS) In this embodiment, a conversion method applied to a block to be decoded when the MTS function is explicitly activated in HLS (high level syntax) will be described. Looking into the conditions of HLS (high level syntax) for applying explicit MTS, sps_mts_enabled_flag is a flag indicating whether MTS is applied or not, regardless of whether it is implicit or explicit, so it must be set to "on" in order for implicit MTS to be applied. Meanwhile, explicit MTS may be applied in both cases where the block to be decoded is coded by an intra-frame prediction method and an inter-frame prediction method, so when explicit MTS is applied, sps_explicit_mts_intra_enabled_flag and / or sps_explicit_mts_intra_enabled_flag are all set to "on". In summary, the following conditions may be listed.

[0147] 1) sps_mts_enabled_flag=on 2) sps_explicit_mts_intra_enabled_flag=on 3) sps_explicit_mts_inter_enabled_flag=on

[0148] Here, if the block to be decoded is coded using an intra-screen prediction method, the condition sps_explicit_mts_intra_enabled_flag="on" is checked, and if the block to be decoded is coded using an inter-screen prediction method, the condition sps_explicit_mts_inter_enabled_flag="on" is checked.

[0149] Additional conditions under which explicit MTS may be used are:

[0150] 4) lfnst_idx is equal to 0 (implicit MTS reference) 5) transform_skip_flag is equal to 0 6)intra_subpartitions_mode_flag is equal to 0 7) cu_sbt_flag is equal to 0 (implicit MTS reference) 8)valid MTS area 9) The width and height of the target block are 32 or less.

[0151] Here, the lfnst_idx value indicates the secondary transformation, and when lfnst_idx=0, it means that the secondary transformation is not used.

[0152] The value of transform_skip_flag indicates that the transform process is skipped, and when transform_skip_flag=0, it indicates that the transform process is not skipped and the transform is normally performed. The value of intra_subpartitions_mode_flag indicates that the target block is divided into a number of sub-blocks and undergoes prediction, transform, and quantization processes as one of the intra prediction methods. That is, when the flag value (intra_subpartitions_mode_flag) is '0', it means that the target block is not divided into sub-blocks and general intra prediction is performed. Meanwhile, the use of MTS may be restricted depending on the supported size of extra transforms (DST-7 and DCT-8) (up to 32x32 is supported, as described above). That is, MTS cannot be used unless the width and height of the target block are 32 or less. That is, if any one of the width and height exceeds 32, DCT-II, which is the default transform (*) (which cannot use MTS), is performed.

[0153] Cu_sbt_flag indicates whether the current block is a sub-block transform (sbt) in which only a part of the current block undergoes a transformation process. That is, when the cu_sbt_flag value is '0', it means that the current block is not a sub-block transform in which only a part of the current block undergoes a transformation process.

[0154] The effective region (hereinafter referred to as effective MTS region) will be described in detail below.

[0155] FIG. 11 is a diagram showing a valid MTS area marked with a thick line within a 32×32 block to be decoded.

[0156] Referring to FIG. 11, the 16×16 region on the upper left side excluding the DC coefficient is the effective MTS region. That is, the 16×16 region on the upper left side excluding the 1×1 (DC) region is the effective MTS region. For example, if the positions of all non-zero coefficients in the target block belong to the effective MTS region, MTS can be applied, and if one or more non-zero coefficient values ​​are outside the effective MTS region, MTS cannot be applied and DCT-II, which is the default transform (*), is performed. This is the same concept as the zero-out region described above. That is, if a 32×32 target block uses MTS (i.e., DST-7 or DCT-8), the 16×16 on the upper left side is the effective region and the remaining part is the zero-out region. Similarly, if all non-zero coefficients in the 32×32 target block are located in the 16×16 region on the upper left side, MTS (i.e., DST-7 or DCT-8) can be applied. However, exceptionally, if there is only one non-zero coefficient in a block and its position is DC(1x1), MTS cannot be applied and DCT-II, which is the default transformation (*), is performed.

[0157] As a result, in this embodiment, in order to determine whether MTS is applicable, a valid MTS region must be confirmed. To confirm the valid MTS region, the following two conditions must be confirmed:

[0158] (a) If there is one nonzero coefficient in the block, is its position DC(1x1)? (b) Are all the nonzero coefficients in the block located in the upper left 16x16 region?

[0159] To check the condition (a), information on the last position may be utilized. Here, the last position means the position of the nonzero coefficient located last in the scan order in the target block, that is, the position of the last significant coefficient. As an example, information on the last position, that is, the last sub-block including the last nonzero coefficient may be utilized. For example, if the position of the last sub-block is not (0,0), the condition (a) can be satisfied. In other words, if the position of the last sub-block is not "0" (greater than 0) in the scan order of the sub-blocks in the target block, the condition (a) can be satisfied. Alternatively, if the position of the last sub-block is "0", information on the last scan position indicating the relative position of the last position in the sub-block may be utilized. For example, if the last scan position is not "0" (greater than 0) in the scan order of the coefficients in the sub-block, the condition (a) can be satisfied (see FIG. 12). Also, as described above, the MTS of the present invention is applied to a luma block.

[0160] In order to check the condition (b), sub-block information including one or more non-zero coefficients may be utilized. Here, the sub-block information including one or more non-zero coefficients can be checked by the sb_coded_flag value of the sub-block. When the flag value is "1" (sb_coded_flag=1), it means that one or more non-zero coefficients are located in the sub-block, and when sb_coded_flag=0, it means that all coefficients in the sub-block are zero. That is, when all sub-blocks in the target block having an sb_coded_flag value of "1" are located within the range from (0,0) to (3,3), the condition (b) can be met. On the other hand, when even one of the sub-blocks in the target block having an sb_coded_flag value of "1" is out of the range from (0,0) to (3,3), the condition (b) cannot be met. In other words, if any of the sub-blocks in the target block having an sb_coded_flag value of "1" has an x-coordinate or y-coordinate value greater than 3, then condition (b) cannot be satisfied (see FIG. 18). In another embodiment, if a first sub-block is found in the target block in the scanning order of sub-blocks that has an sb_coded_flag value of "1" and an x-coordinate or y-coordinate value greater than 3, then condition (b) may be set to false, and the process of checking subsequent sub-blocks in the scanning order that have an sb_coded_flag value of "1" may be omitted (see FIG. 13). Also, as described above, the MTS of the present invention is applied to luma blocks.

[0161] Fig. 12 is a diagram showing a method for determining a valid MTS according to an embodiment of the present invention. The embodiment of Fig. 12 relates to a method for checking condition (a) among the two conditions for checking a valid MTS area described above. Each step of Fig. 12 may be performed in a video decoding device.

[0162] Referring to FIG. 12, the video decoding apparatus sets MtsDcOnlyFlag to '1' (S1210). The MtsDcOnlyFlag may indicate whether there is one non-zero coefficient in a block and its position is DC. For example, if there is one non-zero coefficient in a block and its position is DC, the MtsDcOnlyFlag has a value of '1', otherwise the MtsDcOnlyFlag has a value of '0'. In this case, the video decoding apparatus may apply MTS if the MtsDcOnlyFlag value is '0'. The reason for setting MtsDcOnlyFlag to '1' in step S1210 is that if the block satisfies the condition that there is one non-zero coefficient in the following block and it is not in a DC position, the MtsDcOnlyFlag is reset to '0', and otherwise MTS is not applied.

[0163] Next, the video decoding apparatus determines whether the current block is a luma block (S1220). The purpose of determining whether the current block is a luma block is because, as described above, MTS is applied only to luma blocks.

[0164] Next, the video decoding apparatus determines whether the last sub-block is greater than 0 (S1230), and if the last sub-block is greater than 0, sets MtsDcOnlyFlag to “0” (S1240), and ends the process.

[0165] If the result of the determination in step S1230 is that the last sub-block is not greater than 0, then it is determined whether the last scan position is greater than 0 (S1250).

[0166] If it is determined in step S1250 that the last scan position is greater than 0, MtsDcOnlyFlag is set to "0" (S1240), and the process ends.

[0167] If it is determined in step S1250 that the last scan position is not greater than 0, the process ends.

[0168] According to this embodiment, if the last sub-block is greater than 0 or the last scan position is greater than 0, then set MtsDcOnlyFlag to "0", otherwise set MtsDcOnlyFlag to "1".

[0169] Thereafter, when determining whether to apply MTS, MtsDcOnlyFlag is checked, and if it has a value of "1", the default transform DCT-II may be applied without applying MTS.

[0170] 13 is a diagram illustrating a method for determining a valid MTS region according to another embodiment of the present invention. The embodiment of FIG. 13 specifically illustrates a method for checking condition (b) among the two conditions for checking a valid MTS region described above. Each step of FIG. 13 may be performed in a video decoding device.

[0171] Referring to FIG. 13, the video decoding apparatus sets MtsZerooutFlag to '1' (S1305). The MtsZerooutFlag indicates whether or not a non-zero coefficient in a block is in a zero-out region. For example, if at least one of the non-zero coefficients in a block is in a zero-out region, MtsZerooutFlag may have a value of '0', and if all the non-zero coefficients in a block are not in a zero-out region, MtsZerooutFlag may have a value of '1'. In this embodiment, assuming that all the non-zero coefficients in a block are not in a zero-out region, the initial value of MtsZerooutFlag may be set to '1', and if the zero-out region condition and the non-zero coefficient condition are simultaneously satisfied, MtsZerooutFlag may be set to '0'. In this case, if there is an MtsZerooutFlag with a value of '0', it is not necessary to apply an explicit MTS.

[0172] Next, the video decoding apparatus sets the initial value of the variable i to the value of the last sub-block, subtracting 1 from the value of the variable i, and repeats the process of steps S1325 to S1350 until the value of the variable i becomes 0 (S1320). The purpose of repeating the routine of step S1820 is to check the sb_coded_flag values ​​of all sub-blocks from the last sub-block to the first sub-block. As described above, if the flag value is "1", it means that one or more non-zero coefficients exist in the sub-block, and if the flag value is "0", it means that no non-zero coefficient exists in the sub-block. Therefore, referring to FIG. 11, if the positions of all sub-blocks whose sb_coded_flag values ​​are "1" in the target block are only within (0,0) to (3,3), i.e., only within 0 to 8 based on the variable i, it may be determined that the condition (b) for applying the explicit MTS is satisfied.

[0173] Next, the video decoding apparatus determines whether or not the conditions that the variable i is smaller than the last sub-block (i<last sub-block) and the variable i is greater than 0 (i>0) are simultaneously satisfied (S1325). For example, when the routine of step S1320 is executed for the first time, the initial value of the variable i is set to the same value as the last sub-block, and therefore the condition of step S1325 is not satisfied.

[0174] If the result of the determination in step S1325 is that the variable i is smaller than the last subblock (i<last subblock) and is greater than 0 (i>0) at the same time, sb_coded_flag is parsed (S1830). If both conditions are not met at the same time, sb_coded_flag is set to "1" (S1835).

[0175] In this case, the parsed sb_coded_flag indicates whether or not one or more nonzero coefficients are present in the sub-block. If one or more nonzero coefficients are present in the sub-block, sb_coded_flag has a value of "1", and if no nonzero coefficients are present in the sub-block, sb_coded_flag has a value of "0".

[0176] On the other hand, step S1835 is performed only when i indicates the last sub-block and the first sub-block. That is, since the last sub-block includes the last position coefficient, the sb_coded_flag value is parsed to a value of "1", and since the first sub-block includes a DC coefficient, the sb_coded_flag value is parsed to a value of "1".

[0177] Next, the video decoding apparatus determines whether the current block is a luma block (S1340). The purpose of determining whether the current block is a luma block is because, as described above, MTS is applied only to luma blocks.

[0178] If it is determined in step S1340 that the block is a luma block, it is determined whether the condition "sb_coded_flag && (xSb>3∥ySb>3)" is satisfied (S1845), and if the condition in step S1845 is satisfied, MtsZerooutFlag is set to "0" (S1350).

[0179] According to this embodiment, if any non-zero coefficient is found in any sub-block other than sub-block (3,3) in the current block, i.e., in the zero-out region, MtsZerooutFlag may be set to “0”, and it may be determined that explicit MTS cannot be applied.

[0180] FIG. 14 is a diagram illustrating a method for determining a valid MTS according to another embodiment of the present invention. The embodiment of FIG. 14 specifically illustrates a method for checking condition (b) among the two conditions for checking a valid MTS area described above. However, the embodiment of FIG. 13 checks the sb_coded_flag of all sub-blocks to check the valid MTS area, whereas the embodiment of FIG. 14 differs in that if a first invalid MTS is found, it is not necessary to check the subsequent sb_coded_flag. Each step of FIG. 14 may be performed within a video decoding device.

[0181] Referring to FIG. 14, the video decoding apparatus sets MtsZerooutFlag to '1' (S1405). The MtsZerooutFlag indicates whether or not a non-zero coefficient in a block is in a zero-out region. For example, if at least one of the non-zero coefficients in a block is in a zero-out region, MtsZerooutFlag may have a value of '0', and if all the non-zero coefficients in a block are not in a zero-out region, MtsZerooutFlag may have a value of '1'. In this embodiment, assuming that all the non-zero coefficients in a block are not in a zero-out region, the initial value of MtsZerooutFlag may be set to '1', and if the zero-out region condition and the non-zero coefficient condition are simultaneously satisfied, MtsZerooutFlag may be set to '0'. In this case, if there is an MtsZerooutFlag with a value of '0', it is not necessary to apply an explicit MTS.

[0182] Next, the video decoding apparatus sets the initial value of the variable i to the value of the last sub-block, subtracting 1 from the value of the variable i, and repeats the process of steps S1425 to S1450 until the value of the variable i becomes 0 (S1420). The purpose of repeating the routine of step S1420 is to check the sb_coded_flag values ​​of all sub-blocks from the last sub-block to the first sub-block. As described above, when the sb_coded_flag value is "1", it means that one or more non-zero coefficients exist in the sub-block, and when the sb_coded_flag value is "0", it means that no non-zero coefficient exists in the sub-block. Therefore, referring to FIG. 16, when all sub-blocks in the target block whose sb_coded_flag value is "1" are located only within (0,0) to (3,3), i.e., only within 0 to 8 based on the variable i, it may be determined that the condition (b) for applying the explicit MTS is satisfied.

[0183] Next, the video decoding apparatus determines whether or not the conditions that the variable i is smaller than the last sub-block (i<last sub-block) and the variable i is greater than 0 (i>0) are simultaneously satisfied (S1425). For example, when the routine of step S1920 is executed for the first time, the initial value of the variable i is set to the same value as the last sub-block, and therefore the condition of step S1425 is not satisfied.

[0184] As a result of the judgment in step S1425, if the conditions that the variable i is smaller than the last sub-block (i<last sub-block) and the variable i is greater than 0 (i>0) are simultaneously met, sb_coded_flag is parsed (S1430), and if both conditions are not simultaneously met, sb_coded_flag is set to “1” (S1435).

[0185] In this case, the parsed sb_coded_flag indicates whether or not one or more nonzero coefficients are present in the sub-block. If one or more nonzero coefficients are present in the sub-block, sb_coded_flag has a value of "1", and if no nonzero coefficients are present in the sub-block, sb_coded_flag has a value of "0".

[0186] On the other hand, step S1435 is performed only when i indicates the last sub-block and the first sub-block. That is, since the last sub-block includes the last position coefficient, the sb_coded_flag value is parsed to a value of "1", and since the first sub-block includes a DC coefficient, the sb_coded_flag value is parsed to a value of "1".

[0187] Next, the video decoding apparatus determines whether the condition "MtsZerooutFlag && luma block" is satisfied (S1440).

[0188] If the result of the judgment in step S1440 is that the condition "MtsZerooutFlag && luma block" is met, then it is further judged whether the condition "sb_coded_flag && (xSb>3 || ySb>3)" is met (S1445), and if the condition "sb_coded_flag && (xSb>3 || ySb>3)" is met, MtsZerooutFlag is set to "0" (S1450).

[0189] If the result of the determination in step S1440 is that the condition "MtsZerooutFlag && luma block" is not satisfied, the process in that sub-block ends.

[0190] According to this embodiment, once the MtsZerooutFlag value is set to “0” for the variable i, i.e., the sub-block, at least once, in the next routine, variable i−1, a False value is derived in step S1940, and there is no need to check the sb_coded_flag value any further.

[0191] On the other hand, if the block to be decoded satisfies both the conditions (a) and (b), the use of explicit MTS is confirmed, and the transform information actually used for the block is transmitted in the form of an index (mts_idx). On the other hand, if all the conditions are not satisfied, the default transform (*), DCT-II, is used (see FIG. 15). Table 5 shows the transform types of the horizontal and vertical axes according to the mts_idx value.

[0192] [Table 5]

[0193] In Table 5, trTypeHor means the horizontal axis transformation type, and trTypeVer means the vertical axis transformation type. The transformation type values ​​in Table 5 refer to the trType values ​​in Table 2. For example, when the mts_idx value is "2", DCT-8(2) is used for the horizontal axis transformation, and DST-7(1) is used for the vertical axis transformation.

[0194] In the present invention, all cases where the above-mentioned default transform (*) DCT-II is used / executed / applied may be replaced with the expression "induce mts_idx value to '0'". That is, when the mts_idx value is '0', DCT-II(0) is set for both horizontal and vertical transforms.

[0195] In the present invention, the binarization method of mts_idx uses the TR (truncated rice) method, and the cMax value, which is the parameter value for TR, is "4", and the cRiceParam value is "0". Table 6 shows the codeword of the MTS index.

[0196] [Table 6]

[0197] Referring to Table 6, it can be seen that when the mts_idx value is "0", the corresponding codeword is "0", when the mts_idx value is "1", the corresponding codeword is "10", when the mts_idx value is "2", the corresponding codeword is "110", when the mts_idx value is "3", the corresponding codeword is "1110", and when the mts_idx value is "4", the corresponding codeword is "1111".

[0198] 15 is a diagram illustrating a method for determining whether to apply an explicit MTS function according to an embodiment of the present invention. Each step in FIG. 15 may be performed in a video decoder.

[0199] Referring to FIG. 15, the video decoding apparatus determines whether a condition '(sps_explicit_mts_intra_enabled_flag && CuPredMode=MODE_INTRA) || (sps_explicit_mts_inter_enabled_flag && CuPredMode=MODE_INTER)' is satisfied (S1510).

[0200] sps_explicit_mts_intra_enabled_flag is a flag indicating whether explicit MTS is used during intra prediction, and sps_explicit_mts_intra_enabled_flag is a flag indicating whether explicit MTS is used during inter prediction. sps_explicit_mts_intra_enabled_flag has a value of "1" when explicit MTS is used during intra prediction, and has a value of "0" otherwise. sps_explicit_mts_intra_enabled_flag has a value of "1" when explicit MTS is used during inter prediction, and has a value of "0" otherwise.

[0201] CuPredMode indicates which prediction method is used to encode the current block. If the current block is encoded by an intra prediction method, CuPredMode has a value of MODE_INTRA, and if the current block is encoded by an inter prediction method, CuPredMode has a value of MODE_INTER.

[0202] Therefore, when the block to be decoded uses intra prediction and explicit MTS, "sps_explicit_mts_intra_enabled_flag && CuPredMode=MODE_INTRA" has a value of "1", and when the block to be decoded uses inter prediction and explicit MTS, "sps_explicit_mts_inter_enabled_flag && CuPredMode=MODE_INTER" has a value of "1". Therefore, in step S2010, it is possible to determine whether the block to be decoded uses explicit MTS by checking the values ​​of sps_explicit_mts_intra_enabled_flag, sps_explicit_mts_inter_enabled_flag, and CuPredMode.

[0203] If the condition of step S1510 is satisfied, the video decoding device determines whether the condition "lfnst_idx=0 && transform_skip_flag=0 && cbW<32 && cbH<32 && intra_subpartitions_mode_flag=0 && cu_sbt_flag=0" is satisfied (S1520).

[0204] Here, the lfnst_idx value indicates the secondary transformation, and when lfnst_idx=0, it means that the secondary transformation is not used.

[0205] The transform_skip_flag value indicates whether transform skip is applied to the current block, i.e., whether the transform process is skipped for the current block. When transform_skip_flag=0, it indicates that transform skip is not applied to the current block.

[0206] cbW and cbH respectively indicate the width and height of the current block. As described above, the maximum size supported by the default transform DCT-II is 64×64, and the maximum size supported by the additional transforms DST-7 and DCT-8 is 32×32. For example, if the size of the block to be decoded is 64×64, one 64×64 DCT-II is applied to the transformation process. That is, if one or more of the width and height of the block to be decoded is greater than 32 (exceeds 32), the default transform (*) is applied immediately without applying MTS. Therefore, in order for MTS to be applied, the values ​​of cbW and cbH must all be 32 or less.

[0207] The intra_subpartitions_mode_flag indicates whether an intra subpartition mode is applied. The intra subpartition mode is one of intra prediction methods, and indicates that a current block is divided into a number of sub-blocks and undergoes prediction, transformation, and quantization processes. That is, when the flag value (intra_subpartitions_mode_flag) is '0', it means that general intra prediction is performed without dividing the current block into sub-blocks.

[0208] Cu_sbt_flag indicates whether or not a sub-block transform in which only a part of the current block undergoes a transform process is applied. That is, when the cu_sbt_flag value is “0”, it means that a sub-block transform in which only a part of the current block undergoes a transform process is not applied.

[0209] Therefore, depending on whether the condition in step S1520 is satisfied, it may be determined whether explicit MTS is applicable to the block to be decoded.

[0210] If the condition of step S1510 is not met, the video decoding apparatus sets the value of mts_idx to “0” (S1530) and ends the process.

[0211] If the condition of step S1520 is satisfied, the video decoding device determines whether the condition "MtsZeroOutFlag=1 && MtsDcOnlyFlag=0" is satisfied (S1540).

[0212] The MtsZerooutFlag indicates whether a non-zero coefficient in a block is in a zero-out region. If at least one of the non-zero coefficients in a block is in a zero-out region, MtsZerooutFlag may have a value of "0", and if all of the non-zero coefficients in a block are not in a zero-out region, MtsZerooutFlag may have a value of "1". In this case, the value of MtsZerooutFlag may be determined by performing the process of FIG. 13 or FIG. 14.

[0213] MtsDcOnlyFlag indicates whether there is one nonzero coefficient in a block and its position is DC. If there is one nonzero coefficient in a block and its position is DC, the MtsDcOnlyFlag has a value of "1", otherwise, the MtsDcOnlyFlag has a value of "0". In this case, the value of MtsDcOnlyFlag may be determined by performing the process of FIG. 17.

[0214] On the other hand, if the condition of step S1520 is not satisfied, the video decoding apparatus sets the value of mts_idx to “0” (S1530) and ends the process.

[0215] If the condition of step S1540 is satisfied, the video decoding apparatus parses mts_idx (S1550) and ends the process. At this time, the horizontal axis and vertical axis transform types according to the value of mts_idx may be assigned according to Table 5. At this time, the transform type values ​​in Table 5 refer to the trType values ​​in Table 2. For example, when the mts_idx value is "2", DCT-8 may be applied for horizontal axis transform and DST-7 may be applied for vertical axis transform.

[0216] Also, if the condition in step S1540 is not satisfied, the video decoding apparatus sets the value of mts_idx to “0” (S1530) and ends the process.

[0217] 16 is a diagram illustrating a method for performing an inverse transform based on transform-related parameters according to another embodiment of the present invention. Each step of FIG. 16 may be performed in a video decoding device, for example, in an inverse transform unit of the decoding device.

[0218] 16, the video decoding apparatus obtains values ​​of sps_explicit_mts_intra_enable_flag, sps_explicit_mts_inter_enable_flag, CuPredMode, lfnst_idx, transform_skip_flag, cbW, cbH, intra_subpartitions_mode_flag, and cu_sbt_flag (S1610). At this time, what each of sps_explicit_mts_intra_enable_flag, sps_explicit_mts_inter_enable_flag, CuPredMode, lfnst_idx, transform_skip_flag, cbW, cbH, intra_subpartitions_mode_flag, and cu_sbt_flag indicates is explained in detail in the related description of FIG. 15, and the parameters are used to determine whether explicit MTS can be applied to the block to be decoded.

[0219] Next, the video decoding apparatus obtains the values ​​of MtsZerooutFlag and MtsDcOnlyFlag (S1620). At this time, the MtsZerooutFlag can be obtained by performing the process of FIG. 13 or 14, and the MtsDcOnlyFlag can be obtained by performing the process of FIG.

[0220] Next, the video decoding device obtains an mts_idx value based on the parameters obtained in steps S1610 and S1620 (S1630). That is, the video decoding device obtains the mts_idx value based on sps_explicit_mts_intra_enable_flag, sps_explicit_mts_inter_enable_flag, CuPredMode, lfnst_idx, transform_skip_flag, cbW, cbH, intra_subpartitions_mode_flag, cu_sbt_flag, MtsZerooutFlag, and MtsDcOnlyFlag. At this time, mts_idx may be obtained by performing the process of FIG. 15.

[0221] Next, the video decoding apparatus performs inverse transform based on mts_idx (S1640). The inverse transform applied according to the mts_idx value may be configured according to Table 5 and Table 2. For example, when the mts_idx value is "2", DCT-8 may be applied in the horizontal axis direction, and DST-7 may be applied in the vertical axis direction.

[0222] Meanwhile, although not shown, from the viewpoint of the video encoding device, sps_explicit_mts_intra_enable_flag, sps_explicit_mts_inter_enable_flag, CuPredMode, lfnst_idx, transform_skip_flag, cbW, cbH, intra_subpartitions_mode_flag, cu_sbt_flag, MtsZerooutFlag, and MtsDcOnlyFlag can be set to set whether to use explicit MTS. In the above-described embodiment, the method is described with reference to a flow chart as a series of steps or blocks, but the present invention is not limited to the order of steps, and a step may occur in a different order or simultaneously with a different step than described above. In addition, those skilled in the art will understand that the steps shown in the flow chart are not exclusive and other steps may be included, or one or more steps of the flow chart may be omitted without affecting the scope of the present invention.

[0223] The embodiments described in this document may be implemented and performed on a processor, a microprocessor, a controller, or a chip. For example, the functional units shown in each drawing may be implemented and performed on a computer, a processor, a microprocessor, a controller, or a chip. In this case, information for implementation (e.g., instruction information) or algorithms may be stored in a digital storage medium.

[0224] In addition, the decoding device and encoding device to which the present invention is applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interactive device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a video on demand (VoD) service providing device, an OTT video (Over the top video) device, an Internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, a means of transportation terminal (e.g., a vehicle terminal, an airplane terminal, a ship terminal, etc.), a medical video device, etc., and may be used to process a video signal or a data signal. For example, an OTT video (Over the Top video) device may be a game console, a Blu-ray player, an Internet-connected TV, a home theater system, a smartphone, a tablet PC, a DVR (Digital Video Recorder), etc.

[0225] In addition, the processing method to which the present invention is applied may be produced in the form of a program executed by a computer and may be stored in a computer-readable storage medium. Multimedia data having a data structure according to the present invention may also be stored in a computer-readable storage medium. The computer-readable storage medium includes any kind of storage device and distributed storage device in which computer-readable data is stored. The computer-readable storage medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable storage medium includes a medium realized in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bit stream generated by the encoding method may be stored in a computer-readable storage medium or transmitted via a wired or wireless communication network.

[0226] Furthermore, embodiments of the present invention may be implemented in a computer program product by program code, which may be executed on a computer according to embodiments of the present invention. The program code may be stored on a computer readable carrier.

Claims

1. A video decoding method performed by a video decoding device, comprising: obtaining a parameter from the bitstream indicating whether a Multiple Transform Set (MTS) is applicable to the block to be decoded; determining a type of transform to be applied to the block to be decoded based on at least one of a parameter indicating whether a set of multiple transforms is applicable to the block to be decoded and a size of the block to be decoded; setting a validity region including non-zero coefficients of the block to be decoded based on at least one of a parameter indicating whether a multiple transformation set for the block to be decoded is applicable and a size of the block to be decoded; and Reconstructing the block to be decoded based on a transform type applied to the block to be decoded and a valid region including non-zero coefficients of the block to be decoded; When the size of the block to be decoded is any one of width 64×height 64, width 64×height 32, and width 32×height 64, a valid area including non-zero coefficients of the block to be decoded is set to a width 32×height 32 area including an upper left sample in the block to be decoded, regardless of a value of a parameter indicating whether a multiple transform set is applicable to the block to be decoded; A video decoding method, characterized in that, when the size of the block to be decoded is any one of 32 width x 32 height, 32 width x 16 height, and 16 width x 32 height, a valid area including non-zero coefficients of the block to be decoded is set to an area having a different size depending on the value of the parameter indicating whether or not a multiple transformation set is applicable to the block to be decoded.

2. A video encoding method performed by a video encoding device, comprising: determining whether a Multiple Transform Set (MTS) is applicable to the encoding target block based on a size of the encoding target block; determining a valid region including a non-zero coefficient for the block to be coded based on at least one of whether a multiple transformation set for the block to be coded is applicable and the size of the block to be coded; determining a type of transformation to be applied to the block to be coded based on a significant region containing non-zero coefficients for the block to be coded; generating a bitstream including at least one of a parameter indicating whether a set of multiple transforms is applicable to the block to be coded and a parameter indicating a type of transform to be applied to the block to be coded; when the size of the encoding target block is any one of width 64×height 64, width 64×height 32, and width 32×height 64, a valid area including nonzero coefficients of the encoding target block is a width 32×height 32 area including an upper left sample in the encoding target block, A video coding method characterized in that, when the size of the block to be coded is any one of 32 width x 32 height, 32 width x 16 height, or 16 width x 32 height, a valid area including non-zero coefficients of the block to be coded is determined by the value of a parameter indicating whether a multiple transformation set is applicable.

3. A method for transmitting a bitstream encoded by the video encoding method described in claim 2, the method including a step of transmitting the bitstream.

Citation Information

Patent Citations

  • Method for encoding / decoding video signals and apparatus therefor

    WO2020060364A1