Image encoding / decoding method, bitstream transmission method, and recording medium storing the bitstream

The image encoding/decoding method addresses inefficiencies in high-resolution image processing by determining a transform kernel based on intra prediction modes, enhancing transformation efficiency.

JP2026500798APending Publication Date: 2026-01-08HYUNDAI MOTOR CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2025539627
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-02
Filing Date
2024-01-02
Publication Date
2026-01-08

AI Technical Summary

Technical Problem

Existing image encoding/decoding technologies are inefficient for high-resolution, high-quality images due to limitations in transformation processes, particularly in intra template matching modes, which do not consider the characteristics of current coding units.

Method used

An image encoding/decoding method that determines a transform kernel based on an induced intra prediction mode, using methods like decoder-side intra mode derivation, template-based intra mode derivation, and intra-template matching, to improve transformation efficiency.

Benefits of technology

Enhances encoding/decoding efficiency by selecting a more suitable transformation kernel, thereby improving the transformation process for high-resolution images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026500798000001_ABST
    Figure 2026500798000001_ABST
Patent Text Reader

Abstract

An image encoding / decoding method and a bitstream transmission method with improved encoding / decoding efficiency, and a recording medium for storing the bitstream, are provided. [Solution] The image decoding method of the present invention includes a step of determining a transform kernel for a current block and a step of performing an inverse transform on the current block based on the transform kernel, and further includes a step of deriving an intra prediction mode for the current block if the current block is in intra template matching mode, where the transform kernel is determined based on the induced intra prediction mode.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to an image encoding / decoding method, a bitstream transmission method, and a recording medium storing a bitstream, and more particularly to an image encoding / decoding method, a bitstream transmission method, and a recording medium storing a bitstream, based on a method for generating a guided intra prediction mode in intra template matching and a method for determining a transformation kernel using the guided intra prediction mode. [Background technology]

[0002] Recently, demand for high-resolution, high-quality images, for example, UHD (Ultra High Definition) images, has been increasing in various fields. As image data becomes higher in resolution and quality, the amount of data increases relatively compared to existing image data. Therefore, when image data is transmitted using existing media such as wired / wireless broadband lines or stored using existing storage media, transmission costs and storage costs increase. To solve these problems that arise with the increase in resolution and quality of image data, a highly efficient image coding / decoding technology for images with higher resolution and image quality is required.

[0003] In a video encoding and decoding method and apparatus, intra template matching is an intra prediction mode (intra template matching prediction (intra TMP)) that performs template matching in a reconstructed area within a current screen to search for a block most similar to a current coding unit (CO) block (current coding block), and uses the searched block as a prediction block for the current coding unit block. In the intra template matching mode, a residual signal of a coding unit block (current coding block) is transformed using a transformation that has already been determined in the transformation process. That is, in the transformation process of a coding unit block in the intra template matching mode, characteristics of the current coding unit block are not taken into consideration, which may limit efficient transformation. Summary of the Invention [Problem to be solved by the invention]

[0004] The present invention has been made in consideration of the above-mentioned conventional problems, and an object of the present invention is to provide an image encoding / decoding method with improved encoding / decoding efficiency, a method for transmitting a bitstream generated by the image encoding method, and a non-transitory computer-readable recording medium storing a bitstream generated by the image encoding method. [Means for solving the problem]

[0005] In order to achieve the above object, an image decoding method according to one aspect of the present invention includes a step of determining a transform kernel for a current block and a step of performing an inverse transform on the current block based on the transform kernel, and if the current block is in an intra template matching mode, further includes a step of deriving an intra prediction mode for the current block, where the transform kernel is determined based on the induced intra prediction mode.

[0006] The intra prediction mode can be derived by a decoder-side intra mode derivation (DIMD) method. The DIMD method can be performed using a gradient histogram of the surrounding reference pixels of the current block. The intra prediction mode may be derived by a template-based intra mode derivation (TIMD) method. The TIMD method may be performed by selecting one of the candidate modes in an intra-prediction candidate list of the current block based on a template of the current block. The intra prediction mode can be derived using an intra template matching method. The intra-template matching method may be performed using a gradient histogram of pixels for a block corresponding to the current block. The transformation kernels may include at least one of a transformation kernel of a primary transformation and a transformation kernel of a secondary transformation. The transformation kernel may be a transformation kernel of a secondary transformation of the current block, and a transformation kernel of a primary transformation of the current block may be determined based on a transform unit size of the current block. The transformation kernel may be a transformation kernel of a primary transformation of the current block. The transform kernel may be a non-separable transform kernel that is selected based on an index corresponding to the induced intra-prediction mode. If the size of the current block is smaller than a predetermined size, the transformation kernel may be a transformation kernel of a non-separable primary transformation of the current block.

[0007] In order to achieve the above object, an image encoding method according to one aspect of the present invention includes a step of determining a transformation kernel for a current block and a step of performing a transformation on the current block based on the transformation kernel, and if the current block is in an intra template matching mode, further includes a step of inducing an intra prediction mode for the current block, where the transformation kernel is determined based on the induced intra prediction mode.

[0008] In order to achieve the above object, a non-transitory computer-readable recording medium storing a bitstream generated by an image encoding method according to one aspect of the present invention is provided, wherein the image encoding method includes a step of determining a transform kernel for a current block and a step of performing a transform on the current block based on the transform kernel, and if the current block is in an intra template matching mode, further includes a step of inducing an intra prediction mode for the current block, wherein the transform kernel is determined based on the induced intra prediction mode.

[0009] In order to achieve the above object, a bitstream transmission method generated by an image encoding method according to one aspect of the present invention includes a step of transmitting the bitstream, the encoding method having a step of determining a transform kernel for a current block and a step of performing a transform on the current block based on the transform kernel, and if the current block is in an intra template matching mode, further includes a step of inducing an intra prediction mode for the current block, wherein the transform kernel is determined based on the induced intra prediction mode.

[0010] The features of the present invention described above in this brief summary are merely exemplary embodiments of the detailed description of the present invention that follows and are not intended to limit the scope of the present invention. [Effects of the Invention]

[0011] According to the present invention, it is possible to provide an image encoding / decoding method and device with improved encoding / decoding efficiency.

[0012] In addition, according to the present invention, a method can be provided in which an intra prediction mode of a current block, which is an intra template matching mode (intra prediction mode), is induced, and then a transform kernel is selected and transformed based on the induced intra prediction mode.

[0013] Furthermore, according to the present invention, a more suitable transformation kernel can be determined, thereby improving the transformation efficiency.

[0014] The effects obtained by the present invention are not limited to those described above, and other effects not described above will be clearly understood by those having ordinary skill in the art to which the present invention pertains from the following description. [Brief explanation of the drawings]

[0015] [Figure 1] 1 is a block diagram showing the configuration of an embodiment of an encoding device to which the present invention is applied. [Figure 2] 1 is a block diagram showing the configuration of an embodiment of a decoding device to which the present invention is applied. [Figure 3] 1 is a diagram illustrating a video coding system to which the present invention is applied; [Figure 4] 10A and 10B are diagrams illustrating intra-template matching according to an embodiment of the present invention. [Figure 5] 10 is a flowchart illustrating a method for determining a transformation kernel of a primary transformation and a transformation kernel of a secondary transformation in intra template matching according to an embodiment of the present invention. [Figure 6] 10 is a flowchart illustrating a method for determining a transformation kernel of a primary transformation and a transformation kernel of a secondary transformation in intra template matching according to an embodiment of the present invention. [Figure 7]10 is a flowchart illustrating a method for determining a transformation kernel of a primary transformation and a transformation kernel of a secondary transformation in intra template matching according to an embodiment of the present invention. [Figure 8] 10 is a flowchart illustrating a method for determining a transformation kernel of a primary transformation and a transformation kernel of a secondary transformation in intra template matching according to an embodiment of the present invention. [Figure 9] 1 is a flowchart illustrating a method for determining a transformation kernel of a non-separable primal transformation in intra template matching according to an embodiment of the present invention. [Figure 10] 1 is a flowchart illustrating a method for determining a transformation kernel of a non-separable primary transformation and a transformation kernel of a secondary transformation in intra template matching according to an embodiment of the present invention. [Figure 11] 1 is a flowchart illustrating a method for selectively using a primary transform, a non-separable primary transform, and a secondary transform according to an embodiment of the present invention. [Figure 12] 2 is a flowchart illustrating an image decoding method according to an embodiment of the present invention. [Figure 13] 1 is a diagram illustrating an exemplary content streaming system to which an embodiment in accordance with the present invention may be applied; DETAILED DESCRIPTION OF THE INVENTION

