Image encoding / decoding method and device, and recording medium storing bit stream
Through the multi-candidate intra-frame template matching prediction method, multiple template shape candidates and weighted sum are used to generate image prediction blocks, which solves the problem of limited encoding and decoding performance in the existing technology and realizes efficient image encoding, decoding and storage.
Patent Information
- Application Number
- CN202480007575.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-03-02
- Filing Date
- 2024-02-29
- Publication Date
- 2025-09-05
AI Technical Summary
Existing intra-frame template matching methods only use the most similar block to generate a prediction block for the current block, resulting in limited encoding and decoding performance and unable to meet the efficient transmission and storage requirements of high-resolution and high-quality images.
Multiple template shape candidates are used for intra-frame template matching prediction. The template shape of the current block is determined by the bitstream signal. The prediction block of the current block is generated based on the reference template, and the final prediction block is generated by weighted sum. The calculation process is optimized using a lookup table and threshold.
It improves the efficiency of image encoding and decoding and prediction efficiency, reduces computational complexity, and is suitable for the transmission and storage of high-resolution and high-quality images.
Smart Images

Figure CN120604512A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method and apparatus for encoding / decoding an image and a recording medium for storing a bitstream. In particular, the present invention relates to a method and apparatus for encoding / decoding an image based on a method using multiple prediction shape candidates in intra-frame template matching and a recording medium for storing a bitstream. Background Art
[0002] Recently, in various application fields, the demand for high-resolution and high-quality images, such as ultra-high definition (UHD) images, has increased. As the resolution and quality of image data become higher, the amount of data increases relatively compared to existing image data. Therefore, when such image data is transmitted using existing media such as wired or wireless broadband channels, or when such image data is stored using existing storage media, the transmission and storage costs increase. In order to solve these problems that arise as the resolution and quality of image data become higher, efficient image encoding / decoding technology is required for images with higher resolution and image quality.
[0003] In video encoding and decoding methods and apparatuses, intra template matching is an intra prediction mode (intra TMP) that searches for a block most similar to a current block (e.g., a codec tree block, a codec unit, a codec block, a prediction unit, a prediction block, a transform unit, a transform block, etc.) by performing template matching in a reconstructed area within a current picture, and uses the searched block as a prediction block for the current block.
[0004] Existing intra-frame template matching methods only use the most similar block to generate a prediction block for the current block. Accordingly, when using the intra-frame template matching method, encoding and decoding performance may be limited. Summary of the Invention
[0005] Technical issues
[0006] An object of the present invention is to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.
[0007] Another object of the present invention is to provide a recording medium for storing a bit stream generated by the image decoding method or apparatus according to the present invention.
[0008] Another object of the present invention is to provide a method for performing multi-candidate intra-frame template matching prediction.
[0009] Technical Solution
[0010] An image decoding method according to an embodiment of the present invention may include: determining whether a current block is in an intra-frame template matching mode; determining a template shape of the current block among multiple template shape candidates; searching for a reference template based on the current template according to the template shape; and generating a prediction block of the current block based on the reference template.
[0011] In the image decoding method, whether the current block is in intra template matching can be determined based on information sent by a bitstream signal, and the information sent by the bitstream signal can include information indicating whether the intra template matching mode of the current block uses multiple template shape candidates.
[0012] In the image decoding method, a prediction block of a current block may be generated by a weighted sum of matching blocks adjacent to different reference templates corresponding to the current template.
[0013] In the image decoding method, a weight for a weighted sum of matching blocks may be determined based on a cost value of each of different reference templates.
[0014] In the image decoding method, a weight for the weighted sum of matching blocks may be determined based on a lookup table corresponding to a cost value of each of different reference templates.
[0015] In the image decoding method, when the cost value of at least one of the different reference templates is greater than a threshold, a prediction block of the current block can be generated by a weighted sum of mutually different matching blocks, and the threshold can be set based on the cost values of multiple template shape candidates.
[0016] In the image decoding method, a current template may be determined among a plurality of template shape candidates based on information signaled through a bitstream.
[0017] In the image decoding method, among a plurality of template shape candidates, a current template may be determined based on the shape of a reference template having the highest similarity to the current template.
[0018] An image encoding method according to an embodiment of the present invention may include: determining whether a current block is in an intra template matching mode; determining a template shape of the current block among a plurality of template shape candidates; searching for a reference template based on the current template according to the template shape; and generating a prediction block of the current block based on the reference template.
[0019] According to an embodiment of the present invention, a non-volatile computer-readable recording medium for storing a bit stream generated by an image encoding method may include: determining whether a current block is in an intra-frame template matching mode; determining a template shape of the current block among multiple template shape candidates; searching for a reference template based on the current template according to the template shape; and generating a prediction block of the current block based on the reference template.
[0020] A method for transmitting a bitstream generated by an image encoding method according to an embodiment of the present invention may include: determining whether a current block is in an intra-frame template matching mode; determining a template shape of the current block among multiple template shape candidates; searching for a reference template based on the current template according to the template shape; and generating a prediction block of the current block based on the reference template.
[0021] The features briefly summarized above regarding the present invention are provided merely as examples to explain the detailed description and should not be construed as limiting the scope of the present invention.
[0022] Beneficial effects
[0023] According to the present invention, it is possible to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.
[0024] Furthermore, according to the present invention, by using a plurality of template shape candidates to predict a current block in an intra template matching mode, prediction efficiency and encoding and decoding efficiency can be improved.
[0025] Furthermore, according to the present invention, computational complexity can be reduced by calculating weights for weighted summations of different templates without using floating-point operations.
[0026] Effects obtainable according to the present invention are not limited to the above-mentioned effects, and other effects not mentioned will be clearly understood by those skilled in the art through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a block diagram showing the configuration of an encoding device according to an embodiment of the present invention.
[0028] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment of the present invention.
[0029] Figure 3 FIG. 1 is a diagram schematically illustrating a video coding and decoding system to which the present invention is applicable.
[0030] Figure 4 is a schematic diagram for describing intra-frame template matching according to an embodiment of the present invention.
[0031] Figure 5 is a schematic diagram for describing a plurality of template shape candidates for intra-frame template matching prediction according to an embodiment of the present invention.
[0032] Figure 6 is a diagram for describing a method for predicting a current block by using different templates in intra template matching prediction according to an embodiment of the present invention.
[0033] Figure 7is a flowchart illustrating an image decoding method according to an embodiment of the present invention.
[0034] Figure 8 is a schematic diagram for illustrating a content streaming system to which an embodiment according to the present invention is applicable. DETAILED DESCRIPTION
[0035] The present invention may have various modifications and embodiments, and specific embodiments are shown in the drawings and described in detail in the detailed description. However, this is not intended to limit the present invention to specific embodiments, but should be understood to include all modifications, equivalents or alternatives contained within the spirit and technical scope of the present invention. The same figure marks in the drawings indicate the same or similar functions in various aspects. For a clearer description, the shapes and sizes of the elements in the drawings can be provided by way of example. The detailed description of the exemplary embodiments described below refers to the drawings, which illustrate specific embodiments by way of example. These embodiments are described in sufficient detail to enable those skilled in the art to practice the embodiments. It should be understood that the various embodiments are different from each other, but not necessarily mutually exclusive. For example, without departing from the spirit and scope of the present invention with reference to one embodiment, the specific shapes, structures and features described herein can be implemented in other embodiments. It should also be understood that without departing from the spirit and scope of the embodiment, the position or arrangement of each component within each disclosed embodiment can be changed. Accordingly, the detailed description set forth below is not intended to be restrictive, and the scope of the exemplary embodiments is limited only by the full range of equivalent forms given by the appended claims and these claims (if appropriately described).
[0036] In the present invention, the terms first, second, etc. may be used to describe various components, but the components should not be limited by the terms. The 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 terms are and / or include a combination of multiple related descriptive items or any item in multiple related descriptive items.
[0037] The components shown in the embodiments of the present invention are depicted independently to indicate different characteristic functions, and do not represent that each component is formed as a separate hardware or software configuration unit. That is, for ease of explanation, each component is listed and included as a separate component, and at least two of the components can be combined to form a single component, or a component can be divided into multiple components to perform functions. As long as it does not depart from the essence of the present invention, embodiments in which the components are integrated and embodiments in which each component is divided are also included in the scope of the present invention.
[0038] The terms used in the present invention are only used to describe specific embodiments and are not intended to limit the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In addition, some components of the present invention are not essential components for performing necessary functions in the present invention and can be optional components that are only used to improve performance. The present invention can be realized by only including essential components for realizing the gist of the present invention and not including components that are only used to improve performance, and the structure that only includes essential components and does not include optional components that are only used to improve performance is also included in the scope of the present invention.
[0039] In an embodiment, the term "at least one" may refer to one of a number greater than or equal to 1, such as 1, 2, 3, and 4. In an embodiment, the term "plurality" may refer to one of a number greater than or equal to 2, such as 2, 3, and 4.
[0040] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. When describing the embodiments of this specification, if it is determined that a detailed description of related known configurations or functions will obscure the subject matter of this specification, the detailed description will be omitted, the same reference numerals will be used for the same components in the drawings, and repeated description of the same components will be omitted.
[0041] Description of terms
[0042] Hereinafter, "image" may refer to a picture constituting a video, or may refer to the video itself. For example, "encoding and / or decoding of an image" may refer to "encoding and / or decoding of a video," or may refer to "encoding and / or decoding of one of the pictures constituting the video."
[0043] Hereinafter, "moving image" and "video" may be used interchangeably with each other in the same meaning. Furthermore, a target image may be an encoding target image that is the target of encoding and / or a decoding target image that is the target of decoding. Furthermore, a target image may be an input image input to an encoding device or an input image input to a decoding device. Here, the target image may have the same meaning as the current image.
[0044] Hereinafter, an encoder and an image encoding device may be used with the same meaning and may be used interchangeably.
[0045] Hereinafter, a decoder and an image decoding device may be used with the same meaning and may be used interchangeably.
[0046] Hereinafter, “image,” “picture,” “frame,” and “picture” may be used with the same meaning and may be used interchangeably.
[0047] Hereinafter, a "target block" may be an encoding target block that is a target of encoding and / or a decoding target block that is a target of decoding. In addition, a target block may be a current block that is a target of current encoding and / or decoding. For example, "target block" and "current block" may be used with the same meaning and may be used interchangeably.
[0048] In the following, "block" and "unit" can be used with the same meaning and can be used interchangeably. In addition, "unit" can mean a luma component block and its corresponding chroma component block to distinguish it from a block. For example, a coding tree unit (CTU) can consist of a luma component (Y) coding tree block (CTB) and its associated two chroma component (Cb, Cr) coding tree blocks.
[0049] Hereinafter, “sample”, “picture element”, and “pixel” may be used with the same meaning and may be used interchangeably. Herein, a sample may represent a basic unit constituting a block.
[0050] Hereinafter, “inter-frame” and “inter-screen” may be used with the same meaning and may be used interchangeably.
[0051] Hereinafter, “intra-frame” and “intra-screen” may be used with the same meaning and may be used interchangeably.
[0052] Figure 1 is a block diagram showing the configuration of an encoding device according to an embodiment of the present invention.
[0053] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. A video may include one or more images. The encoding device 100 may encode one or more images sequentially.
[0054] refer to Figure 1 The encoding device 100 may include: an image partitioning unit 110, an intra-frame 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 filtering unit 180 and a reference picture buffer 190.
[0055] In addition, the encoding device 100 can generate a bit stream including information encoded by encoding the input image and output the generated bit stream. The generated bit stream can be stored in a computer-readable recording medium or can be streamed through a wired / wireless transmission medium.
[0056] The image partitioning unit 110 can partition the input image into various forms to improve the efficiency of video encoding / decoding. That is, the input video consists of multiple pictures, and for compression efficiency, parallel processing, etc., a picture can be partitioned and processed hierarchically. For example, a picture can be partitioned into one or more tiles or slices, and then partitioned again into multiple codec tree units (CTUs). Alternatively, a picture can first be partitioned into multiple sub-pictures defined as rectangular slice groups, and each sub-picture can be partitioned into tiles / slices. Here, sub-pictures can be used to support the function of partially encoding / decoding and transmitting pictures independently. Since multiple sub-pictures can be reconstructed separately, this has the advantage of easy editing in applications where multi-channel input is configured as one picture. In addition, tiles can be divided horizontally to generate bricks. Here, bricks can be used as basic units for parallel processing within a picture. In addition, a CTU can be recursively partitioned into a quad tree (QT), and the terminal node of the partition can be defined as a coding unit (CU). The CU can be partitioned into a PU (Prediction Unit) as a prediction unit and a TU (Transform Unit) as a transform unit to perform prediction and partitioning. On the other hand, the CU can be used as a prediction unit and / or a transform unit itself. Here, for flexible partitioning, each CTU can be recursively partitioned into multi-type trees (MTT) and quadtrees (QT). Partitioning the CTU into multi-type trees can start from the terminal node of the QT, and the MTT can be composed of a binary tree (BT) and a triple tree (TT). For example, the MTT structure can be classified into a vertical binary split mode (SPLIT_BT_VER), a horizontal binary split mode (SPLIT_BT_HOR), a vertical ternary split mode (SPLIT_TT_VER), and a horizontal ternary split mode (SPLIT_TT_HOR). In addition, during partitioning, the minimum block size (MinQTSize) of the quadtree of the luma block can be set to 16 × 16, the maximum block size (MaxBtSize) of the binary tree can be set to 128 × 128, and the maximum block size (MaxTtSize) of the ternary tree can be set to 64 × 64. In addition, the minimum block size (MinBtSize) of the binary tree and the minimum block size (MinTtSize) of the ternary tree can be specified as 4 × 4, and the maximum depth (MaxMttDepth) of the multi-type tree can be specified as 4. In addition, in order to improve the coding efficiency of the I slice, a dual tree that uses the CTU partition structure of the luma component and the chroma component differently can be applied.On the other hand, in P slices and B slices, the luma and chroma coding tree blocks (CTBs) within a CTU can be partitioned into a single tree that shares the coding tree structure.
[0057] The encoding device 100 can perform encoding on the input image in intra mode and / or inter mode. Alternatively, the encoding device 100 can perform encoding on the input image in a third mode other than intra mode and inter mode (for example, IBC mode, palette mode, etc.). However, if the third mode has functional characteristics similar to those of intra mode or inter mode, it can be classified as intra mode or inter mode for ease of explanation. In the present invention, the third mode is classified and described separately only when a specific description of the third mode is required.
[0058] When the intra mode is used as the prediction mode, the switch 115 can switch to intra, and when the inter mode is used as the prediction mode, the switch 115 can switch to inter. Here, the intra mode can represent the intra prediction mode, and the inter mode can represent the inter prediction mode. The encoding device 100 can generate a prediction block for the input block of the input image. In addition, the encoding device 100 can encode the residual block using the residual of the input block and the prediction block after generating the prediction block. The input image can be referred to as the current image that is the current encoding target. The input block can be referred to as the current block that is the current encoding target or the encoding target block.
[0059] When the prediction mode is intra mode, the intra prediction unit 120 can use samples of blocks that have been encoded / decoded around the current block as reference samples. The intra prediction unit 120 can perform spatial prediction of the current block by using the reference samples, or generate prediction samples of the input block through spatial prediction. In this article, intra prediction can refer to intra-frame prediction.
[0060] As the intra prediction method, non-directional prediction modes such as DC mode and planar mode and directional prediction modes (for example, 65 directions) can be applied. Here, the intra prediction method can be expressed as an intra prediction mode or an intra-screen prediction mode.
[0061] When the prediction mode is inter mode, the motion prediction unit 121 can retrieve the area that best matches the input block from the reference image during the motion prediction process and derive the motion vector by using the retrieved area. In this case, a search area can be used as the area. The reference image can be stored in the reference picture buffer 190. Here, when encoding / decoding the reference image, it can be stored in the reference picture buffer 190.
[0062] The motion compensation unit 122 may generate a prediction block of the current block by performing motion compensation using a motion vector. Herein, inter prediction may refer to inter-picture prediction or motion compensation.
[0063] When the value of the motion vector is not an integer, the motion prediction unit 121 and the motion compensation unit 122 may generate a prediction block by applying an interpolation filter to a partial area of the reference picture. In order to perform inter-frame prediction or motion compensation, it may be determined based on the codec unit whether the motion prediction and motion compensation mode of the prediction unit included in the codec unit is one of the skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and intra block copy (IBC) mode, and inter-frame prediction or motion compensation may be performed according to each mode.
[0064] In addition, based on the above-mentioned inter-frame prediction method, the affine mode based on sub-PU prediction, the subblock-based temporal motion vector prediction (SbTMVP) mode, the PU-based prediction and MVD merge (Merge with MVD, MMVD) mode and the geometric partitioning mode (Geometric Partitioning Mode, GPM) mode can be applied. In addition, in order to improve the performance of each mode, history based MVP (HMVP), pairwise average MVP (PAMVP), combined intra / inter prediction (CIIP), adaptive motion vector resolution (AMVR), bidirectional optical flow (BDOF), bidirectional prediction with CU weights (BCW), local illumination compensation (LIC), template matching (TM), overlapped block motion compensation (OBMC), etc. can be applied.
[0065] Among them, the AFFINE mode is a technology used in both AMVP and MERGE modes, and also has high coding efficiency. In existing video codec standards, since motion compensation (MC) is performed by considering only the parallel movement of blocks, it has the disadvantage of not being able to properly compensate for motion that occurs in reality (for example, zooming in / out and rotation). To supplement this, a four-parameter affine motion model using two control point motion vectors (CPMV) and a six-parameter affine motion model using three control point motion vectors can be used and applied to inter-frame prediction. Here, CPMV is a vector representing an affine motion model of one of the upper left, upper right, and lower left sides of the current block.
[0066] The subtractor 113 may generate a residual block by utilizing the difference between the input block and the prediction block. The residual block may be referred to as a residual signal. The residual signal may represent the difference between the original signal and the prediction signal. Alternatively, the residual signal may be a signal generated by transforming or quantizing, or transforming and quantizing, the difference between the original signal and the prediction signal. The residual block may be a residual signal of a block unit.
[0067] The transform unit 130 may generate a transform coefficient by performing a transform on the residual block and output the generated transform coefficient. In this article, the transform coefficient may be a coefficient value generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip the transform of the residual block.
[0068] The quantization level may be generated by applying quantization to the transform coefficients or the residual signal. Hereinafter, the quantization level may also be referred to as the transform coefficient in the embodiments.
[0069] For example, the 4×4 luma residual block generated by intra prediction is transformed using a discrete sine transform (DST)-based basis vector, and the remaining residual block can be transformed using a discrete cosine transform (DCT)-based basis vector. In addition, the transform block is partitioned into a quadtree shape of one block using the residual quadtree (RQT) technology, and after transforming and quantizing each transform block partitioned by the RQT, a coded block flag (cbf) can be transmitted when all coefficients become 0 to improve coding efficiency.
[0070] As another alternative, a Multiple Transform Selection (MTS) technique that selectively uses multiple transform bases to perform transforms can be applied. That is, instead of partitioning the CU into TUs through RQT, a function similar to TU partitioning can be performed through sub-block transform (SBT) technology. Specifically, SBT is only applied to inter-frame prediction blocks, and unlike RQT, the current block can be partitioned into 1 / 2 or 1 / 4 sizes in the vertical or horizontal direction, and then the transform can be performed on only one of the blocks. For example, if the current block is partitioned vertically, the transform can be performed on the leftmost or rightmost block, and if the current block is partitioned horizontally, the transform can be performed on the topmost or bottommost block.
[0071] In addition, a low-frequency non-separable transform (LFNST) can be applied. This is a secondary transform technique that additionally transforms the transformed residual signal into the frequency domain through DCT or DST. LFNST additionally transforms the 4×4 or 8×8 low-frequency region on the upper left side so that the residual coefficients can be concentrated on the upper left side.
[0072] The quantization unit 140 may generate a quantization level by quantizing the transform coefficient or the residual signal according to a quantization parameter (QP) and output the generated quantization level. Herein, the quantization unit 140 may quantize the transform coefficient by using a quantization matrix.
[0073] For example, a quantizer with a QP value of 0 to 51 may be used. Alternatively, if the image size is large and high coding efficiency is required, a QP of 0 to 63 may be used. In addition, a dependent quantization (DQ) method using two quantizers instead of one quantizer may be applied. DQ performs quantization using two quantizers (e.g., Q0 and Q1), but even without signaling information about the use of a specific quantizer, a quantizer for the next transform coefficient may be selected based on the current state through a state transition model.
[0074] The entropy coding unit 150 may generate a bitstream by performing entropy coding on the values calculated by the quantization unit 140 or the codec parameter values calculated when performing coding according to the probability distribution, and output the bitstream. The entropy coding unit 150 may perform entropy coding on information about samples of an image and information for decoding the image. For example, the information for decoding the image may include syntax elements.
[0075] When entropy coding is applied, symbols are represented so that a smaller number of bits are assigned to symbols with a high probability of occurrence and a larger number of bits are assigned to symbols with a low probability of occurrence, thereby reducing the size of the bitstream for the symbol to be encoded. The entropy coding unit 150 can perform entropy coding using coding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 can perform entropy coding by utilizing a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 can derive a binarization method of the target symbol and a probability model of the target symbol / binary, and perform arithmetic coding and decoding by utilizing the derived binarization method and context model.
[0076] In this regard, when CABAC is applied, in order to reduce the size of the probability table stored in the decoding device, the table probability update method can be changed to a table update method using a simple equation and applied. In addition, two different probability models can be used to obtain more accurate symbol probability values.
[0077] In order to encode the transform coefficient level (quantization level), the entropy encoding unit 150 may change the coefficients in a two-dimensional block form into a one-dimensional vector form through a transform coefficient scanning method.
[0078] The codec parameters may include information (flags, indexes, etc.) encoded in the encoding device 100 and signaled to the decoding device 200, such as syntax elements, and information derived during the encoding or decoding process, and may represent information required when encoding or decoding an image.
[0079] Herein, signaling a flag or an index may mean that the corresponding flag or index is entropy-encoded in an encoder and included in a bitstream, and may mean that the corresponding flag or index is entropy-decoded from a bitstream in a decoder.
[0080] The encoded current image can be used as a reference image for another image to be processed later. Therefore, the encoding device 100 can reconstruct or decode the encoded current image again and store the reconstructed or decoded image as a reference image in the reference picture buffer 190.
[0081] The quantization level may be dequantized in the dequantization unit 160 or inversely transformed in the inverse transform unit 170. The dequantized and / or inversely transformed coefficients may be added to the prediction block by the adder 117. Herein, the dequantized and / or inversely transformed coefficients may represent coefficients on which at least one of dequantization and inverse transformation has been performed, and may represent a reconstructed residual block. The dequantization unit 160 and the inverse transform unit 170 may perform the inverse process of the quantization unit 140 and the transform unit 130.
[0082] The reconstructed block may pass through the filtering unit 180. The filtering unit 180 may utilize all or some filtering techniques to apply a deblocking filter, a sample adaptive offset (SAO) filter, an adaptive loop filter (ALF), a bilateral filter (BIF), a luma mapping with chroma scaling (LMCS) filter, etc. to reconstruct the sample, reconstruct the block, or reconstruct the image. The filtering unit 180 may be referred to as an in-loop filter. In this case, the name in-loop filter may also be used without LMCS.
[0083] A deblocking filter can remove block distortion generated at the boundaries between blocks. To determine whether to apply a deblocking filter, a determination can be made based on samples included in a number of rows or columns included in the block whether to apply the deblocking filter to the current block. When applying a deblocking filter to a block, different filters can be applied depending on the desired deblocking filter strength.
[0084] To compensate for coding errors using sample adaptive offset, an appropriate offset value can be added to the sample value. Sample adaptive offset can correct the offset from the original image in units of samples for the deblocked image. A method can be used in which the samples included in the image are partitioned into a predetermined number of regions, the regions to which the offset is applied are determined, and the offset is applied to the determined regions, or a method can be used in which the offset is applied taking into account edge information about each sample.
[0085] The bilateral filter (BIF) can also correct the deviation from the original image on a sample-by-sample basis for the image on which deblocking has been performed.
[0086] The adaptive loop filter can perform filtering based on the comparison result of the reconstructed image and the original image. The samples included in the image can be partitioned into predetermined groups, the filter to be applied to each group can be determined, and differential filtering can be performed on each group. Information on whether to apply the ALF can be signaled by the codec unit (CU), and the form and coefficients of the adaptive loop filter to be applied to each block can be varied.
[0087] In luma mapping with chroma scaling (LMCS), luma mapping (LM) refers to remapping luma values using a piecewise linear model, and chroma scaling (CS) refers to a technique for scaling the residual values of chroma components according to the average luma value of the prediction signal. In particular, LMCS can be used as an HDR correction technique to reflect the characteristics of High Dynamic Range (HDR) images.
[0088] The reconstructed block or reconstructed image that has passed through the filtering unit 180 may be stored in the reference picture buffer 190. The reconstructed block that has passed through the filtering unit 180 may be part of a reference image. That is, the reference image is a reconstructed image composed of the reconstructed block that has passed through the filtering unit 180. The stored reference image may be used later for inter-frame prediction or motion compensation.
[0089] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment of the present invention.
[0090] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.
[0091] refer to Figure 2 The decoding device 200 may include: an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 201, a switch 203, a filtering unit 260 and a reference picture buffer 270.
[0092] The decoding device 200 can receive the bitstream output from the encoding device 100. The decoding device 200 can receive the bitstream stored in a computer-readable recording medium, or can receive the bitstream streamed via a wired / wireless transmission medium. The decoding device 200 can decode the bitstream in intra-frame mode or inter-frame mode. In addition, the decoding device 200 can generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.
[0093] When the prediction mode for decoding is intra mode, the switch 203 may switch to intra. Alternatively, when the prediction mode for decoding is inter mode, the switch 203 may switch to inter.
[0094] The decoding device 200 can obtain a reconstructed residual block by decoding the input bitstream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block that becomes the decoding target by adding the reconstructed residual block and the prediction block. The decoding target block can be referred to as the current block.
[0095] The entropy decoding unit 210 may generate symbols by entropy decoding the bitstream according to the probability distribution. The generated symbols may include symbols in the form of quantization levels. In this article, the entropy decoding method may be the inverse process of the above-mentioned entropy encoding method.
[0096] The entropy decoding unit 210 may change the coefficients of the one-dimensional vector shape into coefficients of the two-dimensional block shape through a transform coefficient scanning method to decode the transform coefficient level (quantization level).
[0097] The quantization level may be dequantized in the dequantization unit 220 or inversely transformed in the inverse transform unit 230. The quantization level may be the result of dequantization and / or inverse transformation and may be generated as a reconstructed residual block. In this article, the dequantization unit 220 may apply a quantization matrix to the quantization level. The dequantization unit 220 and the inverse transform unit 230 applied to the decoding device may apply the same technology as the dequantization unit 160 and the inverse transform unit 170 applied to the aforementioned encoding device.
[0098] When intra mode is used, the intra prediction unit 240 can generate a prediction block by performing spatial prediction on the current block using sample values of blocks already decoded around the target block. The intra prediction unit 240 applied to the decoding device can apply the same technology as the intra prediction unit 120 applied to the aforementioned encoding device.
[0099] When using inter-frame mode, the motion compensation unit 250 can 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. When the value of the motion vector is not an integer value, the motion compensation unit 250 can generate a prediction block by applying an interpolation filter to a partial area within the reference image. In order to perform motion compensation, it can be determined based on the codec unit whether the motion compensation mode of the prediction unit included in the corresponding codec unit is skip mode, merge mode, AMVP mode, or current picture reference mode, and motion compensation can be performed according to each mode. The motion compensation unit 250 applied to the decoding device can apply the same technology as the motion compensation unit 122 applied to the above-mentioned encoding device.
[0100] The adder 201 can generate a reconstructed block by adding the reconstructed residual block and the prediction block. The filtering unit 260 can apply at least one of an inverse LMCS, a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or the reconstructed image. The filtering unit 260 applied to the decoding device can apply the same filtering technology as the filtering unit 180 applied to the aforementioned encoding device.
[0101] The filtering unit 260 may output a reconstructed image. The reconstructed block or image may be stored in the reference picture buffer 270 and used for inter-frame prediction. The reconstructed block that has passed through the filtering unit 260 may be part of a reference image. In other words, the reference image may be a reconstructed image composed of the reconstructed blocks that have passed through the filtering unit 260. The stored reference image may be later used for inter-frame prediction or motion compensation.
[0102] Figure 3 FIG. 1 is a diagram schematically illustrating a video coding and decoding system to which the present invention is applicable.
[0103] The video coding system according to the 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 the form of a file or streaming via a digital storage medium or a network.
[0104] The encoding device 10 according to the embodiment may include a video source generating unit 11, an encoding unit 12, and a transmitting unit 13. The decoding device 20 according to the embodiment may include a receiving 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 transmitting unit 13 may be included in the encoding unit 12. The receiving unit 21 may be included in the decoding unit 22. The rendering unit 23 may include a display unit, and the display unit may be configured as a separate device or an external component.
[0105] The video source generation unit 11 can obtain a video / image by capturing, synthesizing, or generating a video / image. The video source generation unit 11 may include a video / image capture device and / or a video / image generation device. The video / image capture device may include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generation device may include, for example, a computer, a tablet computer, a smartphone, etc., and may (electronically) generate the video / image. For example, a virtual video / image may be generated by a computer, etc., in which case the video / image capture process may be replaced by a process for generating relevant data.
[0106] The encoding unit 12 can encode the input video / image. For compression and encoding efficiency, the encoding unit 12 can perform a series of processes such as prediction, transformation and quantization. The encoding unit 12 can output the encoded data (encoded video / image information) in the form of a bit stream. The detailed configuration of the encoding unit 12 can also be the same as above. Figure 1 The encoding device 100 is configured in the same manner.
[0107] The transmitting unit 13 can transmit the encoded video / image information or data output in the form of a bitstream to the receiving unit 21 of the decoding device 20 via a digital storage medium or a network in the form of a file or streaming. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit 13 may include components for generating a media file in a predetermined file format and may also include components for transmission via a broadcast / communication network. The receiving unit 21 may extract / receive the bitstream from the storage medium or network and transmit it to the decoding unit 22.
[0108] The decoding unit 22 can decode the video / image by performing a series of processes 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 compared with Figure 2 The above-mentioned decoding device 200 is configured in the same manner.
[0109] The rendering unit 23 may render the decoded video / image. The rendered video / image may be displayed by the display unit.
[0110] This specification describes an embodiment of a method for determining a reference template for a current block in an intra template matching mode. In this context, the reference template may be a template corresponding to a current template for the current block.
[0111] According to an embodiment of the present invention, a current template of a current block may be determined according to a template shape determined among a plurality of template shape candidates. In addition, a reference template may be searched based on the determined current template.
[0112] Before describing a method for determining a reference template of a current block in an intra template matching mode, intra template matching will be described.
[0113] In this article, reference Figure 4 , a method for deriving an intra prediction mode of a current block for encoding / decoding through intra template matching according to an embodiment of the present invention will be described.
[0114] In the present invention, intra-frame template matching is an intra-frame prediction method that searches for a block most similar to the current block by performing template matching in a reconstructed area within the current picture, and derives the searched block as the predicted block for the current block. The intra-frame prediction method that derives the predicted block for the current block based on the searched block can be defined as intratemplate matching prediction (intra TMP).
[0115] Figure 4 FIG. 1 is a schematic diagram for describing intra-frame template matching prediction according to an embodiment of the present invention.
[0116] refer to Figure 4 Based on the current block 410, intra template matching prediction can determine the best prediction block for the current block in the reconstructed area 430 within the current picture 400. Specifically, in the intra template matching prediction, a set of adjacent reference pixels surrounding the current codec block 410 can be defined as the current template 420. In addition, based on the current template 420, a template matching-based search can be performed within the reconstructed area 430 to search for a reference template 440 having the highest similarity to the current template 420, thereby determining a matching block 450. In this article, the matching block 450 can be used as the prediction block of the current block 410.
[0117] On the other hand, the search based on template matching may be performed in the predefined regions R1 , R2 , R3 , and R4 within the reconstruction region 430 , and the search may be performed in the order of R1 , R2 , R3 , and R4 .
[0118] A residual signal of the current block 410 in the intra template matching mode may be generated by using the current block 410 and the matching block 450 .
[0119] When performing intra template matching prediction, a reference template 440 having the highest similarity to a ┌-shaped current template 420 surrounding the current block is searched in the search area, and blocks adjacent to the reference template 440 are determined as matching blocks.
[0120] The present invention proposes a method that considers multiple template shape candidates instead of a single template shape when performing a template matching based search in intra-frame template matching prediction. When performing a template matching based search by considering multiple template shape candidates, the performance is improved compared to using only one template shape. Compared with the related technology of shape template, it can improve the encoding and decoding performance. Intra-frame template matching using multiple template shape candidates can be called multi-candidate intra-frame template matching.
[0121] According to an embodiment of the present invention, information indicating whether to use multi-candidate intra template matching can be signaled.
[0122] Information indicating whether to use multiple-candidate intra template matching can be signaled in at least one high level of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), a picture header, and a slice header. The information indicating whether to use multiple-candidate intra template matching can be signaled independently of the information indicating whether to use intra template matching. Alternatively, the information indicating whether to use multiple-candidate intra template matching can be signaled in addition to the information indicating whether to use intra template matching.
[0123] Table 1 shows information indicating whether to use multi-candidate intra template matching, which is signaled through the SPS.
[0124] [Table 1]
[0125]
[0126] In Table 1, a flag (sps_multiple_intra_tmp_enabled_flag) indicating whether multiple candidate intra template matching is used may be signaled in the SPS. In addition, the flag indicating whether multiple candidate intra template matching is used may be signaled independently of the information indicating whether intra template matching is used.
[0127] According to an embodiment of the present invention, information indicating whether to use intra template matching and whether to use multi-candidate intra template matching can be signaled.
[0128] Table 2 shows information indicating whether to use intra template matching and information indicating whether to use multi-candidate intra template matching, which are signaled through the SPS.
[0129] [Table 2]
[0130]
[0131] In Table 2, a flag (sps_intra_tmp_enabled_flag) indicating whether intra template matching is used may be signaled in the SPS. In addition, if the value of the flag indicating whether intra template matching is used is not 0, a flag (sps_multiple_intra_tmp_enabled_flag) indicating whether multiple candidate intra template matching is used may be signaled in the SPS. That is, the flag indicating whether multiple candidate intra template matching is used may be signaled in addition to the flag indicating whether intra template matching is used.
[0132] According to an embodiment of the present invention, information indicating whether to use multi-candidate intra template matching can be signaled in multiple levels.
[0133] Table 3 shows information indicating whether to use multi-candidate intra template matching, which is signaled through the SPS and the picture header.
[0134] [Table 3]
[0135]
[0136]
[0137] In Table 3, a flag (sps_multiple_intra_tmp_enabled_flag) indicating whether multiple candidate intra template matching is used may be signaled in the SPS. In addition, if the value of the flag indicating whether multiple candidate intra template matching is used is not 0, a flag (sps_multiple_intra_tmp_control_present_in_ph_flag) indicating whether control information for multiple candidate intra template matching is present may be signaled in the SPS. The flag indicating whether control information for multiple candidate intra template matching is present may indicate whether control information for multiple candidate intra template matching is present in the picture header.
[0138] If the value of the flag indicating whether control information for multiple candidate intra template matching exists is not 0, a flag (ph_multiple_intra_tmp_disabled_flag) indicating that multiple candidate intra template matching prediction is not used can be signaled in the picture header. Accordingly, multiple candidate intra template matching can be applied to picture units instead of the entire image.
[0139] According to an embodiment of the present invention, information indicating whether to use multi-candidate intra template matching may be signaled in multiple layers.
[0140] Table 4 shows information indicating whether to use multi-candidate intra template matching prediction, which is signaled through the SPS and the picture header.
[0141] [Table 4]
[0142]
[0143]
[0144] In Table 4, a flag (sps_multiple_intra_tmp_enabled_flag) indicating whether multiple intra template matching prediction is used may be signaled in the SPS. In addition, if the value of the flag indicating whether multiple intra template matching prediction is used is not 0, a flag (sps_multiple_intra_tmp_control_present_in_sh_flag) indicating whether control information for multiple intra template matching is present may be signaled in the SPS. The flag indicating whether control information for multiple intra template matching is present may indicate whether control information for multiple intra template matching is present in the slice header.
[0145] If the value of the flag indicating whether the control information for multiple candidate intra template matching exists is not 0, a flag (sh_multiple_intra_tmp_disabled_flag) indicating that multiple candidate intra template matching prediction is not used can be signaled in the slice header. Accordingly, multiple candidate intra template matching can be applied to slice units instead of the entire image.
[0146] The multiple candidates used in multi-candidate intra template matching prediction can be described as follows.
[0147] Figure 5 is a schematic diagram for describing a plurality of template shape candidates for intra-frame template matching prediction according to an embodiment of the present invention.
[0148] refer to Figure 5 In order to perform multi-candidate intra template matching prediction, a plurality of template shape candidates with different shapes may be used. Among the plurality of template shape candidates with different shapes, a reference template having high similarity with the current template may be used to generate a prediction block of the current block.
[0149] In this article, Figure 5 As shown in (a), the template shape candidate may include the left and upper adjacent samples of the block. The template shape candidate including the left and upper adjacent samples of the block may be referred to as Shape template. The size of the template can be expressed by (w×L2)+(L1×h)+(L1×L2). Here, w and h can represent the width and height of the block, and the values of L1 and L2 can be any positive numbers.
[0150] Alternatively, as Figure 5As shown in (b), the template shape candidate may include the left adjacent samples of the block. The template shape candidate including the left adjacent samples of the block may be referred to as the left template. The size of the left template may be represented by L3×h. Here, h may represent the height of the block, and the value of L3 may be any positive number.
[0151] Alternatively, as Figure 5 As shown in (c), the template shape candidate may include the upper adjacent samples of the block. The template shape candidate including the upper adjacent samples of the block may be called an upper template. The size of the upper template may be represented by w×L4. Here, w may represent the width of the block, and the value of L4 may be any positive number.
[0152] according to Figure 5 In an embodiment, a ┌-shaped template, a left template, and an upper template may be used to search for a reference template that is most similar to the current template. Among template shape candidates having any shape, a template shape candidate with the highest similarity to the current template may be used to search for a reference template that is most similar to the current template. The similarity between the current template and the reference template may be evaluated based on the sum of absolute differences (SAD), mean squared error (MSE), sum of squared differences (SSD), sum of absolute transformed differences (SATD), and the like.
[0153] However, in addition to Figure 5 In addition to the examples shown, neighboring samples with various shapes around the block predefined in the encoder and decoder can be used. The shape of the template is not limited to the description of the present invention.
[0154] In multi-candidate intra template matching prediction, different reference templates with high similarity to the current template can be used to generate a prediction block for the current block.
[0155] Figure 6 is a diagram for describing a method for predicting a current block by using different templates in intra template matching prediction according to an embodiment of the present invention.
[0156] refer to Figure 6 , a different reference template with high similarity to the current template can be used to generate a prediction block for the current block. In this article, the reference template can be a ┌-shaped template, and the size of the ┌-shaped template can be represented by (w×L6)+(L5×h)+(L5×L6). Here, w and h can represent the width and height of the current block, and the values of L5 and L6 can be any positive numbers.
[0157] In order to perform intra-frame template matching prediction, two reference templates with the highest similarity to the current template can be determined in a predefined reconstruction area. According to an embodiment, the two reference templates can both be ┌-shaped templates. According to another embodiment, the two reference templates can be templates with different shapes from each other. For example, the two reference templates can be a ┌-shaped template and a left template, or can be a ┌-shaped template and an upper template, or can be a left template and an upper template. According to another embodiment, the two reference templates can be two reference templates with any shape predefined in the encoder and decoder. In this article, the similarity between the current template and the reference template can be evaluated based on at least one method among SAD, MSE, SSD and SATD.
[0158] In addition, the matching blocks adjacent to the two reference templates can be linearly combined by using different weights w0 and w1. Accordingly, the prediction block of the current block can be generated by using the linearly combined matching blocks.
[0159] When predicting the current block, a different reference template that is not a ┌-shaped template can be used. That is, the current block can be predicted by using a different reference template with any shape predefined in the encoder and decoder.
[0160] The predicted block of the current block generated by combining matching blocks adjacent to different reference templates can be expressed as follows.
[0161] [Equation 1]
[0162] P (x,y) =w0*P 0(x,y) +w1*P 1(x,y)
[0163] Here, P (x,y) Represents the predicted block of the current block, P 0(x,y) and P 1(x,y) Denotes matching blocks adjacent to different reference templates, and w0 and w1 denote weights applied to the corresponding matching blocks. w0 and w1 applied to the corresponding matching blocks can be calculated as follows.
[0164] [Equation 2]
[0165]
[0166] Here, cost0 and cost1 represent the cost values of different reference templates.
[0167] Alternatively, the weights w0 and w1 applied to the corresponding matching blocks can be calculated by using a look-up table (LUT). By using the LUT, the approximate values of the weights w0 and w1 can be derived only by integer multiplication, addition, and shift operations instead of using floating-point operations.
[0168] Table 5 shows the pseudo code for deriving the weights applied to different matching blocks by using a lookup table of a convolutional cross-component model (CCCM).
[0169] [Table 5]
[0170]
[0171] In the above embodiment, when predicting the current block, the prediction block of the current block is generated by calculating the weighted sum of matching blocks derived from two reference templates. However, when predicting the current block, the prediction block of the current block can be generated by calculating the weighted sum of matching blocks derived from N reference templates. In this article, N can be an integer equal to or greater than 2. The N reference templates used for weighted summation can be composed of ┌-shaped templates, left templates, upper templates, or templates with any shape predefined in the encoder and decoder.
[0172] When predicting the current block, if the cost values of all or some of the N reference templates used for weighted summation are similar to the cost values of multiple template shape candidates, the weighted summation of the matching blocks derived from the N reference templates may not be meaningful. Accordingly, the weighted summation of the matching blocks derived from the N reference templates may be disregarded.
[0173] Here, the cost value of the reference template and each of the plurality of template shape candidates may be evaluated based on at least one method of SAD, MSE, SSD, and SATD.
[0174] Specifically, if the cost values of all or some of the N reference templates used for the weighted sum are less than a threshold, the weighted sum of the matching blocks derived from the N reference templates may not be considered as a candidate.
[0175] Here, the threshold value can be expressed by the following equation.
[0176] [Equation 3]
[0177]
[0178] [Equation 4]
[0179] Th=min(cost1,cost2,...,cost M )+offset
[0180] [Equation 5]
[0181] Th=max(cost1,cost2,...,cost M )+offset
[0182] [Equation 6]
[0183] Th=mean(cost1,cost2,...,cost M )+offset
[0184] Here, cost1, cost2, ..., cost M It is possible to represent the cost value of each of the M template shape candidates. In addition, offset is a value used for correction and can be 0, an arbitrary positive number, or an arbitrary negative number.
[0185] That is, the threshold value may be determined by using the average value, minimum value, maximum value, or median value of the cost values of the M template shape candidates.
[0186] According to an embodiment of the present invention, the encoder can determine a reference template that is most similar to the current template from among template candidates, wherein the template candidates include M template shape candidates having different shapes and a weighted sum template based on N templates. The encoder can generate a prediction block for the current block by using the determined reference template. In addition, the encoder can signal information about the template used to generate the prediction block for the current block to the decoder.
[0187] When information about a template used to generate a prediction block of a current block is signaled to a decoder, the information about the template can be signaled in a block unit, so that the computational complexity of the decoder can be reduced.
[0188] Table 6 shows information for signaling information about a template used between two template candidates.
[0189] [Table 6]
[0190] template Codeword Candidate 1 0 Candidate 2 1
[0191] For example, if a ┌-shaped template and a weighted sum template are template candidates, the ┌-shaped template may be designated as candidate 1 and assigned a codeword of 0, and the weighted sum template may be designated as candidate 2 and assigned a codeword of 1.
[0192] Table 7 shows information for signaling information about a template used among three template candidates.
[0193] [Table 7]
[0194] template Codeword Candidate 1 0 Candidate 2 10 Candidate 3 11
[0195] If three or more template candidates are used, a truncated binary code can be used to signal the template candidates. In this paper, candidate 1 is assigned the shortest codeword, and the remaining candidates are assigned codewords with the same length.
[0196] Accordingly, the most frequently used template candidate can be placed in candidate 1, and the remaining candidates can be placed in candidate 2 and candidate 3. For example, among template candidates including a ┌-shaped template, a weighted sum template, and a left template, if the ┌-shaped template is used most frequently, candidate 1 can be the ┌-shaped template. On the other hand, if the weighted sum template is used most frequently, candidate 1 can be the weighted sum template.
[0197] Table 8 shows information for signaling information about a template used among four template candidates.
[0198] [Table 8]
[0199] template Codeword Candidate 1 0 Candidate 2 10 Candidate 3 110 Candidate 4 111
[0200] Herein, the most frequently used template candidate may be placed in Candidate 1 , and the remaining candidates may be placed in Candidate 2 to Candidate 4 .
[0201] According to an embodiment of the present invention, like the encoder, the decoder may perform a search based on template matching and determine a template most similar to the template of the current block among M arbitrary templates and a weighted sum template based on N templates.
[0202] That is, the decoder searches for the most similar reference template in a predetermined search area using a current template composed of adjacent samples of the current block. Here, the similarity between the current template and the reference template can be evaluated based on at least one of SAD, MSE, SSD, and SATD. The decoder should perform template search using the same similarity evaluation method used by the encoder.
[0203] If the decoder performs a search based on template matching, complexity may increase compared to a method of acquiring information about the template used through signaling. However, as the number of bits encoded during encoding decreases, encoding and decoding performance can be improved.
[0204] Figure 7 is a flowchart illustrating an image decoding method according to an embodiment of the present invention. Figure 7 The image decoding method can be performed by an image decoding device.
[0205] The image decoding apparatus may determine whether a current block is in an intra template matching mode ( S710 ).
[0206] The image decoding apparatus may determine a template shape of the current block from among a plurality of template shape candidates (S720). The plurality of template shape candidates may have different shapes. Figure 5 An implementation scheme for multiple template shape candidates is described in detail in .
[0207] The image decoding apparatus may determine a reference template based on the current template according to the template shape ( S730 ).
[0208] The image decoding apparatus may generate a prediction block of the current block based on the reference template ( S740 ).
[0209] Herein, whether the current block is in intra template matching mode can be determined based on information signaled via the bitstream. In addition, the information signaled via the bitstream can include information indicating whether the intra template matching mode of the current block uses multiple template shape candidates. Tables 1 to 4 describe in detail embodiments of determining whether the current block is in intra template matching mode based on the information signaled via the bitstream.
[0210] In this paper, a prediction block of a current block may be generated by a weighted sum of matching blocks adjacent to different reference templates corresponding to the current template.
[0211] Herein, the weights for the weighted sum of matching blocks may be determined based on the cost value of each of the different reference templates. The weights for the weighted sum of matching blocks may be determined based on a lookup table corresponding to the cost value of each of the different reference templates.
[0212] In this paper, if the cost value of at least one of the different reference templates is greater than a threshold, the prediction block of the current block can be generated by the weighted sum of the different matching blocks. In addition, a threshold can be set based on the cost values of multiple template shape candidates. Figure 6 An implementation scheme for generating by weighted sum of matching blocks adjacent to different reference templates corresponding to the current template is described in detail in .
[0213] Here, the current template may be determined among a plurality of template shape candidates based on information signaled through a bitstream. Implementations of signaling information for determining the current template among a plurality of template shape candidates are described in detail in Tables 6 to 8.
[0214] Herein, among a plurality of template shape candidates, a reference template may be determined based on the shape of a reference template having the highest similarity to a current template.
[0215] Figure 7 The steps described in the above can be performed in the same manner as the image coding method. Figure 7The image encoding method according to the steps described in the embodiment of the present invention generates a bit stream. The bit stream can be stored in a non-volatile computer-readable recording medium and can also be transmitted (or streamed).
[0216] Figure 8 is a schematic diagram for illustrating a content streaming system to which an embodiment according to the present invention is applicable.
[0217] like Figure 8 As shown, the content streaming system to which the embodiment of the present invention is applied may mainly include an encoding server, a streaming server, a network server, a media storage device, a user device, and a multimedia input device.
[0218] The encoding server compresses the content received from the multimedia input device such as a smartphone, a camera, a CCTV, etc. into digital data to generate a bitstream and transmits it to the streaming server. As another example, if the multimedia input device such as a smartphone, a camera, a CCTV, etc. directly generates the bitstream, the encoding server can be omitted.
[0219] A bitstream may be generated by the image encoding method and / or the image encoding apparatus to which the embodiments of the present invention are applied, and a streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.
[0220] The streaming server transmits multimedia data to a user device based on a user request via a network server. The network server can also function as an intermediary, notifying the user of any available services. When a user requests a desired service from the network server, the network server transmits the request to the streaming server, which then transmits the multimedia data to the user. In this case, the content streaming system may include a separate control server, which can control commands and responses between devices within the content streaming system.
[0221] The streaming server can receive content from a media storage device and / or an encoding server. For example, when receiving content from an encoding server, the content can be received in real time. In this case, in order to provide a smooth streaming service, the streaming server can store the bitstream for a period of time.
[0222] Examples of user devices may include mobile phones, smartphones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, tablet PCs, tablet PCs, ultrabooks, wearable devices (e.g., smart watches, smart glasses, HMDs), digital televisions, desktop computers, digital signage, etc.
[0223] Each server in the above-described content streaming system may operate as a distributed server, in which case data received from each server may be distributed and processed.
[0224] The above embodiments may be performed in the same or corresponding manner in the encoding device and the decoding device. In addition, an image may be encoded / decoded using at least one or a combination of at least one of the above embodiments.
[0225] The order of applying the above-described embodiments may be different in the encoding device and the decoding device. Alternatively, the order of applying the above-described embodiments may be the same in the encoding device and the decoding device.
[0226] The above-described embodiments may be performed on each of the luminance signal and the chrominance signal. Alternatively, the above-described embodiments may be performed identically for the luminance signal and the chrominance signal.
[0227] In the above embodiments, the method is described based on a flow chart having a series of steps or units, but the present invention is not limited to the order of the steps. On the contrary, some steps can be performed simultaneously with other steps or in a different order. In addition, it should be understood by those skilled in the art that the steps in the flow chart are not mutually exclusive, and other steps can be added to the flow chart or some steps can be deleted from the flow chart without affecting the scope of the present invention.
[0228] The embodiments may be implemented in the form of program instructions that are executable by various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium may include independent program instructions, data files, data structures, etc., or a combination thereof. The program instructions recorded in the computer-readable recording medium may be specially designed and constructed for the present invention, or may be well known to those skilled in the art in the field of computer software technology.
[0229] The bit stream generated by the encoding method according to the above embodiment can be stored in a non-volatile computer-readable recording medium. In addition, the bit stream stored in the non-volatile computer-readable recording medium can be decoded by the decoding method according to the above embodiment.
[0230] Examples of computer-readable recording media include: magnetic recording media such as hard disks, floppy disks, and magnetic tapes; optical data storage media such as CD-ROMs or DVD-ROMs; magneto-optical media such as floppy disks; and hardware devices such as read-only memory (ROM), random access memory (RAM), flash memory, etc., which are specifically configured to store and execute program instructions. Examples of program instructions include not only machine language codes formatted by a compiler, but also high-level language codes that can be implemented by a computer using an interpreter. A hardware device can be configured to be operated by one or more software modules or vice versa to perform the process according to the present invention.
[0231] Although the present invention has been described in terms of specific items such as detailed elements and limited embodiments and drawings, they are provided only to help a more comprehensive understanding of the present invention, and the present invention is not limited to the above embodiments. It will be understood by those skilled in the art that various modifications and changes can be made based on the above description.
[0232] Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the full scope of the appended claims and their equivalents should fall within the scope and spirit of the present invention.
[0233] Industrial Applicability
[0234] The present invention can be used in an apparatus for encoding / decoding an image and a recording medium for storing a bit stream.
Claims
1. A method for decoding an image, the method comprising: Determine whether the current block is in intra template matching mode; determining a template shape of a current block among a plurality of template shape candidates; According to the template shape, search for a reference template based on the current template; as well as A prediction block of the current block is generated based on the reference template.
2. The method according to claim 1, wherein Determine whether the current block is in intra template matching based on information signaled via the bitstream, and The information signaled via the bitstream includes information indicating whether the intra template matching mode of the current block uses multiple template shape candidates.
3. The method according to claim 1, wherein The prediction block of the current block is generated by a weighted sum of matching blocks adjacent to different reference templates corresponding to the current template.
4. The method according to claim 3, wherein: The weights for the weighted sum of the matching blocks are determined based on the cost values of each of the different reference templates.
5. The method according to claim 4, wherein The weights for the weighted sum of the matching blocks are determined based on a lookup table corresponding to the cost values for each of the different reference templates.
6. The method according to claim 4, wherein: When the cost value of at least one of the different reference templates is greater than a threshold, a prediction block of the current block is generated by a weighted sum of the matching blocks that are different from each other, and The threshold is set based on cost values of a plurality of template shape candidates.
7. The method according to claim 1, wherein Based on information signaled via the bitstream, a current template is determined among a plurality of template shape candidates.
8. The method according to claim 1, wherein The current template is determined based on the shape of a reference template having the highest similarity to the current template among multiple template shape candidates.
9. A method for image encoding, comprising: Determine whether the current block is in intra template matching mode; determining a template shape of a current block among a plurality of template shape candidates; According to the template shape, search for a reference template based on the current template; as well as A prediction block of the current block is generated based on the reference template.
10. A non-volatile computer-readable recording medium for storing a bit stream generated by an image encoding method, in, Image coding methods include: Determine whether the current block is in intra template matching mode; determining a template shape of a current block among a plurality of template shape candidates; Searching for a reference template based on the current template according to the template shape; and A prediction block of the current block is generated based on the reference template.
11. A method for transmitting a bit stream generated by an image encoding method, the method comprising: Transmit bit stream, The image encoding method includes: Determine whether the current block is in intra template matching mode; determining a template shape of a current block among a plurality of template shape candidates; Searching for a reference template based on the current template according to the template shape; and A prediction block of the current block is generated based on the reference template.