Image encoding / decoding method and apparatus, and recording medium storing bit stream
By combining intra-template matching and DIMD/TIMD methods in the intra-prediction mode, the final prediction block is generated using weight weighting, and the problem that the intra-template matching prediction method in the prior art fails to effectively utilize the surrounding reference pixel information, improving the encoding/decoding efficiency and prediction accuracy.
Patent Information
- Application Number
- CN202380080825.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-12-26
- Filing Date
- 2023-12-21
- Publication Date
- 2025-07-04
AI Technical Summary
The existing intra-template matching prediction method fails to effectively utilize the surrounding reference pixel information of the current block when generating the prediction block, resulting in a possible discontinuity between the prediction block and the surrounding reference pixel, affecting the encoding/decoding efficiency.
By deducing the intra prediction mode of the current block, combining intra-template matching and decoder-side intra-mode derivation (DIMD) or template-based intra-mode derivation (TIMD) methods, the final prediction block is generated, and the intra-prediction block and the template-matching prediction block are combined using the first and second weight weights to improve the prediction accuracy.
The encoding/decoding efficiency is improved, the discontinuity between the intra prediction block and the surrounding reference pixel is reduced, and the prediction accuracy is improved.
Smart Images

Figure CN120266480A_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 an intra prediction method using intra-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 relatively increases compared to existing image data. Therefore, when transmitting such image data using an existing medium such as a wired or wireless broadband channel, or when storing such image data using an existing storage medium, both the transmission and storage costs increase. To solve these problems that occur as the resolution and quality of image data become higher, an efficient image encoding / decoding technique is required for images with higher resolution and image quality.
[0003] In the existing intra-template matching prediction method, when generating a prediction block, information about surrounding reference pixels of the current block is not considered, so discontinuity may occur between the prediction block generated by intra-template matching prediction and surrounding adjacent reference pixels. Summary of the Invention
[0004] Technical Problem
[0005] An object of the present invention is to provide a method and apparatus for encoding / decoding an image having improved encoding / decoding efficiency.
[0006] Another object of the present invention is to provide a recording medium for storing a bitstream generated by a method or apparatus for decoding an image according to the present invention.
[0007] Another object of the present invention is to provide an intra prediction method that uses improved intra-template matching to solve the above problems of the intra-template matching prediction method.
[0008] Technical Solution
[0009] A method for decoding an image according to an embodiment of the present invention may include: deriving an intra prediction mode of a current block, deriving a first prediction block of the current block based on the intra prediction mode, deriving a second prediction block of the current block based on intra-template matching, and deriving a final prediction block by applying a first weight and a second weight to the first prediction block and the second prediction block, respectively.
[0010] In a method for decoding an image, an intra prediction mode can be derived by a decoder-side intra mode derivation (DIMD) method.
[0011] In a method for decoding an image, the DIMD method can be performed by utilizing a gradient histogram of pixels.
[0012] In a method for decoding an image, an intra prediction mode can be derived by a template-based intra mode derivation (TIMD) method.
[0013] In a method for decoding an image, the TIMD method can be performed by selecting any one of candidate modes within an intra prediction candidate list of a current block based on a template of the current block.
[0014] In a method for decoding an image, a first weight and a second weight can be determined by index information obtained from a bitstream.
[0015] In a method for decoding an image, a first weight and a second weight can be determined based on an upper adjacent block and a left adjacent block of the current block.
[0016] In a method for decoding an image, a first weight and a second weight can be determined based on whether an upper adjacent block and a left adjacent block of the current block are each in an intra template matching prediction mode.
[0017] In a method for decoding an image, a first weight and a second weight can be determined based on whether an upper adjacent block and a left adjacent block of the current block are each in a DIMD mode.
[0018] In a method for decoding an image, a first weight and a second weight can be determined based on whether an upper adjacent block and a left adjacent block of the current block are each in a TIMD mode.
[0019] In a method for decoding an image, a first weight and a second weight can be determined based on a count of prediction modes of an upper adjacent block and a left adjacent block of the current block.
[0020] A method for encoding an image according to an embodiment of the present invention may include: deriving an intra prediction mode of a current block, deriving a first prediction block of the current block based on the intra prediction mode, deriving a second prediction block of the current block based on intra template matching, and deriving a final prediction block by applying a first weight and a second weight to the first prediction block and the second prediction block, respectively.
[0021] A non - volatile computer - readable recording medium according to an embodiment of the present invention can store a bitstream generated by a method for encoding an image. The method for encoding an image may include: deriving an intra - prediction mode of a current block, deriving a first prediction block of the current block based on the intra - prediction mode, deriving a second prediction block of the current block based on intra - template matching, and deriving a final prediction block by applying a first weight and a second weight to the first prediction block and the second prediction block, respectively.
[0022] A method for transmitting a bitstream generated by a method for encoding an image according to an embodiment of the present invention may include transmitting the bitstream, and the method for encoding an image may include: deriving an intra - prediction mode of a current block, deriving a first prediction block of the current block based on the intra - prediction mode, deriving a second prediction block of the current block based on intra - template matching, and deriving a final prediction block by applying a first weight and a second weight to the first prediction block and the second prediction block, respectively.
[0023] The features briefly outlined above regarding the present invention are merely exemplary aspects of the detailed description of the present invention below and do not limit the scope of the present invention.
[0024] Advantageous Effects
[0025] According to the present invention, it is possible to provide a method and apparatus for encoding / decoding an image, which have improved encoding / decoding efficiency.
[0026] Furthermore, according to the present invention, it is possible to provide an intra - prediction method using improved intra - template matching.
[0027] In addition, according to the present invention, it is possible to improve intra - prediction accuracy and reduce the discontinuity between an intra - prediction block and surrounding reference pixels.
[0028] The effects obtainable according to the present invention are not limited to the above - mentioned effects, and those skilled in the art will clearly understand other effects not mentioned through the following description. Brief Description of the Drawings
[0029] Figure 1 is a block diagram showing the configuration of an encoding apparatus according to an embodiment of the present invention.
[0030] Figure 2 is a block diagram showing the configuration of a decoding apparatus according to an embodiment of the present invention.
[0031] Figure 3 is a schematic diagram schematically showing a video encoding / decoding system to which the present invention can be applied.
[0032] Figure 4 is a schematic diagram for describing intra - template matching according to an embodiment of the present invention.
[0033] Figure 5 is a schematic diagram for describing a current block and adjacent blocks adjacent to the current block according to an embodiment of the present invention.
[0034] Figure 6 is a flowchart showing a method for decoding an image according to an embodiment of the present invention.
[0035] Figures 7 to 9 is a flowchart for showing a method for intra prediction mode assignment of a block decoded by intra-frame template matching according to an embodiment of the present invention.
[0036] Figure 10 Exemplarily shows a content streaming system to which an embodiment of the present invention can be applied. Detailed Description
[0037] The present invention can 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 alternative forms within the spirit and technical scope of the present invention. The same reference numerals 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 following detailed description of the exemplary embodiments refers to the drawings, which show specific embodiments by way of example. These embodiments are described in sufficient detail so that those skilled in the art can 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 embodiments, the positions or arrangements of the respective components within each disclosed embodiment can be changed. Accordingly, the following detailed description is not intended to be restrictive, and the scope of the exemplary embodiments is only defined by the appended claims and the full scope of the equivalent forms given by these claims (if appropriately described).
[0038] In the present invention, terms such as first, second, etc. can be used to describe each component, but the components should not be limited by the terms. The terms are only used for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component can be called the second component, and similarly, the second component can also be called the first component. The term "and / or" includes a combination of multiple related description items or any item among multiple related description items.
[0039] 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 may be combined to form a single component, or one component may be divided into multiple components to perform functions, as long as the essence of the present invention is not departed from, the embodiments in which the components are integrated and the embodiments in which each component is divided are also included in the scope of the present invention.
[0040] The terms used in the present invention are only for describing 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 and may be optional components only for improving performance. The present invention can be implemented by only including the essential components for realizing the gist of the present invention and not including the components only for improving performance, and the structure that only includes the essential components and does not include the optional components only for improving performance is also included in the scope of the present invention.
[0041] In an embodiment, the term "at least one" may represent one of a number greater than or equal to 1, such as 1, 2, 3, and 4. In an embodiment, the term "a plurality of" may represent one of a number greater than or equal to 2, such as 2, 3, and 4.
[0042] Hereinafter, embodiments of the present invention will be specifically described with reference to the accompanying drawings. When describing the embodiments of this specification, if it is determined that the detailed description of relevant 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 the repeated description of the same components will be omitted.
[0043] Description of Terms
[0044] Hereinafter, an "image" may represent one picture constituting a video and may also refer to the video itself. For example, "encoding and / or decoding of an image" may represent "encoding and / or decoding of a video" and may also represent "encoding and / or decoding of one of the images constituting the video".
[0045] Hereinafter, "moving image" and "video" may be used with the same meaning and may be used interchangeably. In addition, a target image may be an encoding target image to be encoded and / or a decoding target image to be decoded. In addition, a target image may be an input image input to an encoding device and may be an input image input to a decoding device. Here, the target image may have the same meaning as the current image.
[0046] Hereinafter, the encoder and the image encoding device may be used interchangeably with the same meaning.
[0047] Hereinafter, the decoder and the image decoding device may be used interchangeably with the same meaning.
[0048] Hereinafter, "image", "picture", "frame", and "picture" may be used interchangeably with the same meaning.
[0049] Hereinafter, the "target block" may be an encoding target block that is the target of encoding and / or a decoding target block that is the target of decoding. In addition, the target block may be the current block that is the target of the current encoding and / or decoding. For example, the "target block" and the "current block" may be used interchangeably with the same meaning.
[0050] Hereinafter, "block" and "unit" may be used interchangeably with the same meaning. In addition, "unit" may represent a block including a luminance component block and its corresponding chrominance component block in order to distinguish it from a block. For example, a coding tree unit (CTU) may be composed of a coding tree block (CTB) of one luminance component (Y) and two coding tree blocks of its associated chrominance components (Cb, Cr).
[0051] Hereinafter, "sample", "picture element", and "pixel" may be used interchangeably with the same meaning. In this article, a sample may represent the basic unit that constitutes a block.
[0052] Hereinafter, "inter-frame" and "inter-picture" may be used interchangeably with the same meaning.
[0053] Hereinafter, "intra-frame" and "intra-picture" may be used interchangeably with the same meaning.
[0054] Figure 1 It is a block diagram showing the configuration of an encoding device according to an embodiment of the present invention.
[0055] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. The video may include one or more images. The encoding device 100 may sequentially encode one or more images.
[0056] Reference Figure 1, the encoding device 100 may include: an image partitioning unit 110, an intra prediction unit 120, a motion prediction unit 121, a motion compensation unit 122, a switch 115, a subtractor 113, a transformation unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transformation unit 170, an adder 117, a filtering unit 180, and a reference picture buffer 190.
[0057] In addition, the encoding device 100 may generate a bitstream including information encoded by encoding an input image, and output the generated bitstream. The generated bitstream may be stored in a computer-readable recording medium, or may be streamed through a wired / wireless transmission medium.
[0058] 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 hierarchically partitioned and processed. For example, a picture can be partitioned into one or more tiles or slices, and then further partitioned into multiple coding tree units (CTUs). Alternatively, a picture can first be partitioned into multiple sub-pictures defined as a group of rectangular slices, and each sub-picture can be partitioned into tiles / slices. Here, the sub-pictures can be used to support the function of encoding / decoding and transmitting pictures partially independently. Since multiple sub-pictures can be reconstructed separately, this has the advantage of being easily editable in applications where multi-channel inputs are configured as one picture. Additionally, tiles can be horizontally divided to generate bricks. Here, the bricks can be used as the basic unit for parallel processing within a picture. Additionally, a CTU can be recursively partitioned into a quad tree (QT), and the terminal nodes of the partition can be defined as coding units (CUs). A CU can be partitioned into a prediction unit (PU) and a transform unit (TU) to perform prediction and partitioning. On the other hand, a 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 (MTTs) as well as quad trees (QTs). Partitioning a CTU into a multi-type tree can start from the terminal nodes of the QT, and an MTT can be composed of a binary tree (BT) and a tripletree (TT). For example, the MTT structure can be classified into a vertical binary split pattern (SPLIT_BT_VER), a horizontal binary split pattern (SPLIT_BT_HOR), a vertical triplet split pattern (SPLIT_TT_VER), and a horizontal triplet split pattern (SPLIT_TT_HOR). Additionally, during partitioning, the minimum block size (MinQTSize) of the quad tree for the luminance 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 tripletree can be set to 64×64. Additionally, the minimum block size (MinBtSize) of the binary tree and the minimum block size (MinTtSize) of the tripletree can be specified as 4×4, and the maximum depth (MaxMttDepth) of the multi-type tree can be specified as 4. Additionally, to improve the encoding efficiency of I slices, a dual tree with a CTU partitioning structure that differently uses the luminance component and the chrominance component can be applied.On the other hand, in P slices and B slices, the luminance and chrominance coding tree blocks (CTBs) within a CTU can be partitioned into a single tree sharing a coding tree structure.
[0059] Encoding device 100 can perform encoding on an input image in an intra mode and / or an inter mode. Alternatively, encoding device 100 can perform encoding on the input image in a third mode (e.g., IBC mode, palette mode, etc.) other than the intra mode and the inter mode. However, if the third mode has functional characteristics similar to the intra mode or the inter mode, for the sake of easy explanation, it can be classified as the intra mode or the inter mode. In the present invention, the third mode is classified and described separately only when a specific description of the third mode is required.
[0060] When using the intra mode as the prediction mode, switch 115 can switch to intra, and when using the inter mode as the prediction mode, switch 115 can switch to inter. Here, the intra mode can represent an intra prediction mode, and the inter mode can represent an inter prediction mode. Encoding device 100 can generate a prediction block for an input block of the input image. Additionally, encoding device 100 can encode a residual block by using the residual between 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 or the encoding target block that is the current encoding target.
[0061] When the prediction mode is the intra mode, intra prediction unit 120 can use samples of already encoded / decoded blocks surrounding the current block as reference samples. 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. Here, intra prediction can represent in-picture prediction.
[0062] As intra prediction methods, non-directional prediction modes such as DC mode and planar mode and directional prediction modes (e.g., 65 directions) can be applied. Here, the intra prediction method can be expressed as an intra prediction mode or an in-picture prediction mode.
[0063] When the prediction mode is the inter mode, motion prediction unit 121 can retrieve, in motion prediction processing, a region in a reference image that best matches the input block, and derive a motion vector by using the retrieved region. In this case, the search region can be used as the region. The reference image can be stored in reference picture buffer 190. Here, when performing encoding / decoding of the reference image, it can be stored in reference picture buffer 190.
[0064] The motion compensation unit 122 can generate a predicted block of the current block by performing motion compensation using motion vectors. In this context, inter-frame prediction can represent inter-picture prediction or motion compensation.
[0065] When the value of the motion vector is not an integer, the motion prediction unit 121 and the motion compensation unit 122 can generate a predicted block by applying an interpolation filter to a partial region of the reference picture. To perform inter-frame prediction or motion compensation, it can be determined based on the codec unit whether the motion prediction and motion compensation modes of the prediction units included in the codec unit are one of the skip mode, the merge mode, the advanced motion vector prediction (AMVP) mode, and the intra block copy (IBC) mode, and inter-frame prediction or motion compensation can be performed according to each mode.
[0066] In addition, based on the above inter-frame prediction method, an affine (AFFINE) mode based on sub-PU prediction, a subblock-based temporal motion vector prediction (SbTMVP) mode, a merge with MVD (MMVD) mode based on PU prediction, and a geometric partitioning mode (GPM) mode can be applied. In addition, to improve the performance of each mode, a history based MVP (HMVP), a pairwise average MVP (PAMVP), a combined intra / inter prediction (CIIP), an adaptive motion vector resolution (AMVR), a bi-directional optical-flow (BDOF), a bi-predictive with CU weights (BCW), a local illumination compensation (LIC), a template matching (TM), an overlapped block motion compensation (OBMC), etc. can be applied.
[0067] Among them, the affine (AFFINE) mode is a technique used in both the AMVP and merge (MERGE) modes and also has high coding efficiency. In existing video coding standards, since motion compensation (MC) is performed by only considering the parallel movement of blocks, it has the drawback of being unable to appropriately compensate for motions that occur in reality (e.g., 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, the CPMV is a vector of an affine motion model representing one of the upper left, upper right, and lower left sides of the current block.
[0068] The subtractor 113 can generate a residual block by using the difference between the input block and the predicted block. The residual block can be referred to as a residual signal. The residual signal can represent the difference between the original signal and the predicted signal. Alternatively, the residual signal can be a signal generated by transforming or quantizing, or both transforming and quantizing, the difference between the original signal and the predicted signal. The residual block can be the residual signal of a block unit.
[0069] The transform unit 130 can generate transform coefficients by performing a transform on the residual block and output the generated transform coefficients. Here, the transform coefficients can be the coefficient values generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 can skip the transform of the residual block.
[0070] Quantization levels can be generated by applying quantization to the transform coefficients or the residual signal. Hereinafter, the quantization levels can also be referred to as transform coefficients in the embodiments.
[0071] For example, a 4×4 luminance residual block generated by intra-frame prediction is transformed using basis vectors based on the discrete sine transform (DST), and the remaining residual blocks can be transformed using basis vectors based on the discrete cosine transform (DCT). Additionally, the residual quad tree (RQT) technique is used to partition the transform block into a quadtree shape of one block, and after performing transform and quantization on each transformed block partitioned by RQT, the coded block flag (cbf) can be transmitted when all coefficients become 0 to improve coding efficiency.
[0072] As another alternative, a Multiple Transform Selection (MTS) technique that selectively uses multiple transform bases to perform a transform can be applied. That is, instead of partitioning a CU into TUs by RQT, a function similar to TU partitioning can be performed by a sub-block Transform (SBT) technique. Specifically, SBT is only applied to an inter-prediction block, and different from RQT, the current block can be partitioned into 1 / 2 or 1 / 4 sizes in the vertical or horizontal direction, and then a transform can be performed only on one of the blocks. For example, if the current block is vertically partitioned, a transform can be performed on the leftmost or rightmost block, and if the current block is horizontally partitioned, a transform can be performed on the uppermost or lowermost block.
[0073] In addition, a Low Frequency Non-Separable Transform (LFNST) can be applied, which is a quadratic transform technique that additionally transforms the transformed residual signal into the frequency domain by DCT or DST. LFNST additionally performs a transform on the 4×4 or 8×8 low-frequency region in the upper left, so that the residual coefficients can be concentrated in the upper left.
[0074] The quantization unit 140 can generate quantization levels by quantizing the transform coefficients or the residual signal according to a quantization parameter (QP), and output the generated quantization levels. Herein, the quantization unit 140 can quantize the transform coefficients by using a quantization matrix.
[0075] For example, a quantizer with a QP value from 0 to 51 can be used. Alternatively, if the image size is large and high coding efficiency is required, a QP of 0 to 63 can be used. In addition, a Dependent Quantization (DQ) method that uses two quantizers instead of one quantizer can 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, the quantizer for the next transform coefficient can be selected based on the current state by a state transition model.
[0076] The entropy coding unit 150 can generate a bitstream by performing entropy coding on the value calculated by the quantization unit 140 or on the codec parameter value calculated during encoding according to a probability distribution, and output the bitstream. The entropy coding unit 150 can perform entropy coding on information about samples of the image and information for decoding the image. For example, the information for decoding the image can include syntax elements.
[0077] When entropy coding is applied, symbols are represented such that a smaller number of bits are assigned to symbols with high occurrence probabilities and a larger number of bits are assigned to symbols with low occurrence probabilities, so that the size of the bitstream for the symbols to be encoded can be reduced. The entropy coding unit 150 may 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 may perform entropy coding by using a variable length coding / code (VLC) table. Additionally, the entropy coding unit 150 may derive a binarization method for a target symbol and a probability model of the target symbol / binary, and perform arithmetic coding by using the derived binarization method and context model.
[0078] 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. Additionally, two different probability models can be used to obtain more accurate symbol probability values.
[0079] To encode the transform coefficient levels (quantization levels), the entropy coding unit 150 may change the coefficients in two-dimensional block form to one-dimensional vector form by a transform coefficient scanning method.
[0080] The coding / decoding parameters may include information (flags, indices, etc.), such as syntax elements, encoded in the coding device 100 and signaled to the decoding device 200, and information derived during the coding or decoding process, and may represent information required when encoding or decoding an image.
[0081] Herein, signaling a flag or index may mean that the corresponding flag or index is entropy encoded in the encoder and included in the bitstream, and may mean that the corresponding flag or index is entropy decoded from the bitstream in the decoder.
[0082] The encoded current image may be used as a reference image for another image to be processed later. Thus, the coding device 100 may reconstruct or decode the encoded current image again, and store the reconstructed or decoded image in the reference picture buffer 190 as a reference image.
[0083] The quantization levels can be dequantized in the dequantization unit 160, or can be inverse-transformed in the inverse transformation unit 170. The coefficients of the dequantization and / or inverse transformation can be added to the prediction block by the adder 117. Herein, the coefficients of the dequantization and / or inverse transformation can represent the coefficients of at least one of the dequantization and inverse transformation being performed, and can represent the reconstructed residual block. The dequantization unit 160 and the inverse transformation unit 170 can perform inverse processes of the quantization unit 140 and the transformation unit 130.
[0084] The reconstructed block can pass through the filtering unit 180. The filtering unit 180 can 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 the reconstructed samples, reconstructed blocks, or reconstructed images using all or some filtering techniques. The filtering unit 180 can be referred to as an in-loop filter. In this case, the in-loop filter can also be used as a name that does not include LMCS.
[0085] The deblocking filter can remove the block distortion generated at the boundary between blocks. To determine whether to apply the deblocking filter, it can be determined whether to apply the deblocking filter to the current block based on the samples included in several rows or columns included in the block. When applying the deblocking filter to a block, different filters can be applied according to the required deblocking filtering strength.
[0086] To compensate for coding errors using sample adaptive offset, an appropriate offset value can be added to the sample value. The sample adaptive offset can correct the offset from the original image on a sample-by-sample basis for the deblocked image. A method of partitioning the samples included in the image into a predetermined number of regions, determining the regions to which the offset is to be applied, and applying the offset to the determined regions, or a method of applying the offset considering the edge information for each sample can be used.
[0087] The bilateral filter (BIF) can also correct the offset from the original image on a sample-by-sample basis for the image that has already been deblocked.
[0088] The adaptive loop filter can perform filtering based on the comparison result between the reconstructed image and the original image. The samples included in the image can be partitioned into a predetermined group, the filter to be applied to each group can be determined, and differential filtering can be performed on each group. The 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 vary.
[0089] In luma mapping with chroma scaling (LMCS), luma mapping (LM) represents remapping luma values through a piecewise linear model, and chroma scaling (CS) represents a technique for scaling the residual values of chroma components according to the average luma value of a predicted signal. In particular, LMCS can be used as an HDR correction technique that reflects the characteristics of a High Dynamic Range (HDR) image.
[0090] The reconstructed blocks or reconstructed images that have passed through the filtering unit 180 can be stored in the reference picture buffer 190. The reconstructed blocks that have passed through the filtering unit 180 can be part of a reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks that have passed through the filtering unit 180. The stored reference image can be used later for inter-frame prediction or motion compensation.
[0091] Figure 2 It is a block diagram showing the configuration of a decoding device according to an embodiment of the present invention.
[0092] The decoding device 200 can be a decoder, a video decoding device, or an image decoding device.
[0093] Reference 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 prediction unit 240, a motion compensation unit 250, an adder 201, a switch 203, a filtering unit 260, and a reference picture buffer 270.
[0094] 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 through a wired / wireless transmission medium. The decoding device 200 can decode the bitstream in an intra mode or an inter mode. Additionally, 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.
[0095] When the prediction mode for decoding is the intra mode, the switch 203 can switch to intra. Alternatively, when the prediction mode for decoding is the inter mode, the switch 203 can switch to inter.
[0096] The decoding device 200 can obtain a reconstructed residual block by decoding an 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 to be decoded by adding the reconstructed residual block and the prediction block. The block to be decoded can be referred to as the current block.
[0097] The entropy decoding unit 210 can generate symbols by entropy decoding the bitstream according to a probability distribution. The generated symbols can include symbols in the form of quantization levels. Herein, the entropy decoding method can be the inverse process of the above-mentioned entropy encoding method.
[0098] The entropy decoding unit 210 can change coefficients in the shape of a one-dimensional vector into coefficients in the shape of a two-dimensional block by a transform coefficient scanning method to decode the transform coefficient level (quantization level).
[0099] The quantization level can be dequantized in the dequantization unit 220 or inverse-transformed in the inverse transform unit 230. The quantization level can be the result of dequantization and / or inverse transformation and can be generated as a reconstructed residual block. Herein, the dequantization unit 220 can apply a quantization matrix to the quantization level. The dequantization unit 220 and the inverse transform unit 230 applied to the decoding device can apply the same techniques as the dequantization unit 160 and the inverse transform unit 170 applied to the foregoing encoding device.
[0100] When using the intra mode, the intra prediction unit 240 can generate a prediction block by performing spatial prediction on the current block, and the spatial prediction uses the sample values of the blocks that have been decoded around the block to be decoded. The intra prediction unit 240 applied to the decoding device can apply the same techniques as the intra prediction unit 120 applied to the foregoing encoding device.
[0101] When using the inter 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 region within the reference image. 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 a skip mode, a merge mode, an AMVP mode, or a 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 techniques as the motion compensation unit 122 applied to the above-mentioned encoding device.
[0102] 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 technique as the filtering unit 180 applied to the aforementioned encoding device.
[0103] The filtering unit 260 can output the reconstructed image. The reconstructed block or the reconstructed image can be stored in the reference picture buffer 270 and used for inter prediction. The reconstructed block that has passed through the filtering unit 260 can be part of the reference image. That is, the reference image can be a reconstructed image composed of the reconstructed blocks that have passed through the filtering unit 260. The stored reference image can be used later for inter prediction or motion compensation.
[0104] Figure 3 is a schematic diagram schematically showing a video codec system to which the present invention can be applied.
[0105] The video codec system according to an embodiment can include an encoding device 10 and a decoding device 20. The encoding device 10 can send encoded video and / or image information or data to the decoding device 20 in the form of a file or a stream via a digital storage medium or a network.
[0106] The encoding device 10 according to an embodiment can include a video source generation unit 11, an encoding unit 12, and a sending unit 13. The decoding device 20 according to an embodiment can include a receiving unit 21, a decoding unit 22, and a rendering unit 23. The encoding unit 12 can be referred to as a video / image encoding unit, and the decoding unit 22 can be referred to as a video / image decoding unit. The sending unit 13 can be included in the encoding unit 12. The receiving unit 21 can be included in the decoding unit 22. The rendering unit 23 can include a display unit, and the display unit can be configured as a separate device or an external component.
[0107] The video source generation unit 11 can obtain video / images through processes such as capturing, synthesizing, or generating video / images. The video source generation unit 11 can include a video / image capturing device and / or a video / image generating device. The video / image capturing device can include, for example, one or more cameras, a video / image archive including previously captured video / images, etc. The video / image generating device can include, for example, a computer, a tablet, and a smartphone, etc., and can (electronically) generate video / images. For example, virtual video / images can be generated by a computer or the like, in which case, the video / image capturing process can be replaced by a process of generating relevant data.
[0108] 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 bitstream. The detailed configuration of the encoding unit 12 can also be configured in the same manner as the above Figure 1 encoding device 100.
[0109] The sending unit 13 can send the encoded video / image information or data output in the form of a bitstream to the receiving unit 21 of the decoding device 20 in the form of a file or streaming through a digital storage medium or a network. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The sending unit 13 can include elements for generating a media file in a predetermined file format and can include elements for transmitting through a broadcast / communication network. The receiving unit 21 can extract / receive the bitstream from the storage medium or the network and send it to the decoding unit 22.
[0110] 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 configured in the same manner as Figure 2 the above decoding device 200.
[0111] The rendering unit 23 can render the decoded video / image. The rendered video / image can be displayed through the display unit.
[0112] Hereinafter, an intra prediction method using intra-template matching according to an embodiment of the present invention will be described with reference to Figures 4 to 6 an intra-template matching prediction method according to an embodiment of the present invention will be described.
[0113] In the present invention, intra-template matching is an intra prediction method that searches for the block most similar to the current block by performing template matching in the reconstructed region within the current picture and derives the searched block as the prediction block of the current block. The above intra prediction method can be defined as intra-template matching prediction (intra TMP).
[0114] Figure 4 is a schematic diagram for describing the intra-template matching prediction according to an embodiment of the present invention.
[0115] Refer to Figure 4, based on the current coding / decoding block 410, intra-template matching prediction can determine the best prediction block for the current block in the reconstructed region 430 within the current picture 400. Specifically, in intra-template matching prediction, the set of neighboring reference pixels around the current coding / decoding block 410 can be defined as the current template 420. Additionally, a similar template 440 of the current template can be found through a template-matching-based search performed within the reconstructed region 430 based on the current template 420, thereby determining the matching block 450. Herein, the matching block 450 can be used as the prediction block for the current coding / decoding block 410.
[0116] On the other hand, template matching can be performed in predefined regions R1, R2, R3, and R4 within the reconstructed region 430, and the search can be performed in the order of R1, R2, R3, and R4.
[0117] Since intra-template matching prediction does not consider any neighboring reference pixels of the current block when generating the prediction block for the current block, the prediction may have limited accuracy. Specifically, discontinuities may occur between the prediction block generated by intra-template matching prediction and the neighboring reference pixels of the current block.
[0118] To solve the above problems, embodiments of the present invention can consider information about the neighboring reference pixels of the current block when performing intra-template matching prediction. Specifically, the final prediction block can be generated by a weighted sum of a first prediction block generated by intra-template matching prediction and a second prediction block generated from the neighboring reference pixels of the current block based on the intra-prediction mode. Herein, the method for deriving the intra-prediction mode used to generate the second prediction block can be any one of 1) a method for deriving the intra-prediction mode based on the intra-prediction mode information signaled through the bitstream, 2) the decoder side intra mode derivation (DIMD) method, and 3) the template based intra mode derivation (TIMD) method. Herein, the method for deriving the intra-prediction mode based on the intra-prediction mode information signaled through the bitstream can be referred to as the general intra method.
[0119] Equation 1 is an equation showing a method for generating a prediction block by combining the intra-template matching method according to an embodiment of the present invention and the intra-prediction method based on the intra-prediction mode information signaled through the bitstream.
[0120] [Equation 1]
[0121] predw intraTMP ×pred intraTMP +W INTRA ×predINTRA
[0122] In Formula 1, pred intraTMP may represent a first prediction block generated by an intra-template matching method, and pred INTRA may represent a second prediction block generated by an intra prediction mode derived from a general intra method, and W intraTMP may represent the weight of the first prediction block, and W INTRA may represent the weight of the second prediction block, and pred may represent the final prediction block. It may be that W intraTMP + W INTRA = 1, W intraTMP ≥ 0 and W INTRA ≥ 0.
[0123] Here, in the general intra method, the intra prediction mode information signaled by a bitstream may include at least one of information (mpm_idx) indicating a candidate mode in a most probable mode (MPM) list, information (mpm_flag) indicating whether to use the MPM list, and remaining information (mpm_remainder).
[0124] Formula 2 is a formula showing a method of generating a prediction block by combining an intra-template matching method and a DIMD method according to an embodiment of the present invention.
[0125] [Formula 2]
[0126] pred = W intraTMP × pred intraTMP + w DIMD × ped DIMD
[0127] In Formula 2, pred intraTMP may represent a first prediction block generated by an intra-template matching method, and pred DIMD may represent a second prediction block generated by an intra prediction mode derived from a DIMD method, and W intraTMP may represent the weight of the first prediction block, and W DIMD may represent the weight of the second prediction block, and pred may represent the final prediction block. It may be that W intraTMP + W DIMD = 1, W intraTMP ≥ 0 and W DIMD ≥ 0.
[0128] Specifically, the DIMD method according to the present invention can calculate the gradient of the reconstructed reference pixels around the current block by applying at least one boundary detection filter among Sobel filter, Reberts cross filter, Prewitt filter, Sharr filter, and Laplacian filter to the reference pixels, and can generate a histogram of gradient (HoG) based on the gradient of the reference pixels. When the gradient with the maximum value is selected from the gradient histogram and then mapped to the intra prediction mode, the intra prediction mode can be derived.
[0129] On the other hand, when deriving the intra prediction mode for the current block using the DIMD method, the region of adjacent pixels to which a boundary detection filter such as the Sobel filter is applied can be set to be the same as the region of the template (current template) 420 that matches the intra template used for Figure 4 , or they can be set to be different from each other.
[0130] Alternatively, the size and shape of the region to which the boundary detection filter is applied can be arbitrarily determined in the DIMD method.
[0131] Equation 3 is an equation showing a method of generating a prediction block by combining the intra template matching method and the TIMD method according to an embodiment of the present invention.
[0132] [Equation 3]
[0133] predw intraTMP ×pred intraTMP +w TIMD ×pred TIMD
[0134] In Equation 3, pred intraTMP can represent the first prediction block generated by the intra template matching method, pred TIMD can represent the second prediction block generated by the intra prediction mode derived based on the TIMD method, W intraTMP can represent the weight of the first prediction block, W TIMD can represent the weight of the second prediction block, and pred can represent the final prediction block. It can be that W intraTMP +W TIMD =1, W intraTMP ≥0 and W TIMD ≥0.
[0135] Specifically, the TIMD method according to the present invention generates each prediction template by applying the directionality of each candidate mode in the most probable mode (MPM) list to the reference pixels of the current template, and calculates the sum of absolute transformed differences (SATD) between the pixels of the generated prediction template and the pixels of the reconstructed template. Among all candidate modes in the MPM list, the mode with the minimum SATD can be determined as the intra prediction mode.
[0136] On the other hand, the template for deriving the intra prediction mode of the current block by the TIMD method can be set to be the same as the region of the template (current template) 420 that matches the intra template used for Figure 4 , or they can be set to be different from each other. Alternatively, the size and shape of the template used in the TIMD method can be arbitrarily determined.
[0137] On the other hand, the above TIMD method uses the sum of absolute transformed differences (SATD) to derive the intra prediction mode based on the template using the candidate modes in the MPM list. However, according to another embodiment of the present invention, any method can be selected and used among various error measurement methods including the sum of absolute difference (SAD) or the sum of square error (SSE).
[0138] The intra prediction method using intra template matching according to the present invention can explicitly determine or implicitly determine the first weight and the second weight.
[0139] The method for explicitly determining the weight according to the embodiment of the present invention can determine the weight based on the information signaled through the bitstream. Here, the signaled information can be an index.
[0140] Table 1 is a table showing three predefined sets of weights and their index information.
[0141] [Table 1]
[0142] Index Codeword First weight Second weight 0 0 2 / 4 2 / 4 1 10 3 / 4 1 / 4 2 11 1 / 4 3 / 4
[0143] In Table 1, the first weight can be the weight applied to the first prediction block generated by the intra template matching method, and the second weight can be the weight applied to the second prediction block generated by the derived intra prediction mode. Here, the second weight can be W of Formula 1 INTRA and W of Formula 2 DIMDand W of Equation 3 TIMD any one of
[0144] On the other hand, the number N (N is an integer, N≥1) of weight sets, the corresponding codewords, and the weights of each set can be arbitrarily determined. However, the sum of the first weight and the second weight used in each set is 1 (W intraTMP +W INTRA =1, W intraTMP +W DIMD =1, or W intraTMP +W TIMD =1).
[0145] On the other hand, the codewords for indexing can be determined by using any one of the codeword assignment methods of fixed length code (FLC), unary code, truncated unary code, and truncated binary code.
[0146] The method for implicitly determining weights according to an embodiment of the present invention can determine weights based on the prediction mode of adjacent blocks adjacent to the current block. Here, the prediction mode can be an intra-template prediction mode, a general intra mode, a DIMD mode, or a TIMD mode.
[0147] Figure 5 is a schematic diagram showing adjacent blocks A1 to A8, L1 to L8, and AL used in the method for implicitly determining weights according to an embodiment of the present invention. Here, the size of the adjacent block can be the smallest block capable of storing intra prediction mode information.
[0148] In the method for implicitly determining weights according to an embodiment of the present invention, the adjacent blocks used can be the upper adjacent block and the left adjacent block of the current block. Here, the upper adjacent block can be Figure 5 any one of AL and A1 to A8 of Figure 5 and the left adjacent block can be Figure 5 any one of AL and L1 to L8 of Figure 5 As an example, the upper adjacent block can be
[0149] Table 2 is a table showing a method for determining weights based on whether the upper adjacent block and the left adjacent block have an intra-template prediction mode as the prediction mode.
[0150] [Table 2]
[0151]
[0152] In Table 2, the first weight may be a weight applied to a first prediction block generated by an intra-template matching method, and the second weight may represent a weight applied to a second prediction block generated by a derived intra prediction mode. Here, the second weight may be any one of W of Equation 1 INTRA , W of Equation 2 DIMD and W of Equation 3 TIMD .
[0153] On the other hand, in Table 2, the weight values of the set of the first weight and the second weight may be arbitrarily set. However, the sum of the first weight and the second weight used in each set is 1 (W intraTMP +W INTRA =1, W intraTMP +W DIMD =1, or W intraTMP +W TIMD =1), and the first weight and the second weight may be greater than or equal to 0.
[0154] On the other hand, as shown in Table 2, if both the upper adjacent block and the left adjacent block of the current block are in the intra-template matching prediction mode, the first weight may be assigned a larger value. On the other hand, if neither the upper adjacent block nor the left adjacent block is in the intra-template matching prediction mode, the first weight may be assigned a smaller value.
[0155] Table 3 is a table showing a method of determining weights based on whether the upper adjacent block and the left adjacent block have an intra prediction mode derivation mode of a second prediction block as a prediction mode. Here, the intra prediction mode derivation mode may be a general intra mode, a DIMD mode, or a TIMD mode.
[0156] [Table 3]
[0157]
[0158] In Table 3, the first weight may be a weight applied to a first prediction block generated by an intra-template matching method, and the second weight may represent a weight applied to a second prediction block generated by a derived intra prediction mode. Here, the second weight may be any one of W of Equation 1 INTRA , W of Equation 2 DIMD and W of Equation 3 TIMD .
[0159] On the other hand, in Table 3, the weight values of the set of the first weight and the second weight may be arbitrarily set. However, the sum of the first weight and the second weight used in each set is 1 (W intraTMP +W INTRA =1, W intraTMP +W DIMD =1, or W intraTMP +WTIMD = 1), and the first weight and the second weight can be greater than or equal to 0.
[0160] On the other hand, as shown in Table 3, if both the upper adjacent block and the left adjacent block of the current block are in the intra prediction mode derivation mode, a larger value can be assigned to the second weight. On the other hand, if neither the upper adjacent block nor the left adjacent block is in the intra prediction mode derivation mode, a smaller value can be assigned to the second weight.
[0161] In an intra prediction method using intra template matching according to another embodiment of the present invention, the first weight and the second weight can be determined based on the count of the prediction modes of adjacent blocks.
[0162] As an example, if it is assumed that a prediction block is generated by combining an intra template matching method and a general intra method, the first weight W intraTMP and the second weight W INTRA .
[0163] - Initialize N intraTMP to 0 and initialize N INTRA to 0.
[0164] - If the upper adjacent block is in the intra template matching prediction mode, increment N intraTMP by 1.
[0165] - If the upper adjacent block is in the general intra mode, increment N INTRA by 1.
[0166] - If the left adjacent block is in the intra template matching prediction mode, increment N intraTMP by 1.
[0167] - If the left adjacent block is in the general intra mode, increment N INTRA by 1.
[0168] - If N intraTMP = 0 and N INTRA = 0, determine that W intraTMP = 0.5 and W INRA = 0.5.
[0169] - Otherwise, determine W intraTMP and W INTRA .
[0170] [Formula 4]
[0171]
[0172] As another example, if it is assumed that a prediction block is generated by combining an intra-frame template matching method and a DIMD method, the first weight W can be determined according to the following process intraTMP and the second weight W DIMD .
[0173] - Initialize N intraTMP to 0 and initialize N DIMD to 0.
[0174] - If the upper adjacent block is in the intra-frame template matching prediction mode, increment N intraTMP by 1.
[0175] - If the upper adjacent block is in the DIMD mode, increment N DIMD by 1.
[0176] - If the left adjacent block is in the intra-frame template matching prediction mode, increment N intraTMP by 1.
[0177] - If the left adjacent block is in the DIMD mode, increment N DIMD by 1.
[0178] - If N intraTMP = 0 and N DIMD = 0, determine that W intraTMP = 0.5 and W DIMD = 0.5.
[0179] - Otherwise, determine W intraTMP and W DIMD .
[0180] [Formula 5]
[0181]
[0182] As another example, if it is assumed that a prediction block is generated by combining an intra-frame template matching method and a TIMD method, the first weight W can be determined according to the following process intraTMP and the second weight W TIMD .
[0183] - Initialize N intraTMP to 0 and initialize N TIMD to 0.
[0184] - If the upper adjacent block is in the intra-frame template matching prediction mode, increment N intraTMP by 1.
[0185] - If the upper adjacent block is in the TIMD mode, increment N TIMD by 1.
[0186] - If the left adjacent block is in the intra-template matching prediction mode, increment N intraTMP by 1.
[0187] - If the left adjacent block is in the TIMD mode, increment N TIMD by 1.
[0188] - If N intraTMP = 0 and N TIMD = 0, then determine that W intraTMP = 0.5 and W TIMD = 0.5.
[0189] - Otherwise, determine W intraTMP and W TIMD as shown in Equation 6.
[0190] [Equation 6]
[0191]
[0192] On the other hand, in the method for implicitly determining weights according to an embodiment of the present invention, the upper adjacent block and the left adjacent block of the current block may be blocks in predefined positions. As an example, the upper adjacent block and the left adjacent block may be Figure 5 the A4 block and the L4 block.
[0193] Furthermore, in the method for implicitly determining weights according to an embodiment of the present invention, the upper adjacent block and the left adjacent block of the current block may each include at least one block. As an example, the upper adjacent block may include Figure 5 at least one of the A1 to A4 blocks, and the left adjacent block may include Figure 5 at least one of the L1 to L4 blocks.
[0194] Figure 6 is a flowchart showing a method for decoding an image according to an embodiment of the present invention. Figure 6 The method for decoding an image can be executed by a device for decoding an image.
[0195] The device for decoding an image can derive the intra prediction mode of the current block (S610).
[0196] Specifically, the intra prediction mode can be derived by a general intra method, a DIMD method, or a TIMD method.
[0197] In this document, the general intra method is an intra prediction mode derivation method performed by using intra prediction mode derivation information signaled through a bitstream, the DIMD method is an intra prediction mode derivation method performed by utilizing the gradient histogram of pixels, and the TIMD method is an intra prediction mode derivation method performed by selecting any one of candidate modes in the intra prediction candidate list of a current block based on a template of the current block.
[0198] In addition, a device for decoding an image may derive a first prediction block of a current block based on the derived intra prediction mode (S620).
[0199] In addition, a device for decoding an image may derive a second prediction block of the current block based on intra template matching (S630).
[0200] In addition, a device for decoding an image may derive a final prediction block of the current block by applying a first weight and a second weight to the first prediction block and the second prediction block, respectively (S640).
[0201] According to an embodiment of the present invention, the first weight and the second weight may be determined by index information obtained from a bitstream. Here, the index information may be information indicating a predefined set of weights. The predefined set of weights is described in detail in Table 1 above.
[0202] According to an embodiment of the present invention, the first weight and the second weight may be determined based on an upper adjacent block and a left adjacent block of the current block.
[0203] Specifically, the first weight and the second weight may be determined based on whether the upper adjacent block and the left adjacent block of the current block are each in an intra template matching prediction mode.
[0204] In addition, the first weight and the second weight may be determined based on whether the upper adjacent block and the left adjacent block of the current block are each in a general intra mode.
[0205] In addition, the first weight and the second weight may be determined based on whether the upper adjacent block and the left adjacent block of the current block are each in a DIMD mode.
[0206] In addition, the first weight and the second weight may be determined based on whether the upper adjacent block and the left adjacent block of the current block are each in a TIMD mode.
[0207] In addition, the first weight and the second weight may be determined based on the count of prediction modes of the upper adjacent block and the left adjacent block of the current block.
[0208] On the other hand, it may be similarly performed in a method for encoding an image Figure 6The steps described in. In addition, a bitstream can be generated by a method for encoding an image, the method including Figure 6 The steps described. The bitstream can be stored in a non-volatile computer-readable recording medium and can also be sent (or streamed).
[0209] On the other hand, in the process of deriving the intra prediction mode of the current block, the intra prediction modes of adjacent blocks can be used. In the case of encoding / decoding an adjacent block in an intra-template matching prediction mode (that is, performing intra prediction on the adjacent block by intra-template matching), intra prediction can be performed without intra prediction mode derivation. Accordingly, in the process of deriving the intra prediction mode of the current block, if an adjacent block is in the intra-template prediction mode, an intra prediction mode for the adjacent block needs to be separately allocated.
[0210] Hereinafter, reference will be made to Figures 7 to 9 Describe an intra prediction mode allocation method for a block encoded / decoded by intra-template matching according to an embodiment of the present invention.
[0211] Refer to Figure 7 , if an adjacent block is in the intra-template matching prediction mode (S710 is yes), a predetermined intra prediction mode can be allocated to the adjacent block (S720).
[0212] As an example, the predetermined intra prediction mode can be one of the intra prediction modes of the planar mode, the DC mode, the vertical mode, or the horizontal mode.
[0213] Refer to Figure 8 , if an adjacent block is in the intra-template matching prediction mode (S810 is yes), the intra prediction mode derived by applying the DIMD method to the surrounding adjacent reference pixels of the current block can be allocated as the intra prediction mode of the adjacent block (S820).
[0214] Refer to Figure 9 , if an adjacent block is in the intra-template matching prediction mode (S910 is yes), the intra prediction mode derived by applying the TIMD method to the surrounding adjacent reference pixels of the current block can be allocated as the intra prediction mode of the adjacent block (S920).
[0215] On the other hand, if an adjacent block is in the intra-template matching prediction mode, the intra prediction mode derived by applying the DIMD method to the matching block searched by the intra-template matching of the adjacent block can be allocated as the intra prediction mode of the adjacent block.
[0216] Figure 10 Exemplarily shows a content streaming system to which an embodiment of the present invention can be applied.
[0217] As shown Figure 10 in the figure, the content streaming system applying the embodiments of the present invention 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 a multimedia input device such as a smartphone, a camera, a CCTV, etc. into digital data to generate a bitstream and sends it to the streaming server. As another example, if a multimedia input device such as a smartphone, a camera, a CCTV, etc. directly generates a bitstream, the encoding server may be omitted.
[0219] A bitstream may be generated by applying the image encoding method and / or image encoding device of the embodiments of the present invention, and the streaming server may temporarily store the bitstream during the process of sending or receiving the bitstream.
[0220] The streaming server sends multimedia data to the user device based on a user request via the network server, and the network server may act as an intermediary for notifying the user of any available services. When the user requests a desired service from the network server, the network server sends it to the streaming server, and the streaming server may send multimedia data to the user. At this time, the content streaming system may include a separate control server, and in this case, the control server may control commands / responses between devices within the content streaming system.
[0221] The streaming server may receive content from the media storage device and / or the encoding server. For example, when receiving content from the encoding server, the content may be received in real time. In this case, in order to provide a smooth streaming service, the streaming server may store the bitstream for a period of time.
[0222] Examples of the user device may include a mobile phone, a smartphone, a laptop computer, a digital broadcast terminal, a personal digital assistant (PDA), a portable multimedia player (PMP), a navigation device, a tablet PC, a tablet PC, an ultrabook, a wearable device (e.g., a smart watch, smart glasses, an HMD), a digital TV, a desktop computer, a digital signage, etc.
[0223] Each server in the above content streaming system may operate as a distributed server, and in this case, the data received from each server may be distributed and processed.
[0224] The above-described embodiments can be executed in the same or corresponding manner in an encoding device and a decoding device. Additionally, at least one or a combination of at least one of the above-described embodiments can be used to encode / decode an image.
[0225] The order of applying the above-described embodiments can be different in the encoding device and the decoding device. Alternatively, the order of applying the above-described embodiments can be the same in the encoding device and the decoding device.
[0226] The above-described embodiments can be executed for each of a luminance signal and a chrominance signal. Alternatively, the above-described embodiments for the luminance signal and the chrominance signal can be executed in the same manner.
[0227] In the above-described embodiments, a method is described based on a flowchart having a series of steps or units, but the present invention is not limited to the order of the steps. Instead, some steps can be executed simultaneously with other steps or in a different order. Additionally, those of ordinary skill in the art should understand that the steps in the flowchart are not mutually exclusive, and other steps can be added to the flowchart or some steps can be deleted from the flowchart without affecting the scope of the present invention.
[0228] The embodiments can be implemented in the form of program instructions that can be executed by various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium can include independent program instructions, data files, data structures, etc., or combinations thereof. The program instructions recorded in the computer-readable recording medium can be specifically designed and constructed for the present invention or are well-known to those of ordinary skill in the computer software art.
[0229] The bitstream generated by the encoding method according to the above-described embodiments can be stored in a non-volatile computer-readable recording medium. Additionally, the bitstream stored in the non-volatile computer-readable recording medium can be decoded by the decoding method according to the above-described embodiments.
[0230] Examples of the computer-readable recording medium 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 memories (ROMs), random access memories (RAMs), flash memories, etc., which are specifically configured to store and execute program instructions. Examples of program instructions include not only machine language codes formatted by compilers but also high-level language codes that can be implemented by a computer using interpreters. The hardware devices can be configured to be operated by one or more software modules or vice versa to perform the processes according to the present invention.
[0231] Although the present invention has been described in terms of specific items such as detailed components and limited embodiments and drawings, they are provided only to assist in a more comprehensive understanding of the present invention, and the present invention is not limited to the above embodiments. Those skilled in the art to which the present invention pertains will understand 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 embodiments, and the entire scope of the appended claims and their equivalents will fall within the scope and spirit of the present invention.
[0233] Industrial Applicability
[0234] The present invention can be used in apparatuses for encoding / decoding images and recording media for storing bitstreams.
Claims
1. A method for decoding an image, the method comprising: Deriving an intra prediction mode of a current block; Deriving a first prediction block of the current block based on the intra prediction mode; Deriving a second prediction block of the current block based on intra-template matching; And Deriving a final prediction block of the current block by applying a first weight and a second weight to the first prediction block and the second prediction block, respectively.
2. The method according to claim 1, wherein, Deriving the intra prediction mode by a decoder-side intra mode derivation (DIMD) method.
3. The method according to claim 2, wherein Performing the DIMD method by utilizing a gradient histogram of pixels.
4. The method according to claim 1, wherein, Deriving the intra prediction mode by a template-based intra mode derivation (TIMD) method.
5. The method according to claim 4, wherein Performing the TIMD method by selecting any one of candidate modes in an intra prediction candidate list of the current block based on a template of the current block.
6. The method according to claim 1, wherein Determining the first weight and the second weight based on index information obtained from a bitstream.
7. The method according to claim 1, wherein Determining the first weight and the second weight based on an upper adjacent block and a left adjacent block of the current block.
8. The method according to claim 7, wherein, Determining the first weight and the second weight based on whether each of the upper adjacent block and the left adjacent block of the current block is in an intra-template matching prediction mode.
9. The method according to claim 7, wherein, Determining the first weight and the second weight based on whether each of the upper adjacent block and the left adjacent block of the current block is in the DIMD mode.
10. The method according to claim 7, wherein, Determining the first weight and the second weight based on whether each of the upper adjacent block and the left adjacent block of the current block is in the TIMD mode.
11. The method according to claim 7, wherein, Determining the first weight and the second weight based on a count of prediction modes of an upper adjacent block and a left adjacent block of the current block.
12. A method for encoding an image, the method comprising: Deriving an intra prediction mode of a current block; Deriving a first prediction block of the current block based on the intra prediction mode; Deriving a second prediction block of the current block based on intra-template matching; And Deriving a final prediction block of the current block by applying a first weight and a second weight to the first prediction block and the second prediction block, respectively.
13. A non-volatile computer-readable recording medium for storing a bitstream generated by a method for encoding an image, Among them, The method for encoding an image comprising: Deriving an intra prediction mode of a current block; Deriving a first prediction block of the current block based on the intra prediction mode; Deriving a second prediction block of the current block based on intra-template matching; and Deriving a final prediction block of the current block by applying a first weight and a second weight to the first prediction block and the second prediction block, respectively.
14. A method for transmitting a bitstream generated by a method for encoding an image, the method comprising transmitting the bitstream, Among them, The method for encoding an image comprising: Deriving an intra prediction mode of a current block; Deriving a first prediction block of the current block based on the intra prediction mode; Deriving a second prediction block of the current block based on intra-template matching; and Deriving a final prediction block of the current block by applying a first weight and a second weight to the first prediction block and the second prediction block, respectively.