[0016] While the present invention is susceptible to various modifications and can have various embodiments, specific embodiments will be illustrated in the drawings and described in detail in the detailed description. However, this does not limit the present invention to the specific embodiments, but rather should be understood to include all modifications, equivalents, or alternatives within the spirit and scope of the present invention. Similar reference symbols in the figures indicate the same or similar functions throughout the various aspects. The shapes and sizes of elements in the drawings may be provided for illustrative purposes for clearer explanation. The detailed description of the exemplary embodiments below will refer to the drawings, which show specific embodiments by way of example. These embodiments will be described in sufficient detail to enable those skilled in the art to practice the embodiments. It should be understood that the various embodiments, although different from one another, are not necessarily mutually exclusive. For example, specific shapes, structures, and characteristics described in this specification with respect to one embodiment may be implemented in other embodiments without departing from the spirit and scope of the present invention. It should also be understood that the location or arrangement of individual components within each disclosed embodiment can be changed without departing from the spirit and scope of the present invention. Accordingly, the following detailed description is not intended to be taken in a limiting sense, and the scope of the exemplary embodiments is limited only by the claims, if properly recited, along with the full scope of equivalents to which the claims are entitled.

[0017] In the present invention, terms such as "first" and "second" are used to describe various components, but these components should not be limited by these terms. These terms are used only to distinguish one component from another. For example, a first component may be referred to as a second component, and similarly, a second component may be referred to as a first component, without departing from the scope of the present invention. The term "and / or" includes a combination of two or more related listed items or any of two or more related listed items.

[0018] The components shown in the embodiments of the present invention are shown independently to represent different characteristic functions, and do not mean that each component is composed of separate hardware or a single software unit. That is, each component is listed and included as a separate component for the convenience of explanation, and at least two of the components may be combined to form a single component, or one component may be divided into multiple components to perform a function. Such integrated and separated embodiments of each component are also included in the scope of the present invention as long as they do not deviate from the essence of the present invention.

[0019] The terms used in the present invention are merely used to describe specific embodiments and are not intended to limit the present invention. The singular expressions include the plural expressions unless the context clearly dictates otherwise. Furthermore, some components of the present invention may not be essential components performing essential functions of the present invention, but may be optional components merely for improving performance. The present invention may be realized by including only components essential for achieving the essence of the present invention, excluding components used merely for improving performance. A structure including only essential components, excluding optional components used merely for improving performance, is also within the scope of the present invention.

[0020] In embodiments, the term "at least one" may mean one of a number greater than or equal to 1, such as 1, 2, 3, and 4. The term "a plurality of" in embodiments may mean one of a number greater than or equal to 2, such as 2, 3, and 4.

[0021] Hereinafter, specific examples of embodiments of the present invention will be described in detail with reference to the drawings.

[0022] When describing embodiments of the present invention, if it is determined that a specific description of related known structures or functions may obscure the gist of the present invention, the detailed description will be omitted, and the same reference symbols will be used for the same components in the drawings, and duplicate descriptions of the same components will be omitted.

[0023] <Terminology>

[0024] Hereinafter, "image" can mean one picture constituting a video, and can also refer to the video itself. For example, "encoding and / or decoding of an image" can mean "encoding and / or decoding of a video," and can also mean "encoding and / or decoding of one of the images constituting a video."

[0025] Hereinafter, the terms "moving image" and "video" may be used interchangeably. A target image refers to a target image to be coded and / or a target image to be decoded. A target image refers to an input image input to an encoding device and an input image input to a decoding device. Here, the target image may have the same meaning as a current image.

[0026] In the following, the terms encoder and image encoding device may be used interchangeably and interchangeably.

[0027] In the following, decoder and image decoding device are used synonymously and can be used interchangeably.

[0028] In the following, the terms "image", "picture", "frame" and "screen" are used interchangeably and may be used interchangeably.

[0029] Hereinafter, a "current block" refers to a current block that is currently being coded and / or a current block that is currently being decoded. For example, the terms "current block" and "current block" may be used interchangeably.

[0030] Hereinafter, the terms "block" and "unit" may be used interchangeably. Furthermore, "unit" may refer to a luma component block and its corresponding chroma component block, distinguishing it from a block. For example, a coding tree unit (CTU) is composed of two chroma component (Cb, Cr) coding tree blocks associated with one luma component (Y) coding tree block (CTB).

[0031] In the following, the terms "sample", "picture element" and "pixel" are used interchangeably and may be used interchangeably, where a sample represents the basic unit that makes up a block.

[0032] Hereinafter, "inter" and "inter-screen" are used interchangeably and may be used interchangeably.

[0033] Hereinafter, the terms "intra" and "intra-screen" are used interchangeably and may be used interchangeably.

[0034] FIG. 1 is a block diagram showing the configuration of an embodiment of an encoding device to which the present invention is applied.

[0035] The encoding device 100 is an encoder, a video encoding device, or an image encoding device. A video can include one or more images. The encoding device 100 can encode one or more images sequentially.

[0036] Referring to FIG. 1, the encoding device 100 may include an image division unit 110, an intra prediction unit 120, a motion prediction unit 121, a motion compensation unit 122, a switch 115, a subtractor 113, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 117, a filter unit 180, and a reference picture buffer 190.

[0037] The encoding device 100 may also generate a bitstream including encoded information through encoding of the input image and output the generated bitstream. The generated bitstream may be stored in a computer-readable recording medium or may be streamed via a wired / wireless transmission medium.

[0038] The image division unit 110 can divide an input image into various forms to improve video encoding / decoding efficiency. That is, an input video is composed of multiple pictures, and each picture can be hierarchically divided and processed for compression efficiency, parallel processing, etc. For example, a picture can be divided into one or more tiles or slices, and then further divided into multiple coding tree units (CTUs). Alternatively, a picture can be first divided into multiple sub-pictures defined as groups of rectangular slices, and each sub-picture can then be divided into tiles / slices. Here, sub-pictures are used to support the function of partially independently encoding / decoding and transmitting a picture. Since multiple sub-pictures can be individually restored, this has the advantage of facilitating editing in applications where multi-channel input is composed into a single picture. In addition, tiles can be divided horizontally to generate bricks. Here, bricks are used as the basic unit of intra-picture parallel processing. Furthermore, one CTU may be recursively partitioned into a quadtree (QT), and the terminal node of the partition may be defined as a coding unit (CU). The CU may be partitioned into prediction units (PU), which are prediction units, and transform units (TU), which are transformation units, and prediction and partitioning may be performed thereon. Meanwhile, the CU may be utilized as a prediction unit and / or a transformation unit. Here, for flexible partitioning, each CTU may be recursively partitioned into not only a quadtree (QT) but also a multi-type tree (MTT). The CTU may start by being partitioned into a multi-type tree at the terminal node of the QT, and the MTT may be composed of a binary tree (BT) and a triple tree (TT). For example, the MTT structure may be classified into a vertical binary partitioning mode (SPLIT_BT_VER), a horizontal binary partitioning mode (SPLIT_BT_HOR), a vertical ternary partitioning mode (SPLIT_TT_VER), and a horizontal ternary partitioning mode (SPLIT_TT_HOR).In addition, during partitioning, the minimum block size (MinQTSize) of the quad tree of the luma block is set to 16x16, the maximum block size (MaxBtSize) of the binary tree is set to 128x128, and the maximum block size (MaxTtSize) of the triple tree is set to 64x64. The minimum block size (MinBtSize) of the binary tree and the minimum block size (MinTtSize) of the triple tree may be set to 4x4, and the maximum depth (MaxMttDepth) of the multi-type tree may be set to 4. To improve the coding efficiency of I slices, a dual tree may be applied, in which the luma and chroma components have different CTU partition structures. Meanwhile, in P and B slices, the luma and chroma coding tree blocks (CTBs) in a CTU may be partitioned into a single tree that shares a coding tree structure.

[0039] The encoding device 100 may encode an input image in intra mode and / or inter mode. Alternatively, the encoding device 100 may encode an input image in a third mode (e.g., IBC mode, Palette mode, etc.) instead of the intra mode and inter mode. However, if the third mode has similar functional features to the intra mode or inter mode, it may be classified as the intra mode or the inter mode for convenience of explanation. In the present invention, the third mode will be separately classified and described only when a detailed description of the third mode is necessary.

[0040] When an intra mode is used as a prediction mode, the switch 115 may be switched to intra, and when an inter mode is used as a prediction mode, the switch 115 may be switched to inter. Here, the intra mode may refer to an intra-frame prediction mode, and the inter mode may refer to an inter-frame prediction mode. The encoding device 100 may generate a prediction block for an input block of an input image. After the prediction block is generated, the encoding device 100 may encode a residual block using a difference (residual) between the input block and the prediction block. The input image may be referred to as a current image currently being encoded. The input block may be referred to as a current block currently being encoded or a block to be encoded.

[0041] When the prediction mode is the intra mode, the intra prediction unit 120 can use samples of already coded / decoded blocks surrounding the current block as reference samples. The intra prediction unit 120 can perform spatial prediction on the current block using the reference samples and generate prediction samples for the input block through the spatial prediction. Here, intra prediction can refer to intra-frame prediction.

[0042] As the intra prediction method, a non-directional prediction mode such as a DC mode or a planar mode and a directional prediction mode (e.g., 65 directions) may be applied. Here, the intra prediction method may be expressed as an intra prediction mode or an intra-frame prediction mode.

[0043] When the prediction mode is inter mode, the motion prediction unit 121 may search for a region that best matches the input block from a reference image during the motion prediction process, and may derive a motion vector using the searched region. In this case, a search region may be used as the region. The reference image may be stored in the reference picture buffer 190. Here, the reference image may be stored in the reference picture buffer 190 when encoding / decoding is processed.

[0044] The motion compensation unit 122 may generate a prediction block for the current block by performing motion compensation using the motion vector. Here, inter prediction may refer to inter prediction or motion compensation.

[0045] The motion prediction unit 121 and the motion compensation unit 122 may generate a prediction block by applying an interpolation filter to a part of a reference image when the value of a motion vector does not have an integer value. To perform inter-frame prediction or motion compensation, it may determine, based on a coding unit, whether the motion prediction and motion compensation method of a prediction unit included in the coding unit is a skip mode, a merge mode, an advanced motion vector prediction (AMVP) mode, or an intra block copy (IBC) mode, and perform inter-frame prediction or motion compensation according to each mode.

[0046] In addition, based on the inter-frame prediction method, sub-PU-based prediction AFFINE mode, SbTMVP (Subblock-based Temporal Motion Vector Prediction) mode, and PU-based prediction MMVD (Merge with MVD) mode and GPM (Geometric Partitioning Mode) mode can be applied. In addition, to improve the performance of each mode, HMVP (History-based MVP), PAMVP (Pairwise Average MVP), CIIP (Combined Intra / Inter Prediction), AMVR (Adaptive Motion Vector Resolution), BDOF (Bi-Directional Optical-Flow), BCW (Bi-predictive with CU Weight), LIC (Local Illumination Compensation), TM (Template Matching), OBMC (Overlapped Block Motion Compensation), etc. can also be applied.

[0047] Among these, AFFINE mode is used in both AMVP mode and MERGE mode and is a technology with high coding efficiency. Conventional video coding standards perform motion compensation (MC) by considering only the translation of blocks, which means that they are unable to properly compensate for real-world motions such as zoom in / out and rotation. To address this issue, a four-parameter affine motion model using two control point motion vectors (CPMVs) and a six-parameter affine motion model using three control point motion vectors can be applied to inter-prediction. Here, CPMV is a vector that represents the affine motion model for one of the top left, top right, or bottom left corners of the current block.

[0048] The subtractor 113 may generate a residual block using the difference between the input block and the predicted block. The residual block may also be called a residual signal. The residual signal may refer to the difference between the original signal and the predicted signal. Alternatively, the residual signal may be a signal generated by transforming, quantizing, or transforming and quantizing the difference between the original signal and the predicted signal. The residual block is a block-by-block residual signal.

[0049] The transform unit 130 may perform a transform on the residual block to generate transform coefficients and output the generated transform coefficients. Here, the transform coefficients are coefficient values ​​generated by performing a transform on the residual block. When a transform skip mode is applied, the transform unit 130 may skip transforming the residual block.

[0050] Quantization may be applied to the transform coefficients or the residual signal to generate quantized levels, which may also be referred to as transform coefficients hereinafter, depending on the embodiment.

[0051] For example, a 4x4 luminance residual block generated through intra prediction may be transformed using a Discrete Sine Transform (DST)-based basis vector, and the remaining residual blocks may be transformed using a Discrete Cosine Transform (DCT)-based basis vector. In addition, a Residual Quad Tree (RQT) technique may be used to divide transform blocks into a quad tree format for one block, and after transforming and quantizing each divided transform block through the RQT, a coded block flag (cbf) may be transmitted to improve coding efficiency when all coefficients become 0.

[0052] As another alternative, a Multiple Transform Selection (MTS) technique may be applied, which selectively uses several transform bases to perform transformation. That is, instead of dividing a CU into TUs through RQT, a function similar to TU division may be performed through a Sub-block Transform (SBT) technique. Specifically, SBT is applied only to inter-predicted blocks, and unlike RQT, it divides a current block vertically or horizontally into 1 / 2 or 1 / 4 size, and then performs transformation on only one of the blocks. For example, if the current block is divided vertically, transformation may be performed on the leftmost or rightmost block, and if the current block is divided horizontally, transformation may be performed on the topmost or bottommost block.

[0053] Alternatively, a low frequency non-separable transform (LFNST) can be applied, which is a secondary transform technique that further transforms the residual signal transformed into the frequency domain through the DCT or DST. The LFNST can concentrate the residual coefficients at the upper left corner by further transforming the 4x4 or 8x8 low frequency region at the upper left corner.

[0054] The quantization unit 140 may generate quantization levels by quantizing transform coefficients or residual signals according to a quantization parameter (QP), and may output the generated quantization levels. In this case, the quantization unit 140 may quantize the transform coefficients using a quantization matrix.

[0055] As an example, a quantizer using QP values ​​from 0 to 51 can be used. Alternatively, when the image size is larger and high coding efficiency is required, QP values ​​from 0 to 63 can be used. Also, a DQ (Dependent Quantization) method using two quantizers instead of one can be applied. DQ performs quantization using two quantizers (Q0, Q1, etc.), but can be applied so that the quantizer to be used for the next transform coefficient is selected based on the current state via a state transition model without signaling information regarding the use of a specific quantizer.

[0056] The entropy coding unit 150 may generate a bitstream by performing entropy coding according to a probability distribution on values ​​calculated by the quantization unit 140 or coding parameter values ​​calculated during the coding process, and may output the bitstream. The entropy coding unit 150 may perform entropy coding on information regarding image samples and information for decoding the image. For example, the information for decoding the image may include syntax elements.

[0057] When entropy coding is applied, fewer bits are assigned to symbols with higher occurrence probabilities and more bits are assigned to symbols with lower occurrence probabilities to represent the symbols, thereby reducing the size of the bit string for the symbol to be coded. The entropy coding unit 150 can use coding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC) for entropy coding. For example, the entropy coding unit 150 can perform entropy coding using a variable length coding / code (VLC) table. The entropy coding unit 150 can also derive a binarization method for the target symbol and a probability model for the target symbol / bin, and then perform arithmetic coding using the derived binarization method, probability model, and context model.

[0058] In this regard, when applying CABAC, the table probability update method can be modified to a table update method using a simple formula in order to reduce the size of the probability table stored in the decoder. Furthermore, two different probability models can be used to obtain more accurate symbol probability values.

[0059] The entropy coding unit 150 can convert two-dimensional block shape coefficients into one-dimensional vector shape coefficients through a transform coefficient scanning method in order to code the transform coefficient levels (quantization levels).

[0060] Coding parameters can include not only information (flags, indexes, etc.) that is coded in the coding device 100 and signaled to the decoding device 200, like syntax elements, but also information that is induced during the coding or decoding process, and can refer to information required when coding or decoding an image.

[0061] Here, signaling a flag or index can mean that an encoder entropy encodes the flag or index and includes it in a bitstream, and a decoder entropy decodes the flag or index from the bitstream.

[0062] The encoded current image can be used as a reference image for other images to be processed thereafter. Therefore, the encoding device 100 can restore or decode the encoded current image again and store the restored or decoded image in the reference picture buffer 190 as a reference image.

[0063] The quantization levels may be dequantized by the inverse quantization unit 160 and inverse transformed by the inverse transform unit 170. The inverse quantized and / or inverse transformed coefficients may be combined with a prediction block via an adder 117, and a reconstructed block may be generated by combining the inverse quantized and / or inverse transformed coefficients with the prediction block. Here, the inverse quantized and / or inverse transformed coefficients refer to coefficients that have undergone at least one of inverse quantization and inverse transformation, and may refer to a reconstructed residual block. The inverse quantization unit 160 and the inverse transform unit 170 may be performed in reverse to the quantization unit 140 and the transform unit 130.

[0064] The reconstructed blocks may pass through the filter unit 180. The filter unit 180 may apply a deblocking filter, a sample adaptive offset (SAO), an adaptive loop filter (ALF), a bilateral filter (BIF), luma mapping with chroma scaling (LMCS), etc. as a filtering technique to the reconstructed samples, the reconstructed blocks, or the reconstructed image in whole or in part. The filter unit 180 may also be referred to as an in-loop filter. In this case, the in-loop filter may also be used as a name excluding LMCS.

[0065] The deblocking filter can remove block artifacts that occur at boundaries between blocks. To determine whether to perform the deblocking filter, it can be determined whether to apply the deblocking filter to the current block based on samples included in several columns or rows included in the block. When applying the deblocking filter to a block, different filters can be applied depending on the required deblocking filtering strength.

[0066] To compensate for coding errors using sample adaptive offset, an appropriate offset value can be added to a sample value. Sample adaptive offset can correct the offset between a deblocked image and an original image on a sample-by-sample basis. After dividing the samples included in the image into a certain number of regions, the region to be offset is determined and the offset is applied to that region. Alternatively, the offset can be applied by taking into account edge information of each sample.

[0067] A bilateral filter (BIF) can also correct the offset between the deblocked image and the original image on a sample-by-sample basis.

[0068] The adaptive loop filter can perform filtering based on a value obtained by comparing the restored image with the original image. After dividing the samples included in the image into predetermined groups, a filter to be applied to each group can be determined, and filtering can be performed differentially for each group. Information related to whether to apply an adaptive loop filter can be signaled for each coding unit (CU), and the shape and filter coefficients of the adaptive loop filter to be applied vary depending on each block.

[0069] In LMCS (Luma Mapping with Chroma Scaling), luma mapping (LM) refers to remapping luminance values ​​through a piecewise linear model, and chroma scaling (CS) refers to scaling the residual values ​​of chrominance components according to the average luminance value of a predicted signal. In particular, LMCS can be used as an HDR (High Dynamic Range) correction technology that reflects the characteristics of HDR images.

[0070] The reconstructed blocks or images that have passed through the filter unit 180 may be stored in the reference picture buffer 190. The reconstructed blocks that have passed through the filter unit 180 are part of a reference image. In other words, a reference image is a reconstructed image made up of the reconstructed blocks that have passed through the filter unit 180. The stored reference image may then be used for inter prediction or motion compensation.

[0071] FIG. 2 is a block diagram showing the configuration of an embodiment of a decoding device to which the present invention is applied.

[0072] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.

[0073] Referring to FIG. 2, the decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra prediction unit 240, a motion compensation unit 250, an adder 201, a switch 203, a filter unit 260, and a reference picture buffer 270.

[0074] The decoding apparatus 200 may receive a bitstream output from the encoding apparatus 100. The decoding apparatus 200 may receive a bitstream stored in a computer-readable recording medium or a bitstream streamed via a wired / wireless transmission medium. The decoding apparatus 200 may perform decoding on the bitstream in an intra mode or an inter mode. The decoding apparatus 200 may also generate a reconstructed image or a decoded image through decoding and output the reconstructed image or the decoded image.

[0075] If the prediction mode used for decoding is an intra mode, the switch 203 may be switched to intra. If the prediction mode used for decoding is an inter mode, the switch 203 may be switched to inter.

[0076] The decoding apparatus 200 may decode an input bitstream to obtain a reconstructed residual block and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding apparatus 200 may generate a reconstructed block to be decoded by adding the reconstructed residual block and the prediction block. The block to be decoded may be referred to as a current block.

[0077] The entropy decoding unit 210 generates symbols by performing entropy decoding on the bitstream according to a probability distribution. The generated symbols may include symbols in the form of quantization levels. Here, the entropy decoding method is the reverse process of the entropy encoding method described above.

[0078] The entropy decoding unit 210 can convert one-dimensional vector-shaped coefficients into two-dimensional block-shaped coefficients through a transform coefficient scanning method in order to decode the transform coefficient levels (quantization levels).

[0079] The quantization levels may be inverse quantized by the inverse quantization unit 220 and inverse transformed by the inverse transform unit 230. The quantization levels are the result of inverse quantization and / or inverse transformation, and may be generated as reconstructed residual blocks. In this case, the inverse quantization unit 220 may apply a quantization matrix to the quantization levels. The inverse quantization unit 220 and the inverse transform unit 230 applied to the decoding device may apply the same techniques as the inverse quantization unit 160 and the inverse transform unit 170 applied to the encoding device described above.

[0080] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction on the current block using sample values ​​of already decoded blocks surrounding the block to be decoded. The intra prediction unit 240 applied to the decoding device may apply the same technique as the intra prediction unit 120 applied to the encoding device described above.

[0081] When inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block using a motion vector and a reference image stored in the reference picture buffer 270. If the value of the motion vector does not have an integer value, the motion compensation unit 250 may generate a prediction block by applying an interpolation filter to a portion of the reference image. To perform motion compensation, the motion compensation unit 250 may determine, based on the coding unit, whether the motion compensation method of the prediction unit included in the coding unit is skip mode, merge mode, AMVP mode, or current picture reference mode, and perform motion compensation according to each mode. The motion compensation unit 250 applied to the decoding device may apply the same technique as the motion compensation unit 122 applied to the above-mentioned coding device.

[0082] The adder 201 may add the reconstructed residual block and the prediction block to generate a reconstructed block. The filter unit 260 may apply at least one of an Inverse-LMCS filter, a deblocking filter, a sample adaptive offset filter, an adaptive loop filter, etc. to the reconstructed block or the reconstructed image. The filter unit 260 applied to the decoding device may apply a filtering technique similar to that applied to the filter unit 180 applied to the encoding device described above.

[0083] The filter unit 260 may output a reconstructed image. The reconstructed blocks or the reconstructed image may be stored in the reference picture buffer 270 and used for inter prediction. The reconstructed blocks that have passed through the filter unit 260 are part of a reference image. In other words, a reference image is a reconstructed image made up of the reconstructed blocks that have passed through the filter unit 260. The stored reference image may then be used for inter prediction or motion compensation.

[0084] FIG. 3 is a diagram illustrating a schematic diagram of a video coding system to which the present invention can be applied.

[0085] The video coding system according to this embodiment may include an encoding device 10 and a decoding device 20. The encoding device 10 may transmit encoded video and / or image information or data to the decoding device 20 in a file or streaming format via a digital storage medium or a network.

[0086] The encoding device 10 according to this embodiment may include a video source generation unit 11, an encoding unit 12, and a transmission unit 13. The decoding device 20 according to this embodiment may include a reception unit 21, a decoding unit 22, and a rendering unit 23. The encoding unit 12 may be referred to as a video / image encoding unit, and the decoding unit 22 may be referred to as a video / image decoding unit. The transmission unit 13 may be included in the encoding unit 12. The reception unit 21 may be included in the decoding unit 22. The rendering unit 23 may also include a display unit, which may be configured as a separate device or an external component.

[0087] The video source generation unit 11 can acquire video / images through a video / image capture, synthesis, or generation process. The video source generation unit 11 can include a video / image capture device and / or a video / image generation device. The video / image capture device can include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. The video / image generation device can include, for example, a computer, a tablet, a smartphone, etc., and can (electronically) generate video / images. For example, virtual video / images can be generated via a computer, etc. In this case, a process in which related data is generated can replace the video / image capture process.

[0088] The encoding unit 12 can encode input video / images. The encoding unit 12 can perform a series of procedures such as prediction, transformation, and quantization for compression and encoding efficiency. The encoding unit 12 can output encoded data (encoded video / image information) in a bitstream format. The detailed configuration of the encoding unit 12 can also be configured similarly to the encoding device 100 of FIG. 1 described above.

[0089] The transmitter 13 may transmit the encoded video / image information or data output in a bitstream format to the receiver 21 of the decoding device 20 in a file or streaming format via a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, and SSD. The transmitter 13 may include elements for generating a media file in a predetermined file format and elements for transmission via a broadcasting / communication network. The receiver 21 may extract / receive the bitstream from the storage medium or network and transmit it to the decoder 22.

[0090] The decoding unit 22 can decode the video / image by performing a series of procedures such as inverse quantization, inverse transformation, and prediction corresponding to the operations of the encoding unit 12. The detailed configuration of the decoding unit 22 can also be configured similarly to the decoding device 200 shown in FIG.

[0091] The rendering unit 23 can render the decoded video / images, which can be displayed via the display unit.

[0092] This document describes an embodiment of a method for determining a transformation kernel for a current block in an intra template matching mode, where the transformation kernel is a transformation kernel of a primary transformation and / or a transformation kernel of a secondary transformation.

[0093] The primary transform according to an embodiment of the present invention may determine a transform kernel based on a multiple transform selection (MTS) set.

[0094] The secondary transform according to an embodiment of the present invention differs from the primary transform in that a non-separable kernel may be used instead of a horizontally and vertically separable kernel. Therefore, the secondary transform may be referred to as a low frequency non-separable transform (LFNST), and the transform kernel may be determined based on a low frequency non-separable transform (LFNST) set.

[0095] On the other hand, the primary transform according to an embodiment of the present invention can use a non-separable transform kernel, similar to the low-frequency non-separable transform (LFNST), which can be called a non-separable primary transform (NSPT).

[0096] Before describing a method for determining a transformation kernel for a current block, which is an intra template matching mode, intra template matching will be described.

[0097] Hereinafter, with reference to FIG. 4, a method for deriving an intra prediction mode for a current block encoded / decoded using intra template matching according to an embodiment of the present invention will be described.

[0098] In the present invention, intra template matching is an intra prediction method that performs template matching in a reconstructed region in a current picture to search for a block most similar to a current block, and derives the searched block as a predicted block for the current block. The intra prediction method that derives a predicted block for the current block based on the searched block may be defined as intra template matching prediction (Intra TMP).

[0099] FIG. 4 is a diagram illustrating intra template matching prediction according to an embodiment of the present invention.

[0100] 4, intra template matching prediction may determine an optimal prediction block for a current coding block 410 in a reconstructed area 430 in a current picture 400 based on the current coding block 410. Specifically, in intra template matching prediction, a set of reference pixels adjacent to the current coding block 410 may be defined as a current template 420. Then, a template matching-based search may be performed within the reconstructed area 430 based on the current template 420 to find a template 440 that is most similar to the current template 420, thereby determining a matching block 450. Here, the matching block 450 may be used as a prediction block for the current coding block 410.

[0101] Alternatively, template matching may be performed in the already defined regions (R1, R2, R3, R4) of the already restored region 430, with the search order being R1, R2, R3, R4.

[0102] Using the current coding block 410 and the matching block 450, a residual signal for the current coding block 410 in intra template matching mode is generated.

[0103] The transform kernel of the current block in the intra template matching mode may be determined based on the size of the current block or may be determined to be a predefined kernel. In this case, when applying a transform to the residual signal of the current block in the intra template matching mode, characteristics of the current block, such as intra prediction mode information, are not taken into consideration, which limits efficient transform execution.

[0104] To solve the above-mentioned problems, according to an embodiment of the present invention, an intra prediction mode for a current coding unit block may be derived using information on reference pixels adjacent to a current block, which is an intra template matching mode, or information on a block corresponding to the current block, and then a transform kernel may be determined based on the derived intra prediction mode. Here, the intra prediction mode may be derived using one of 1) a decoder-side intra prediction mode derivation (DIMD) method, 2) a template-based intra prediction mode derivation (TIMD) method, and 3) an intra prediction mode derivation method using intra template matching.

[0105] According to an embodiment of the present invention, the intra prediction mode of the current block, which is an intra template matching mode, may be derived using the DIMD method.

[0106] Specifically, the DIMD method according to the present invention applies at least one boundary detection filter, such as a Sobel filter, a Roberts cross filter, a Prewitt filter, a Scharr filter, or a Laplacian filter, to reconstructed reference pixels around a current block to calculate gradients of the reference pixels, and generates a gradient histogram (HoG) based on the gradients. The gradient with the largest value is selected from the gradient histogram and mapped to the intra prediction mode, thereby deriving the intra prediction mode.

[0107] Meanwhile, when deriving an intra prediction mode for a current block using the DIMD method, the area of ​​neighboring pixels to which a boundary detection filter such as a Sobel filter is applied is set to be the same as or different from the area of ​​the template (current template) 420 used in the intra template matching of Figure 4.

[0108] Alternatively, the size and shape of the region to which the boundary detection filter is applied in the DIMD method can be determined arbitrarily.

[0109] According to an embodiment of the present invention, the intra prediction mode of the current block, which is an intra template matching mode, may be derived using the TIMD method.

[0110] Specifically, the TIMD method according to the present invention generates prediction templates by applying the directions of all candidate modes in a most probable mode (MPM) list to reference pixels of a current template, and calculates the sum of absolute transformed differences (SATD) between pixels of the generated prediction template and pixels of the previously reconstructed template. Among all candidate modes in the MPM list, the mode with the smallest sum of absolute transformed differences can be determined as the intra prediction mode.

[0111] Meanwhile, the template used in deriving the intra prediction mode for the current block using the TIMD method may be set to be the same as or different from the area of ​​the template (current template) 420 used in the intra template matching of Fig. 4. Alternatively, the size and shape of the template used in the TIMD method may be determined arbitrarily.

[0112] Meanwhile, the above-mentioned TIMD method uses the sum of absolute transformation differences (SATD) when deriving an intra-frame prediction mode based on a template using candidate modes in the MPM list. However, according to other embodiments of the present invention, any of various error measurement methods such as the sum of absolute differences (SAD) or the sum of square errors (SSE) can be selected and used.

[0113] According to an embodiment of the present invention, the intra prediction mode of the current block, which is an intra template matching mode, may be derived using an intra template matching method.

[0114] Specifically, the intra template matching method according to the present invention can find a template 440 that is most similar to a current template 420 adjacent to a current coding block 410, and determine a matching block 450 corresponding to the current coding block 410.

[0115] At least one boundary detection filter, such as a Sobel filter, a Roberts cross filter, a Prewitt filter, a Scharr filter, or a Laplacian filter, is applied to the pixels in the matching block 450 to calculate the gradient of the pixel, and a histogram of gradients (HoG) may be generated based on the gradient. The gradient with the largest value is selected from the gradient histogram and mapped to the intra prediction mode, thereby deriving the intra prediction mode.

[0116] Since the matching block 450 is the block most similar to the current coding unit block, the intra prediction mode induced for the matching block 450 can be determined as the intra prediction mode for the current coding unit block.

[0117] The transform kernel deriving method of the present invention selects one of the DIMD method, the TIMD method, and the intra template matching method, derives an intra prediction mode for a coding unit block that is an intra template matching mode, and can determine a transform kernel for a current coding unit block based on the induced intra prediction mode.

[0118] A method for determining the transformation kernel of the current block according to the guided intra prediction mode will be described below.

[0119] 5 to 10 are flowcharts illustrating various examples of a method for determining a transformation kernel in intra template matching according to an embodiment of the present invention.

[0120] FIG. 5 is a flowchart illustrating a method for determining a transformation kernel of a primary transformation and a transformation kernel of a secondary transformation in intra template matching according to an embodiment of the present invention.

[0121] 5, a transformation kernel for the primary transformation of the current block can be determined (S510), where the transformation kernel for the primary transformation is determined based on the size of the current block.

[0122] If the current block is in intra template matching mode (S520—YES), the intra prediction mode of the current block may be forcibly set to a non-directional mode (S530). According to one embodiment, the non-directional mode is either a DC mode or a planar mode. Then, a transform kernel for the secondary transform may be determined based on the set intra prediction mode (S540).

[0123] On the other hand, if the current block is not in intra template matching mode (S520-NO), a transform kernel for the secondary transform may be determined based on the intra prediction mode of the current block (S540).

[0124] That is, the transformation kernel of the current block in the intra template matching mode is determined based on the set non-directional mode, instead of being determined in consideration of the intra prediction mode of the current unit.

[0125] According to one embodiment of the present invention, an intra prediction mode is derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method, and a transform kernel can be determined using a low-frequency non-separable transform kernel set determined based on the induced intra prediction mode.

[0126] FIG. 6 is a flowchart illustrating a method for determining a transformation kernel of a primary transformation and a transformation kernel of a secondary transformation in intra template matching according to an embodiment of the present invention.

[0127] Referring to FIG. 6, an intra prediction mode of a current block, which is an intra template matching mode, may be derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method (S610).

[0128] Also, a transformation kernel of the primary transformation may be determined (S620). Here, the transformation kernel of the primary transformation may be determined using a multiple transformation kernel set. The primary transformation kernel of the multiple transformation kernel set may be determined using either an explicit method or an implicit method.

[0129] According to the explicit method, N (N is an integer greater than or equal to 1) primary transform kernels can be used. Therefore, according to the explicit method, the transform kernel can be determined by transmitting / parsing the index of the transform kernel for the current coding unit block.

[0130] Meanwhile, according to the implicit method, transform kernel information for a current block may be implicitly derived in an encoder or decoder using at least one of various information such as the width, height, dimension, aspect ratio, intra prediction mode information, whether or not a secondary transform is used, and a quantization parameter (QP) of the current block.

[0131] Alternatively, the transformation kernel information for the current block may be derived implicitly using at least one of various pieces of information, such as neighboring pixels or blocks around the current block.

[0132] Then, a transform kernel for the secondary transform is determined based on the induced intra prediction mode (S630).

[0133] Unlike the primary transform, the secondary transform can use a non-separable kernel instead of a horizontally and vertically separable kernel, and therefore can be called a low-frequency non-separable transform (LFNST). The transform kernel of the low-frequency non-separable transform can be determined based on information about the intra-prediction mode.

[0134] Table 1 shows low frequency non-separable transform kernel set indexes that are mapped to intra prediction modes.

[0135] [Table 1]

[0136] According to Table 1, a total of 35 low-frequency non-separable transform kernel sets may be mapped according to the intra prediction mode. M (M is an integer greater than or equal to 1) kernels may be defined for each kernel set. Kernel information determined from among the M kernels may be transmitted / parsed using an index. According to the embodiment of Table 1, the 35 low-frequency non-separable transform kernel sets may be mapped symmetrically around the intra prediction mode 34.

[0137] However, this is just one embodiment, and the low-frequency non-separable transform uses S (S is an integer greater than or equal to 1) low-frequency non-separable transform kernel sets, which can be mapped to intra-prediction modes symmetrically around intra-prediction mode 34.

[0138] According to one embodiment of the present invention, a kernel set of a low-frequency non-separable transform, which is a secondary transform, can be determined based on the intra prediction mode induced for the current block, which is an intra template matching mode, and a low-frequency non-separable transform kernel can be determined based on the determined low-frequency non-separable transform kernel set.

[0139] According to one embodiment of the present invention, an intra prediction mode can be derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method, and a transform kernel can be determined using a multiple transform kernel set determined based on the induced intra prediction mode.

[0140] FIG. 7 is a flowchart illustrating a method for determining a transformation kernel of a primary transformation and a transformation kernel of a secondary transformation in intra template matching according to an embodiment of the present invention.

[0141] Referring to FIG. 7, an intra prediction mode of a current block, which is an intra template matching mode, may be derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method (S710).

[0142] Then, a transform kernel for the primary transform may be determined based on the induced intra-prediction mode (S720), where the transform kernel for the primary transform may be determined using the multiple transform kernel set determined based on the induced intra-prediction mode.

[0143] A multiple transform kernel set may be determined from a total of S (S is an integer greater than or equal to 1) multiple transform kernel sets according to the intra prediction mode. M (M is an integer greater than or equal to 1) kernels may be defined for each kernel set. Kernel information determined from the M kernels may be transmitted / parsed using an index.

[0144] According to one embodiment of the present invention, a kernel set of a multiple transform, which is a primary transform, can be determined based on an intra prediction mode induced for a current block, which is an intra template matching mode, and a multiple transform kernel can be determined based on the determined multiple transform kernel set.

[0145] According to another embodiment of the present invention, a kernel set of a multiple transform, which is a primary transform, can be determined based on the induced intra prediction mode and the size of the transmission unit of the current block, and multiple transform kernels can be determined based on the determined multiple transform kernel set.

[0146] Then, a transformation kernel for the secondary transformation may be determined (S730). The transformation kernel for the secondary transformation may be determined using a low-frequency non-separable transformation kernel set. The low-frequency non-separable transformation kernel set may be determined using either an explicit method or an implicit method.

[0147] According to the explicit method, N (N is an integer greater than or equal to 1) low-frequency non-separable transform kernels can be used. Therefore, according to the explicit method, the low-frequency non-separable transform kernel can be determined by transmitting / parsing the index of the low-frequency non-separable transform kernel for the current coding unit block.

[0148] In contrast, according to the implicit method, information on a low-frequency non-separable transform kernel for a current block may be implicitly derived in an encoder or decoder using at least one of various information such as the width, height, dimension, aspect ratio, intra prediction mode information, whether or not a secondary transform is used, and a quantization parameter (QP) of the current block.

[0149] Alternatively, the information of the low-frequency non-separable transform kernel for the current block may be derived implicitly using at least one of various pieces of information, such as neighboring pixels or blocks around the current block.

[0150] According to one embodiment of the present invention, an intra prediction mode is derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method, and a transform kernel can be determined using a multiple transform kernel set and a low-frequency non-separable transform kernel set determined based on the induced intra prediction mode.

[0151] FIG. 8 is a flowchart illustrating a method for determining a transformation kernel of a primary transformation and a transformation kernel of a secondary transformation in intra template matching according to an embodiment of the present invention.

[0152] Referring to FIG. 8, an intra prediction mode of a current block, which is an intra template matching mode, may be derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method (S810).

[0153] Then, a transform kernel for the primary transform may be determined based on the induced intra-prediction mode (S820), where the transform kernel for the primary transform may be determined using multiple transform kernel sets corresponding to the induced intra-prediction mode.

[0154] Then, a transform kernel for the secondary transform is determined based on the induced intra-prediction mode (S830). The transform kernel for the secondary transform may be determined using a low-frequency non-separable transform kernel set corresponding to the induced intra-prediction mode.

[0155] According to one embodiment of the present invention, an intra prediction mode can be derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method, and a transformation kernel can be determined using a non-separable main transformation kernel set determined based on the induced intra prediction mode.

[0156] FIG. 9 is a flowchart illustrating a method for determining a transformation kernel of a non-separable primary transformation in intra template matching according to an embodiment of the present invention.

[0157] Referring to FIG. 9, an intra prediction mode of a current block, which is an intra template matching mode, may be derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method (S910).

[0158] Next, a transform kernel of a non-separable primary transform may be determined based on the induced intra-prediction mode (S920). A non-separable primary transform (NSPT) may use a non-separable kernel, similar to a low-frequency non-separable transform (LFNST). The transform kernel of the non-separable primary transform may be determined based on information of the intra-prediction mode.

[0159] Table 2 shows non-separable primary transform kernel set indexes that are mapped according to intra prediction modes.

[0160] [Table 2]

[0161] According to Table 2, a total of 35 types of non-separable primary transform kernel sets may be mapped according to the intra prediction mode. K (K is an integer greater than or equal to 1) kernels may be defined for each kernel set. Kernel information determined from among the K kernels may be transmitted / parsed using an index. According to the embodiment of Table 2, the 35 non-separable primary transform kernel sets may be mapped to intra prediction modes symmetrically around intra prediction mode 34.

[0162] However, this is just one embodiment, and the non-separable primary transform uses T (where T is an integer greater than or equal to 1) non-separable primary transform kernel sets, which can be mapped to intra-prediction modes symmetrically around intra-prediction mode 34.

[0163] According to one embodiment of the present invention, a kernel set of non-separable primary transforms can be determined based on the intra prediction mode induced for the current block, which is an intra template matching mode, and a non-separable primary transform kernel can be determined based on the determined non-separable primary transform kernel set.

[0164] Alternatively, according to one embodiment of the present invention, a set of transform kernels for a non-separable primary transform can be determined based on the induced intra prediction mode and transform size, and a non-separable primary transform kernel can be determined based on the determined set of non-separable primary transform kernels.

[0165] According to one embodiment of the present invention, an intra prediction mode is derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method, and a transform kernel can be determined using a non-separable main transform kernel set and / or a low-frequency non-separable transform kernel set determined based on the induced intra prediction mode.

[0166] FIG. 10 is a flowchart illustrating a method for determining the transformation kernels of the non-separable primary transformation and the secondary transformation in intra template matching according to an embodiment of the present invention.

[0167] Referring to FIG. 10, an intra prediction mode of a current block, which is an intra template matching mode, may be derived by selecting one of the DIMD method, the TIMD method, and the intra template matching method (S1010).

[0168] Then, a transform kernel for the non-separable primary transform may be determined based on the induced intra-prediction mode (S1020). The transform kernel for the non-separable primary transform may be determined using a non-separable primary transform kernel set corresponding to the induced intra-prediction mode.

[0169] Then, a transform kernel of the secondary transform may be determined based on the induced intra-prediction mode (S1030). The transform kernel of the secondary transform may be determined using a low-frequency non-separable transform kernel set corresponding to the induced intra-prediction mode. Alternatively, the transform kernel of the secondary transform may be determined using a non-separable primary transform kernel set corresponding to the induced intra-prediction mode.

[0170] According to an embodiment of the present invention, the transformation can be performed by selectively using a primary transform or a non-separable primary transform based on the size of the current block.

[0171] FIG. 11 is a flow chart illustrating a method for selectively using a primary transform, a non-separable primary transform, and a secondary transform according to one embodiment of the present invention.

[0172] 11, it may be determined whether the current block is equal to or larger than a predetermined size (S1110). Specifically, for a current block of size M×N, if M or N is equal to or larger than a predetermined size L (S1110-YES), a transform kernel for the primary transform of the current block is determined (S1120). Here, the primary transform may refer to a multiple transform.

[0173] Then, a transformation kernel for the secondary transformation of the current block may be determined (S1150).

[0174] On the other hand, for a current block of size M×N, if M and N are smaller than a predetermined size L (S1110—NO), a transform kernel for a non-separable primary transform may be determined (S1130). If a secondary transform is applied to the current block (S1140—YES), a transform kernel for the secondary transform for the current block may be determined (S1150). Whether or not a secondary transform is applied in step S1140 may be determined based on signaled information. Alternatively, whether or not a secondary transform is applied in step S1140 may be implicitly determined. That is, whether or not a secondary transform is applied may be implicitly determined using at least one of various information such as the width, height, dimension, aspect ratio, intra-prediction mode information, and quantization parameter (QP) of the current block.

[0175] Alternatively, whether or not a secondary transform is applied may be implicitly guided using at least one of a variety of information, such as neighboring pixels or blocks around the current block.

[0176] Meanwhile, the determination of each transformation kernel in FIG. 11 can be performed by any of the embodiments described above with reference to FIGS.

[0177] The encoding / decoding method of the present invention can determine a transformation kernel for a primary transformation and a transformation kernel for a secondary transformation for a current block in an intra template matching mode, and apply a transformation to the current block using the determined transformation kernels.

[0178] The encoding / decoding method of the present invention can apply a low-frequency non-separable transform only to the transform coefficients obtained from the transform kernel of the primary transform, which is a DCT-2 pair.

[0179] Alternatively, the encoding / decoding method of the present invention can apply a low-frequency non-separable transform to the transform coefficients obtained from the primary transform, regardless of the transform kernel of the primary transform.

[0180] The encoding / decoding method of the present invention can determine a transform kernel of a non-separable primary transform for a current block in an intra template matching mode, and replace an existing primary transform (e.g., a multiple transform) with the non-separable primary transform. In this case, a secondary transform (e.g., a low-frequency non-separable transform) can be applied to the transform coefficients obtained by applying the non-separable primary transform.

[0181] Alternatively, the encoding / decoding method of the present invention can replace the existing primary transform (e.g., multiple transform) and secondary transform (e.g., low-frequency non-separable transform) with a non-separable primary transform. In the above case, the low-frequency non-separable transform may not be applied to the transform coefficients obtained by applying the non-separable primary transform.

[0182] 12 is a flowchart showing an image decoding method according to an embodiment of the present invention, which can be performed by an image decoding device.

[0183] If the current block is in intra template matching mode (S1210-YES), the image decoding apparatus may derive the intra prediction mode of the current block (S1220).

[0184] Here, the intra prediction mode can be derived by the DIMD method, the TIMD method, or the intra template matching method.

[0185] Here, the DIMD method is an intra prediction mode derivation method performed using a gradient histogram of surrounding reference pixels of the current block, the TIMD method is an intra prediction mode derivation method performed by selecting one of the candidate modes in the intra prediction candidate list of the current block based on the template of the current block, and the intra template matching method is an intra prediction mode derivation method performed using a gradient histogram of pixels for a block corresponding to the current block.

[0186] The image decoding apparatus may determine a transform kernel for the current block, specifically, may determine the transform kernel based on the induced intra prediction mode (S1230).

[0187] Here, the transform kernel may include at least one of a transform kernel for a primary transform and a transform kernel for a secondary transform. Here, the transform kernel is a transform kernel for a secondary transform of the current block, and the transform kernel for the primary transform of the current block may be determined based on the transform unit size of the current block. An embodiment in which at least one of a transform kernel for a primary transform and a transform kernel for a secondary transform is determined based on the induced intra prediction mode has been described in detail with reference to FIGS. 5 to 8.

[0188] Here, the transform kernel is a transform kernel of the primary transform of the current block. Here, the transform kernel is a non-separable transform kernel selected based on an index corresponding to the induced intra prediction mode. An embodiment of determining a non-separable transform kernel based on an index corresponding to the induced intra prediction mode has been described in detail with reference to FIGS. 9 and 10.

[0189] Here, if the size of the current block is smaller than a predetermined size, the transformation kernel is the transformation kernel of the non-separable primary transformation of the current block. The embodiment of determining the transformation kernel as the transformation kernel of the non-separable primary transformation of the current block based on whether the size of the current block is smaller than a predetermined size has been described in detail in FIG.

[0190] The image decoding apparatus may perform a transformation on the current block based on the transformation kernel (S1240).

[0191] The steps described in Fig. 12 may also be performed in an image coding method. Also, a bitstream may be generated by an image coding method including the steps described in Fig. 12. The bitstream may be stored in a non-transitory computer-readable recording medium and may be transmitted (or streamed).

[0192] FIG. 13 is a diagram illustrating an exemplary content streaming system to which an embodiment according to the present invention can be applied.

[0193] As shown in FIG. 13, a content streaming system to which an embodiment of the present invention is applied may include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0194] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, or CCTV into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, or CCTV directly generates a bitstream, the encoding server may be omitted.

[0195] The bitstream is generated by an image encoding method and / or image encoding device to which an embodiment of the present invention is applied, and the streaming server can temporarily store the bitstream in the process of transmitting and receiving the bitstream.

[0196] The stream server transmits multimedia data to a user device based on a user request via a web server, and the web server can act as an intermediary informing the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, which then transmits the multimedia data to the user. In this case, the content streaming system can include a separate control server, which can control commands and responses between devices in the content streaming system.

[0197] The streaming server can receive content from a media storage and / or encoding server. For example, when receiving content from an encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.

[0198] Examples of user devices include mobile phones, smartphones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices, smartwatches, smart glass, head mounted displays (HMDs), digital televisions, desktop computers, and digital signage.

[0199] Each server in the content streaming system is operated as a distributed server, in which case data received by each server can be processed in a distributed manner.

[0200] The above embodiments can be implemented in the same or corresponding manner in an encoding device and a decoding device, and at least one or a combination of at least one of the above embodiments can be used to encode / decode an image.

[0201] The order in which the above embodiments are applied may be different between the encoding device and the decoding device, or the order in which the above embodiments are applied may be the same between the encoding device and the decoding device.

[0202] The above embodiment can be performed for each of the luminance and color difference signals, or the embodiment can be performed for the luminance and color difference signals in the same manner.

[0203] In the above embodiments, the method is described based on a flowchart as a series of steps or units, but the present invention is not limited to the order of the steps, and some steps may be performed in a different order or simultaneously than those described above. Furthermore, a person skilled in the art will understand that the steps shown in the flowchart are not exclusive, and different steps may be included, or one or more steps in the flowchart may be deleted without affecting the scope of the present invention.

[0204] The above-described embodiments may be implemented in the form of program instructions executed by various computer components and stored on a computer-readable storage medium. The computer-readable storage medium may include, alone or in combination with, the program instructions, data files, data structures, and the like. The program instructions stored on the computer-readable storage medium may be those specially designed and constructed for the present invention, or they may be of the type well known and available to those skilled in the computer software arts.

[0205] The bitstream generated by the encoding method according to the above embodiment is stored in a non-transitory computer-readable recording medium, and the bitstream stored in the non-transitory computer-readable recording medium is decoded by the decoding method according to the above embodiment.

[0206] Examples of computer-readable recording media include magnetic media such as hard disks, floppy disks, and magnetic tapes, optical media such as CD-ROMs and DVDs, magneto-optical media such as floptical disks, and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, and flash memory. Examples of program instructions include not only machine language code produced by a compiler, but also high-level language code executed by a computer using an interpreter or the like. A hardware device may be configured to operate as one or more software modules to perform processing according to the present invention, and vice versa.

[0207] The present invention has been described above using specific details such as specific components, limited embodiments, and drawings. However, this is merely provided to assist in a more general understanding of the present invention, and the present invention is not limited to the above-described embodiments. Those skilled in the art will be able to make various modifications and variations from such descriptions.

[0208] Therefore, the spirit of the present invention should not be limited to the above embodiments, and not only the scope of the claims, but also all modifications equivalent to or similar to the scope of the claims should be considered to fall within the scope of the spirit of the present invention. [Industrial Applicability]

[0209] The present invention can be used in devices for encoding / decoding images and recording media for storing bitstreams. [Explanation of symbols]

[0210] 10, 100 encoder 11 Video source generation section 12 Encoding section 13 Transmission section 20, 200 Decoding device 21 Receiving unit 22 Decoding section 23 Rendering Department 110 Image division unit 113 Subtractor 115, 203 Switch 117, 201 Adder 120, 240 Intra prediction section 121 Motion Estimation Unit 122, 250 Motion compensation unit 130 Conversion Unit 140 Quantization section 150 Entropy coding unit 160, 220 Inverse quantization section 170, 230 Inverse conversion unit 180, 260 filter section 190, 270 Reference Picture Buffer 210 Entropy Decoding Unit 400 Current picture 410 Current coding block 420 Current template 430 Reconstructed area 440 Similar Templates 450 Matching Block CABAC Context-Adaptive Binary Arithmetic Coding CU Coding Unit CPMV Control Point Motion Vector DCT Discrete Cosine Transform DIMD Decoder side IntraMode Derivation DST Discrete Sine Transform Mode Derivation LFNST Low frequency non-separable transform LMCS Luma Mapping with Chroma Scaling NSPT Non-separable primary transform RQT Residual Quad Tree TIMD Template-based Intra Mode Derivation TU Transform Unit

Claims

1. An image decoding method, comprising: determining a transformation kernel for the current block; performing an inverse transform on the current block based on the transform kernel; If the current block is in an intra template matching mode, further comprising: inducing an intra prediction mode of the current block; The image decoding method, wherein the transformation kernel is determined based on the induced intra prediction mode.

2. The image decoding method of claim 1 , wherein the intra prediction mode is derived by a decoder-side intra mode derivation (DIMD) method.

3. The image decoding method of claim 2, wherein the DIMD method is performed using a gradient histogram of neighboring reference pixels of the current block.

4. The image decoding method of claim 1, wherein the intra prediction mode is derived by a template-based intra mode derivation (TIMD) method.

5. The image decoding method of claim 4 , wherein the TIMD method is performed by selecting one of the candidate modes in an intra-prediction candidate list of the current block based on a template of the current block.

6. The image decoding method of claim 1, wherein the intra prediction mode is derived using an intra template matching method.

7. 7. The image decoding method of claim 6, wherein the intra-template matching is performed using a gradient histogram of pixels for a block corresponding to the current block.

8. 2. The image decoding method of claim 1, wherein the transform kernels include at least one of a transform kernel of a primary transform and a transform kernel of a secondary transform.

9. the transformation kernel is a transformation kernel of a secondary transformation of the current block; The image decoding method of claim 1 , wherein a transform kernel of the primary transform of the current block is determined based on a transform unit size of the current block.

10. The image decoding method of claim 1 , wherein the transformation kernel is a transformation kernel of a primal transformation of the current block.

11. The image decoding method of claim 1 , wherein the transform kernel is a non-separable transform kernel selected based on an index corresponding to the induced intra-prediction mode.

12. The image decoding method of claim 1 , wherein if the size of the current block is smaller than a predetermined size, the transform kernel is a transform kernel of a non-separable primary transform of the current block.

13. 1. An image encoding method, comprising: determining a transformation kernel for the current block; performing a transformation on the current block based on the transformation kernel; If the current block is in an intra template matching mode, further comprising: inducing an intra prediction mode of the current block; The image encoding method, wherein the transformation kernel is determined based on the induced intra prediction mode.

14. A non-transitory computer-readable recording medium storing a bitstream generated by an image encoding method, The image encoding method includes: determining a transformation kernel for the current block; performing a transformation on the current block based on the transformation kernel; If the current block is in an intra template matching mode, further comprising: inducing an intra prediction mode of the current block; The transform kernel is determined based on the induced intra-prediction mode.

15. A method for transmitting a bitstream generated by an image coding method, comprising: The transmission method includes transmitting the bitstream; The encoding method comprises: determining a transformation kernel for the current block; performing a transformation on the current block based on the transformation kernel; If the current block is in an intra template matching mode, inducing an intra prediction mode of the current block, The method of claim 1, wherein the transformation kernel is determined based on the induced intra-prediction mode.