Image encoding / decoding method based on motion information refinement, method for transmitting bit stream, and recording medium for storing bit stream

By adopting a motion information refinement method in image encoding/decoding, and using template matching and bilateral matching tools for refinement, the problem of low image encoding/decoding efficiency in the prior art is solved, and more efficient image processing and lower storage costs are achieved.

CN119698835APending Publication Date: 2025-03-25LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380053013.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-07-13
Filing Date
2023-07-13
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prior art is difficult to effectively improve image encoding/decoding efficiency, especially when processing high-resolution and high-quality images, the transmission and storage costs are high.

Method used

The image encoding/decoding method based on motion information refinement is adopted, and the motion information refinement is used to use independent control tools based on template matching and bilateral matching to generate more accurate prediction blocks, thereby improving the encoding/decoding efficiency.

Benefits of technology

By refining the motion information, the efficiency of image encoding/decoding is significantly improved, transmission and storage costs are reduced, and image quality is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119698835A_ABST
    Figure CN119698835A_ABST
Patent Text Reader

Abstract

An image encoding / decoding method and apparatus are provided. An image decoding method according to the present disclosure may comprise the steps of deriving motion information of a current block, refining the motion information based on an enabled predetermined refining tool, including a template matching-based tool and a bilateral matching-based tool, and generating a prediction block of the current block based on the refined motion information, and determining whether to enable a bilateral matching tool irrespective of whether to enable a template-based matching tool.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to an image encoding / decoding method and device and a recording medium for storing a bit stream, and more particularly, to an image encoding / decoding method and device based on motion information refinement and a recording medium for storing a bit stream generated by the image encoding method / device of the present disclosure. Background Art

[0002] Recently, the demand for high-resolution and high-quality images, such as high-definition (HD) images and ultra-high-definition (UHD) images, is increasing in various fields. As the resolution and quality of image data are improved, the amount of information or bit volume transmitted is relatively increased compared to existing image data. The increase in the amount of information or bit volume transmitted leads to an increase in transmission cost and storage cost.

[0003] Therefore, efficient image compression technology is needed to effectively transmit, store, and reproduce information about high-resolution and high-quality images. Summary of the invention

[0004] Technical issues

[0005] An object of the present disclosure is to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.

[0006] In addition, an object of the present invention is to provide an image encoding / decoding method and device based on motion information refinement.

[0007] Furthermore, an object of the present disclosure is to provide an image encoding / decoding method and apparatus which performs motion information refinement based on an independently controlled template matching-based tool or a bilateral matching-based tool.

[0008] Furthermore, an object of the present disclosure is to provide a non-transitory recording medium storing a bit stream received, decoded, and used by the image decoding method or apparatus according to the present disclosure to reconstruct an image.

[0009] Furthermore, an object of the present disclosure is to provide a non-transitory computer-readable medium which records a bit stream received and decoded by an apparatus for decoding an image.

[0010] In addition, an object of the present disclosure is to provide a method of transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0011] The technical problems solved by the present disclosure are not limited to the above-mentioned technical problems, and other technical problems not described herein will be apparent to those skilled in the art through the following description.

[0012] Technical Solution

[0013] An image decoding method according to one aspect of the present disclosure is an image decoding method performed by an image decoding device. The image decoding method may include: deriving motion information of a current block; refining the motion information based on an enabled predetermined refinement tool; and generating a prediction block of the current block based on the refined motion information. The refinement tool may include a template matching-based tool and a bilateral matching-based tool, and whether to enable the bilateral matching-based tool may be determined independently of whether the template matching-based tool is enabled.

[0014] According to another aspect of the present disclosure, an image decoding device may include a memory and at least one processor. The at least one processor may derive motion information of a current block, refine the motion information based on an enabled predetermined refinement tool, and generate a prediction block of the current block based on the refined motion information. The refinement tool may include a template matching-based tool and a bilateral matching-based tool, and whether to enable the bilateral matching-based tool may be determined independently of whether the template matching-based tool is enabled.

[0015] According to another aspect of the present disclosure, an image encoding method may include deriving motion information of a current block and generating a prediction block of the current block based on the motion information. Information about decoder-side refinement of the motion information may be encoded in a bitstream, and the information about the decoder-side refinement may include flag information indicating whether a predetermined refinement tool is enabled, the refinement tool may include a template matching-based tool and a bilateral matching-based tool, and whether to enable the bilateral matching-based tool may be determined independently of whether the template matching-based tool is enabled.

[0016] A computer-readable storage medium according to another aspect of the present disclosure may store a bit stream generated by the image encoding method or the image encoding device of the present disclosure.

[0017] A transmission method according to another aspect of the present disclosure may transmit a bit stream generated by the image encoding method or the image encoding device of the present disclosure.

[0018] The features briefly summarized above with respect to the present disclosure are merely exemplary aspects of the following detailed description of the present disclosure and do not limit the scope of the present disclosure.

[0019] Beneficial Effects

[0020] According to the present disclosure, an image encoding / decoding method and apparatus with improved encoding / decoding efficiency can be provided.

[0021] Furthermore, according to the present disclosure, an image encoding / decoding method and apparatus based on motion information refinement can be provided.

[0022] Furthermore, according to the present disclosure, an image encoding / decoding method and apparatus may be provided, which perform motion information refinement based on an independently controlled template matching-based tool or a bilateral matching-based tool.

[0023] According to the present disclosure, a non-transitory computer-readable recording medium storing a bit stream generated by an image encoding method or apparatus may be provided.

[0024] According to the present disclosure, there may be provided a non-transitory computer-readable recording medium storing a bit stream received and decoded by the image decoding apparatus according to the present disclosure and used to reconstruct an image.

[0025] According to the present disclosure, a method of transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure may be provided.

[0026] Those skilled in the art will understand that the effects that can be achieved through the present disclosure are not limited to what has been specifically described above, and other advantages of the present disclosure will be more clearly understood from the detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 FIG. 4 is a diagram schematically showing a video encoding system to which an embodiment of the present disclosure is applicable.

[0028] Figure 2 is a view schematically showing an image encoding device to which an embodiment of the present disclosure is applicable.

[0029] Figure 3 is a view schematically showing an image decoding device to which an embodiment of the present disclosure is applicable.

[0030] Figure 4 is a diagram schematically showing an inter-frame prediction unit of an image encoding device.

[0031] Figure 5 is a flowchart illustrating a method of encoding an image based on inter-frame prediction.

[0032] Figure 6 is a diagram schematically showing an inter-frame prediction unit of an image decoding device.

[0033] Figure 7 is a flowchart illustrating a method of decoding an image based on inter-frame prediction.

[0034] Figure 8 is a flowchart illustrating an inter-frame prediction method.

[0035] Fig. 9 is a diagram for explaining the DMVR process.

[0036] Fig.10 is a diagram for explaining an encoding / decoding method based on template matching.

[0037] Fig.11 is a diagram showing a search area that can be applied in multi-pass DMVR.

[0038] Fig.12 is a flowchart illustrating a motion information refinement process according to an embodiment of the present disclosure.

[0039] Fig.13 is a flowchart illustrating an image encoding method according to an embodiment of the present disclosure.

[0040] Fig.14 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure.

[0041] Fig.15 is a diagram showing a content streaming system to which an embodiment of the present disclosure is applied. DETAILED DESCRIPTION

[0042] Hereinafter, the embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to facilitate implementation by those skilled in the art. However, the present disclosure may be implemented in various forms and is not limited to the embodiments described herein.

[0043] When describing the present disclosure, if it is determined that the detailed description of related known functions or configurations makes the scope of the present disclosure unnecessarily ambiguous, the detailed description thereof will be omitted. In the drawings, parts irrelevant to the description of the present disclosure are omitted, and like reference numerals are given to like parts.

[0044] In the present disclosure, when a component is "connected", "coupled" or "linked" to another component, it may include not only a direct connection relationship but also an indirect connection relationship with intermediate components. In addition, when a component "includes" or "has" other components, unless otherwise specified, it means that other components may also be included, rather than excluding other components.

[0045] In the present disclosure, the terms first, second, etc. may be used only for the purpose of distinguishing one component from other components, and do not limit the order or importance of the components unless otherwise specified. Accordingly, within the scope of the present disclosure, a first component in one embodiment may be referred to as a second component in another embodiment, and similarly, a second component in one embodiment may be referred to as a first component in another embodiment.

[0046] In the present disclosure, components that are distinguished from each other are intended to clearly describe each feature and do not mean that the components must be separated. That is, multiple components can be integrated and implemented in one hardware or software unit, or one component can be distributed and implemented in multiple hardware or software units. Therefore, even if not otherwise specified, these embodiments in which the components are integrated or the components are distributed are also included in the scope of the present disclosure.

[0047] In the present disclosure, the components described in each embodiment are not necessarily indispensable components, and some components may be optional components. Therefore, the embodiments consisting of a subset of the components described in the embodiments are also included in the scope of the present disclosure. In addition, the embodiments including other components in addition to the components described in the various embodiments are included in the scope of the present disclosure.

[0048] The present disclosure relates to encoding and decoding of images. Unless otherwise defined in the present disclosure, terms used in the present disclosure may have general meanings commonly used in the technical field to which the present disclosure belongs.

[0049] In the present disclosure, a "picture" generally refers to a unit representing an image within a specific time period, and a slice / tile is a coding unit constituting a part of a picture, and a picture may be composed of one or more slices / tiles. In addition, a slice / tile may include one or more coding tree units (CTUs).

[0050] In the present disclosure, "pixel" or "pel" may refer to the smallest unit constituting a picture (or image). In addition, "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, or may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component.

[0051] In the present disclosure, a "unit" may refer to a basic unit of image processing. The unit may include at least one of a specific area of ​​a picture and information related to the area. A unit may include a luminance block and two chrominance (e.g., Cb, Cr) blocks. In some cases, the unit may be used interchangeably with terms such as "sample array", "block" or "area". In general, an M×N block may include M columns and N rows of samples (or sample arrays) or a set (or array) of transform coefficients.

[0052] In the present disclosure, "current block" may mean one of "current coding block", "current coding unit", "coding target block", "decoding target block" or "processing target block". When prediction is performed, "current block" may mean "current prediction block" or "prediction target block". When transform (inverse transform) / quantization (dequantization) is performed, "current block" may mean "current transform block" or "transform target block". When filtering is performed, "current block" may mean "filtering target block".

[0053] In addition, in the present disclosure, unless explicitly stated as a chroma block, "current block" may mean a block including both a luma component block and a chroma component block or a "luminance block of the current block". The luma component block of the current block may be expressed by an explicit description including a luma component block such as "luminance block" or "current luma block". In addition, "chroma component block of the current block" may be expressed by an explicit description including a chroma component block such as "chroma block" or "current chroma block".

[0054] In the present disclosure, the slash " / " or "," should be interpreted as indicating "and / or". For example, the expressions "A / B" and "A, B" may mean "A and / or B". In addition, "A / B / C" and "A, B, C" may mean "at least one of A, B and / or C".

[0055] In the present disclosure, the term "or" should be interpreted as indicating "and / or". For example, the expression "A or B" may include 1) only "A", 2) only "B", and / or 3) both "A and B". In other words, in the present disclosure, the term "or" should be interpreted as indicating "additionally or alternatively".

[0056] Overview of Video Coding Systems

[0057] Figure 1 FIG. 4 is a diagram schematically showing a video encoding system to which an embodiment of the present disclosure is applicable.

[0058] The video encoding system according to the embodiment may include an encoding device 10 and a decoding device 20. The encoding device 10 may deliver the encoded video and / or image information or data to the decoding device 20 via a digital storage medium or a network in the form of a file or a stream.

[0059] The encoding device 10 according to the embodiment may include a video source generator 11, an encoding unit (encoder) 12, and a transmitter 13. The decoding device 20 according to the embodiment may include a receiver 21, a decoding unit (decoder) 22, and a renderer 23. The encoding unit 12 may be referred to as a video / image encoding device, and the decoding unit 22 may be referred to as a video / image decoding device. The transmitter 13 may be included in the encoding unit 12. The receiver 21 may be included in the decoding unit 22. The renderer 23 may include a display and the display may be configured as a separate device or an external component.

[0060] The video source generator 11 can obtain the video / image by the process of capturing, synthesizing or generating the video / image. The video source generator 11 may include a video / image capturing device and / or a video / image generating device. The video / image capturing device may include, for example, one or more cameras, a video / image archive including previously captured videos / images, etc. The video / image generating device may include, for example, a computer, a tablet computer, and a smart phone, and may generate the video / image (electronically). For example, a virtual video / image may be generated by a computer, etc. In this case, the video / image capturing process may be replaced by a process of generating relevant data.

[0061] The encoding unit 12 may encode the input video / image. For compression and encoding efficiency, the encoding unit 12 may perform a series of processes such as prediction, transformation, and quantization. The encoding unit 12 may output the encoded data (encoded video / image information) in the form of a bitstream.

[0062] The transmitter 13 can obtain the encoded video / image information or data output in the form of a bit stream and forward it to the receiver 21 of the decoding device 20 or another external object in the form of a file or stream through a digital storage medium or a network. The digital storage medium may include various storage media, such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter 13 may include an element for generating a media file in a predetermined file format and may include an element for transmitting through a broadcast / communication network. The transmitter 13 may be set as a transmitting device separated from the encoding device 12, and in this case, the transmitting device may include at least one processor and a transmitting unit, the at least one processor obtaining the encoded video / image information or data output in the form of a bit stream, and the transmitting unit is used to transmit the encoded video / image information or data in the form of a file or stream. The receiver 21 may extract / receive a bit stream from a storage medium or a network and send the bit stream to the decoding unit 22.

[0063] The decoding unit 22 may decode a video / image by performing a series of processes corresponding to the operations of the encoding unit 12, such as dequantization, inverse transformation, and prediction.

[0064] The renderer 23 may render the decoded video / image. The rendered video / image may be displayed through a display.

[0065] Overview of Image Coding Equipment

[0066] Figure 2 is a view schematically showing an image encoding device to which an embodiment of the present disclosure is applicable.

[0067] like Figure 2 As shown, the image encoding device 100 may include an image segmenter 110, a subtractor 115, a transformer 120, a quantizer 130, a dequantizer 140, an inverse transformer 150, an adder 155, a filter 160, a memory 170, an inter-frame prediction unit 180, an intra-frame prediction unit 185, and an entropy encoder 190. The inter-frame prediction unit 180 and the intra-frame prediction unit 185 may be collectively referred to as a "prediction unit". The transformer 120, the quantizer 130, the dequantizer 140, and the inverse transformer 150 may be included in a residual processor. The residual processor may also include a subtractor 115.

[0068] In some embodiments, all or at least some of the components configuring the image encoding apparatus 100 may be configured by one hardware component (eg, an encoder or a processor). In addition, the memory 170 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium.

[0069] The image segmenter 110 may segment the input image (or picture or frame) input to the image encoding device 100 into one or more processing units. For example, the processing unit may be referred to as a coding unit (CU). The coding unit may be obtained by recursively segmenting a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree binary tree ternary tree (QT / BT / TT) structure. For example, a coding unit may be segmented into a plurality of coding units of a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary tree structure. For the segmentation of the coding unit, the quadtree structure may be applied first, and the binary tree structure and / or the ternary tree structure may be applied later. The encoding process according to the present disclosure may be performed based on the final coding unit that is no longer segmented. The maximum coding unit may be used as the final coding unit, and the coding unit of a deeper depth obtained by segmenting the maximum coding unit may also be used as the final coding unit. Here, the encoding process may include the prediction, transformation, and reconstruction processes described later. As another example, the processing unit of the encoding process may be a prediction unit (PU) or a transformation unit (TU). The prediction unit and the transform unit may be divided or partitioned from the final coding unit. The prediction unit may be a sample prediction unit, and the transform unit may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from the transform coefficient.

[0070] The prediction unit (inter prediction unit 180 or intra prediction unit 185) may perform prediction on the block to be processed (current block) and generate a prediction block including prediction samples of the current block. The prediction unit may determine whether to apply intra prediction or inter prediction based on the current block or CU. The prediction unit may generate various information related to the prediction of the current block and send the generated information to the entropy encoder 190. The information about the prediction may be encoded in the entropy encoder 190 and output in the form of a bitstream.

[0071] The intra prediction unit (intra prediction sub) 185 can predict the current block by referring to the samples in the current picture. Depending on the intra prediction mode and / or intra prediction technology, the reference samples can be located in the neighbors of the current block or can be placed separately. The intra prediction mode may include multiple non-directional modes and multiple directional modes. The non-directional mode may include, for example, a DC mode and a plane mode. Depending on the level of detail of the prediction direction, the directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is only an example, and more or fewer directional prediction modes may be used according to the settings. The intra prediction unit 185 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0072] The inter prediction unit (inter predictor) 180 may derive a prediction block of the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information sent in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc. The reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter prediction unit 180 may configure a motion information candidate list based on the neighboring blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter prediction unit 180 may use the motion information of the neighboring block as the motion information of the current block. In the case of skip mode, unlike the merge mode, a residual signal may not be sent. In the case of motion vector prediction (MVP) mode, the motion vector of the neighboring block may be used as a motion vector predictor, and the motion vector of the current block may be signaled by encoding the motion vector difference and an indicator of the motion vector predictor. The motion vector difference may mean the difference between the motion vector of the current block and the motion vector predictor.

[0073] The prediction unit may generate a prediction signal based on various prediction methods and prediction techniques described below. For example, the prediction unit may not only apply intra prediction or inter prediction, but may also apply both intra prediction and inter prediction at the same time to predict the current block. The prediction method of applying both intra prediction and inter prediction to predict the current block may be referred to as combined inter and intra prediction (CIIP). In addition, the prediction unit may perform intra block copying (IBC) to predict the current block. Intra block copying may be used for content image / video encoding of games, etc., such as screen content coding (SCC). IBC is a method of predicting the current picture using a previously reconstructed reference block in the current picture at a predetermined distance from the current block. When IBC is applied, the position of the reference block in the current picture may be encoded as a vector (block vector) corresponding to a predetermined distance. IBC basically performs prediction in the current picture, but may be performed similarly to inter prediction because the reference block is derived within the current picture. That is, IBC may use at least one of the inter prediction techniques described in the present disclosure.

[0074] The prediction signal generated by the prediction unit can be used to generate a reconstruction signal or to generate a residual signal. The subtractor 115 can generate a residual signal (residual block or residual sample array) by subtracting the prediction signal (prediction block or prediction sample array) output from the prediction unit from the input image signal (original block or original sample array). The generated residual signal can be sent to the transformer 120.

[0075] The transformer 120 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a karhunen-loève transform (KLT), a graph-based transform (GBT), or a conditional nonlinear transform (CNT). Here, GBT refers to a transform obtained from a graph when relationship information between pixels is represented by a graph. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to square pixel blocks of the same size or may be applied to blocks of variable size rather than square.

[0076] The quantizer 130 may quantize the transform coefficients and send them to the entropy encoder 190. The entropy encoder 190 may encode the quantized signal (information about the quantized transform coefficients) and output a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantizer 130 may rearrange the quantized transform coefficients of the block type into a one-dimensional vector form based on the coefficient scanning order, and generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form.

[0077] The entropy encoder 190 may perform various encoding methods, such as, for example, exponential Golomb, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 190 may encode information required for video / image reconstruction other than quantized transform coefficients together or separately (e.g., values ​​of syntax elements, etc.). The encoded information (e.g., encoded video / image information) may be transmitted or stored in units of a network abstraction layer (NAL) in the form of a bitstream. The video / image information may also include information about various parameter sets, such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may also include general constraint information. The signaled information, transmitted information, and / or syntax elements described in the present disclosure may be encoded and included in a bitstream through the above-described encoding process.

[0078] The bit stream may be transmitted through a network or may be stored in a digital storage medium. The network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) that transmits a signal output from the entropy encoder 190 and / or a storage unit (not shown) that stores the signal may be included as an internal / external element of the image encoding device 100. Alternatively, a transmitter may be provided as a component of the entropy encoder 190.

[0079] The quantized transform coefficients output from the quantizer 130 may be used to generate a residual signal. For example, the residual signal (residual block or residual sample) may be reconstructed by applying dequantization and inverse transformation to the quantized transform coefficients through the dequantizer 140 and the inverse transformer 150.

[0080] The adder 155 adds the reconstructed residual signal to the prediction signal output from the inter-frame prediction unit 180 or the intra-frame prediction unit 185 to generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array). If the block to be processed has no residual, such as the case where the skip mode is applied, the prediction block can be used as a reconstructed block. The adder 155 can be called a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next block to be processed in the current picture, and can be used for inter-frame prediction of the next picture by filtering as described below.

[0081] The filter 160 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 160 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and store the modified reconstructed picture in the memory 170, specifically, in the DPB of the memory 170. Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filtering, bilateral filtering, etc. The filter 160 can generate various information related to filtering and send the generated information to the entropy encoder 190, as described later in the description of each filtering method. The information related to filtering can be encoded by the entropy encoder 190 and output in the form of a bit stream.

[0082] The modified reconstructed picture transmitted to the memory 170 may be used as a reference picture in the inter prediction unit 180. When inter prediction is applied by the image encoding apparatus 100, prediction mismatch between the image encoding apparatus 100 and the image decoding apparatus may be avoided and encoding efficiency may be improved.

[0083] The DPB of the memory 170 may store the modified reconstructed picture for use as a reference picture in the inter-frame prediction unit 180. The memory 170 may store the motion information of the block for deriving (or encoding) the motion information in the current picture and / or the motion information of the reconstructed block in the picture. The stored motion information may be sent to the inter-frame prediction unit 180 and used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 170 may store the reconstructed samples of the reconstructed blocks in the current picture and may transmit the reconstructed samples to the intra-frame prediction unit 185.

[0084] Overview of Image Decoding Equipment

[0085] Figure 3 is a view schematically showing an image decoding device to which an embodiment of the present disclosure is applicable.

[0086] like Figure 3 As shown, the image decoding device 200 may include an entropy decoder 210, a dequantizer 220, an inverse transformer 230, an adder 235, a filter 240, a memory 250, an inter-frame predictor 260, and an intra-frame predictor 265. The inter-frame predictor (inter-frame prediction unit) 260 and the intra-frame predictor (intra-frame prediction unit) 265 may be collectively referred to as a "prediction unit (predictor)". The dequantizer 220 and the inverse transformer 230 may be included in a residual processor.

[0087] According to an embodiment, all or at least some of the multiple components configuring the image decoding apparatus 200 may be configured by hardware components (eg, a decoder or a processor). In addition, the memory 170 may include a decoded picture buffer (DPB) or may be configured by a digital storage medium.

[0088] The image decoding device 200 having received a bit stream including video / image information may perform the same Figure 2 The image encoding device 100 may reconstruct the image by processing corresponding to the processing performed by the image encoding device 100. For example, the image decoding device 200 may perform decoding using a processing unit applied in the image encoding device. Therefore, the processing unit of decoding may be, for example, a coding unit. The coding unit may be obtained by partitioning the coding tree unit or the maximum coding unit. The reconstructed image signal decoded and output by the image decoding device 200 may be reproduced by a reproduction device (not shown).

[0089] The image decoding device 200 may receive the image in the form of a bit stream from Figure 2The received signal may be decoded by the entropy decoder 210. For example, the entropy decoder 210 may parse the bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information may also include information about various parameter sets, such as an adaptive parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may also include general constraint information. The image decoding device may also decode the picture based on the information about the parameter set and / or the general constraint information. The signaled / received information and / or syntax elements described in the present disclosure may be decoded and obtained from the bitstream through a decoding process. For example, the entropy decoder 210 may decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values ​​of the syntax elements required for image reconstruction and the quantized values ​​of the transform coefficients of the residual. More specifically, the CABAC entropy decoding method can receive a bin corresponding to each syntax element in the bitstream, use the decoding target syntax element information, the decoding information of the neighboring block and the decoding target block, or the information of the symbol / bin decoded in the previous stage to determine the context model, perform arithmetic decoding on the bin by predicting the probability of occurrence of the bin according to the determined context model, and generate a symbol corresponding to the value of each syntax element. In this case, the CABAC entropy decoding method can update the context model by using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. The information related to prediction among the information decoded by the entropy decoder 210 can be provided to the prediction unit (inter-frame predictor 260 and intra-frame predictor 265), and the residual value (ie, quantized transform coefficient and related parameter information) for which entropy decoding is performed in the entropy decoder 210 can be input to the dequantizer 220. In addition, the information about filtering among the information decoded by the entropy decoder 210 can be provided to the filter 240. In addition, a receiver (not shown) for receiving a signal output from the image encoding apparatus may be further configured as an internal / external element of the image decoding apparatus 200 , or the receiver may be a component of the entropy decoder 210 .

[0090] In addition, the image decoding device according to the present disclosure may be referred to as a video / image / picture decoding device. The image decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include an entropy decoder 210. The sample decoder may include a dequantizer 220, an inverse transformer 230, an adder 235, a filter 240, a memory 250, an inter-frame predictor 260, or at least one of an intra-frame predictor 265.

[0091] The dequantizer 220 may dequantize the quantized transform coefficients and output the transform coefficients. The dequantizer 220 may rearrange the quantized transform coefficients in the form of two-dimensional blocks. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the image encoding device. The dequantizer 220 may dequantize the quantized transform coefficients by using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficients.

[0092] The inverse transformer 230 may perform an inverse transformation on the transformation coefficients to obtain a residual signal (residual block, residual sample array).

[0093] The prediction unit may perform prediction on the current block and generate a prediction block including prediction samples of the current block. The prediction unit may determine whether to apply intra prediction or inter prediction to the current block based on the information about prediction output from the entropy decoder 210, and may determine a specific intra / inter prediction mode (prediction technique).

[0094] The same as described in the prediction unit of the image encoding device 100 , the prediction unit can generate a prediction signal based on various prediction methods (techniques) to be described later.

[0095] The intra predictor 265 may predict the current block by referring to samples in the current picture. The description of the intra prediction unit 185 is also applicable to the intra predictor 265.

[0096] The inter-frame predictor 260 can derive the prediction block of the current block based on the reference block (reference sample array) specified by the motion vector on the reference picture. In this case, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information can be predicted in units of blocks, sub-blocks or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter-frame prediction, the neighboring blocks may include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. For example, the inter-frame predictor 260 may configure a motion information candidate list based on the neighboring blocks, and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Inter-frame prediction may be performed based on various prediction modes, and information about the prediction may include information indicating the inter-frame prediction mode of the current block.

[0097] The adder 235 can generate a reconstruction signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the prediction unit (including the inter-frame predictor 260 and / or the intra-frame predictor 265). If the block to be processed has no residual, such as when the skip mode is applied, the prediction block can be used as the reconstructed block. The description of the adder 155 also applies to the adder 235. The adder 235 can be called a reconstructor or a reconstructed block generator. The generated reconstruction signal can be used for intra-frame prediction of the next block to be processed in the current picture, and can be used for inter-frame prediction of the next picture by filtering as described below.

[0098] The filter 240 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 240 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and store the modified reconstructed picture in the memory 250, specifically, in the DPB of the memory 250. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filtering, bilateral filtering, etc.

[0099] The (modified) reconstructed picture stored in the DPB of the memory 250 can be used as a reference picture in the inter-frame predictor 260. The memory 250 can store the motion information of the block for deriving (or decoding) the motion information in the current picture and / or the motion information of the reconstructed block in the picture. The stored motion information can be sent to the inter-frame predictor 260 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 250 can store the reconstructed samples of the reconstructed block in the current picture and transmit the reconstructed samples to the intra-frame predictor 265.

[0100] In the present disclosure, the embodiments described in the filter 160, the inter-frame prediction unit 180 and the intra-frame prediction unit 185 of the image encoding device 100 can be equally or correspondingly applied to the filter 240, the inter-frame predictor 260 and the intra-frame predictor 265 of the image decoding device 200.

[0101] Inter prediction

[0102] The prediction unit of the image encoding device 100 and the image decoding device 200 may derive prediction samples by performing inter-frame prediction block by block. Inter-frame prediction may be a prediction derived in a manner that depends on data elements (e.g., sample values ​​or motion information) of a picture other than the current picture. When inter-frame prediction is applied to the current block, a prediction block (prediction sample array) for the current block may be derived based on a reference block (reference sample array) specified by a motion vector on a reference picture indicated by a reference picture index. In this article, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information of the current block may be predicted on a per-block, sub-block or sample basis based on the correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction type (L0 prediction, L1 prediction, dual prediction, etc.) information. When inter-frame prediction is applied, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be referred to as a collocated reference block or collocated CU (colCU). A reference picture including temporally neighboring blocks may be referred to as a collocated picture (colPic). For example, a motion information candidate list may be constructed based on neighboring blocks of the current block. A flag or index information indicating which candidate is selected (used) to derive the motion vector and / or reference picture index of the current block may be signaled. Inter-frame prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the motion information of the current block may be the same as the motion information of the selected neighboring block. In the case of skip mode, unlike merge mode, a residual signal may not be sent. In the case of motion information prediction (motion vector prediction MVP) mode, the motion vector of the selected neighboring block may be used as a motion vector predictor, and the motion vector difference may be signaled. In this case, the sum of the motion vector predictor and the motion vector difference may be used to derive the motion vector of the current block.

[0103] Depending on the inter-frame prediction type (L0 prediction, L1 prediction, bi-prediction, etc.), the motion information may include L0 motion information and / or L1 motion information. The motion vector in the L0 direction may be referred to as the L0 motion vector or MVL0, and the motion vector in the L1 direction may be referred to as the L1 motion vector or MVL1. Prediction based on the L0 motion vector may be referred to as L0 prediction. Prediction based on the L1 motion vector may be referred to as L1 prediction. Prediction based on the L0 motion vector and the L1 motion vector may be referred to as bidirectional prediction. In this document, the L0 motion vector may refer to a motion vector associated with the reference picture list L0 (L0), and the L1 motion vector may refer to a motion vector associated with the reference picture list L1 (L1). The reference picture list L0 may include a picture before the current picture in output order as a reference picture. The reference picture list L1 may include a picture after the current picture in output order. The previous picture may be referred to as a forward (reference) picture, and the subsequent picture may be referred to as a backward (reference) picture. The reference picture list L0 may also include a picture after the current picture in output order as a reference picture. In this case, within the reference picture list L0, the previous picture may be indexed first, and the subsequent picture may be indexed next. The reference picture list L1 may also include a picture before the current picture in output order as a reference picture. In this case, within the reference picture list 1, the subsequent picture may be indexed first, and the previous picture may be indexed next. Herein, the output order may correspond to a picture order count (POC) order.

[0104] Figure 4 is a diagram schematically illustrating the inter-frame prediction unit 180 of the image encoding apparatus 100, and Figure 5 is a flowchart illustrating a method of encoding an image based on inter-frame prediction.

[0105] The image encoding device 100 may perform inter prediction on the current block (S510). The image encoding device 100 may derive the inter prediction mode and motion information of the current block, and may generate a prediction sample of the current block. In this article, the process of determining the inter prediction mode, deriving the motion information, and generating the prediction sample may be performed simultaneously, or any one process may be performed before the other process. For example, the inter prediction unit 180 of the image encoding device 100 may include a prediction mode determination unit 181, a motion information derivation unit 182, and a prediction sample derivation unit 183. The prediction mode determination unit 181 may determine a prediction mode for the current block. The motion information derivation unit 182 may derive the motion information of the current block. The prediction sample derivation unit 183 may derive the prediction sample of the current block. For example, the inter prediction unit 180 of the image encoding device 100 may search for a predetermined area (search area) of a reference picture of a block similar to the current block through motion estimation, and may derive a reference block whose difference with the current block is the smallest or less than or equal to a predetermined standard. Based on this, a reference picture index indicating a reference picture where the reference block is located can be derived, and a motion vector can be derived based on the position difference between the reference block and the current block. The image encoding device 100 can determine a mode applied to the current block among various prediction modes. The image encoding device 100 can compare the RD costs for various prediction modes and can determine the best prediction mode for the current block.

[0106] For example, when the skip mode or merge mode is applied to the current block, the image encoding device 100 may construct a merge candidate list described later, and may derive a reference block whose difference with the current block is the smallest or less than or equal to a predetermined standard among the reference blocks indicated by the merge candidates included in the merge candidate list. In this case, a merge candidate associated with the derived reference block may be selected, and merge index information indicating the selected merge candidate may be generated and signaled to the decoding device. The motion information of the current block may be derived using the motion information of the selected merge candidate.

[0107] As another example, when the (A)MVP mode is applied to the current block, the image encoding device 100 may construct an (A)MVP candidate list described later, and may use the motion vector of the MVP candidate selected from the motion vector predictor (MVP) candidates included in the (A)MVP candidate list as the MVP of the current block. In this case, for example, a motion vector indicating a reference block derived by the above-mentioned motion estimation may be used as the motion vector of the current block. Among the MVP candidates, the MVP candidate having a motion vector with the smallest difference from the motion vector of the current block may be the selected MVP candidate. A motion vector difference (MVD) as a difference obtained by subtracting the MVP from the motion vector of the current block may be derived. In this case, information about the MVD may be signaled to the image decoding device 200. In addition, when the (A)MVP mode is applied, the value of the reference picture index may be constructed as reference picture index information, and may be signaled separately to the image decoding device 200.

[0108] The image encoding apparatus 100 may induce a residual sample based on the prediction sample (S520). The image encoding apparatus 100 may compare the prediction sample with an original sample of the current block to induce the residual sample.

[0109] The image encoding device 100 may encode the image information including prediction information and residual information (S530). The image encoding device 100 may output the encoded image information in the form of a bitstream. The prediction information is information related to the prediction process, and may include prediction mode information (e.g., a skip flag, a merge flag, or a mode index) and information about motion information. The information about the motion information may include candidate selection information (e.g., a merge index, an mvp flag, or an mvp index) as information for deriving a motion vector. In addition, the information about the motion information may include the above-mentioned reference picture index information and / or information about the MVD. In addition, the information about the motion information may include information indicating whether L0 prediction, L1 prediction, or bidirectional prediction is applied. The residual information is information about the residual sample. The residual information may include information about the quantized transform coefficients of the residual sample.

[0110] The output bit stream may be stored in a (digital) storage medium and sent to a decoding device, or may be sent to the image decoding device 200 via a network.

[0111] In addition, as described above, the image encoding device 100 can generate a reconstructed picture (including a reconstructed sample and a reconstructed block) based on the reference sample and the residual sample. This is to derive the same prediction result as the prediction result performed in the image decoding device 200 through the image encoding device 100, and thereby, the encoding efficiency can be improved. Therefore, the image encoding device 100 can store the reconstructed picture (or reconstructed sample, reconstructed block) in a memory, and can use it as a reference picture for inter-frame prediction. As described above, the loop filtering process can also be applied to the reconstructed picture.

[0112] Figure 6 is a diagram schematically showing an inter-frame predictor 260 of the image decoding apparatus 200, and Figure 7 is a flow chart showing a method of decoding an image based on inter-frame prediction.

[0113] The image decoding apparatus 200 may perform an operation corresponding to the operation performed by the image encoding apparatus 100. The image decoding apparatus 200 may perform prediction on the current block based on the received prediction information, and may derive a prediction sample.

[0114] Specifically, the image decoding apparatus 200 may determine a prediction mode for a current block based on the received prediction information (S710). The image decoding apparatus 200 may determine which inter prediction mode is applied to the current block based on prediction mode information in the prediction information.

[0115] For example, based on the merge flag, it can be determined whether to apply the merge mode to the current block or to determine the (A) MVP mode. Alternatively, one of various inter-frame prediction mode candidates can be selected based on the mode index. The inter-frame prediction mode candidate may include a skip mode, a merge mode, and / or an (A) MVP mode, or may include various inter-frame prediction modes described later.

[0116] The image decoding device 200 may derive motion information of the current block based on the determined inter-frame prediction mode (S720). For example, when the skip mode or the merge mode is applied to the current block, the image decoding device 200 may construct a merge candidate list described later, and may select a merge candidate from among the merge candidates included in the merge candidate list. The selection may be performed based on the above-mentioned selection information (merge index). The motion information of the selected merge candidate may be used to derive the motion information of the current block. The motion information of the selected merge candidate may be used as the motion information of the current block.

[0117] As another example, when the (A)MVP mode is applied to the current block, the image decoding device 200 may construct an (A)MVP candidate list described later, and may use the motion vector of the motion vector predictor (MVP) candidate selected from the motion vector predictor (MVP) candidates included in the (A)MVP candidate list as the MVP of the current block. The selection may be performed based on the above-mentioned selection information (MVP flag or MVP index). In this case, the MVD of the current block may be derived based on the information about the MVD, and the motion vector of the current block may be derived based on the MVP and MVD of the current block. In addition, the reference picture index of the current block may be derived based on the reference picture index information. The picture indicated by the reference picture index in the reference picture list associated with the current block may be derived as a reference picture, which is referenced for inter-frame prediction of the current block.

[0118] In addition, as will be described later, the motion information of the current block can be derived without constructing a candidate list. In this case, the motion information of the current block can be derived according to the process described in the prediction mode described later. In this case, the candidate list configuration as described above can be omitted.

[0119] The image decoding apparatus 200 may generate a prediction sample for the current block based on the motion information of the current block (S730). In this case, a reference picture may be derived based on a reference picture index of the current block, and a sample of the reference block indicated on the reference picture by a motion vector of the current block may be used to derive the prediction sample of the current block. In this case, as described below, in some cases, a prediction sample filtering process may also be performed on all or part of the prediction samples of the current block.

[0120] For example, the inter-frame predictor 260 of the image decoding device 200 may include a prediction mode determination unit 261, a motion information derivation unit 262, and a prediction sample derivation unit 263. The prediction mode determination unit 181 may determine a prediction mode for a current block based on the received prediction mode information. The motion information derivation unit 182 may derive motion information (motion vector and / or reference picture index) of the current block based on the received information about motion information. The prediction sample derivation unit 183 may derive a prediction sample of the current block.

[0121] The image decoding device 200 may generate residual samples for the current block based on the received residual information (S740). The image decoding device 200 may generate reconstructed samples for the current block based on the predicted samples and the residual samples, and may generate a reconstructed picture based thereon (S750). Thereafter, as described above, a loop filtering process may also be applied to the reconstructed image.

[0122] Reference Figure 8, the inter-frame prediction process may include the following steps: determining an inter-frame prediction mode (S810), deriving motion information according to the determined prediction mode (S820), and performing prediction (generating prediction samples) based on the derived motion information (S830). The inter-frame prediction process may be performed in the image encoding apparatus 100 and the image decoding apparatus 200 as described above.

[0123] Inter prediction mode determination

[0124] Various inter prediction modes can be used to predict the current block in the picture. For example, various modes such as merge mode, skip mode, motion vector prediction (MVP) mode, affine mode, sub-block merge mode, and merge with MVD (MMVD) mode can be used. Decoder-side motion vector refinement (DMVR) mode, adaptive motion vector resolution (AMVR) mode, bidirectional prediction (BCW) with CU-level weights, bidirectional optical flow (BDOF), etc. can also be used additionally or alternatively as additional modes. Affine mode can be referred to as affine motion prediction mode. MVP mode can be referred to as advanced motion vector prediction (AMVP) mode. In this document, some modes and / or motion information candidates derived by some modes can be included as one of the motion information candidates of other modes. For example, an HMVP candidate can be added as a merge candidate in merge / skip mode, or can be added as an MVP candidate in MVP mode.

[0125] Prediction mode information indicating the inter prediction mode of the current block may be signaled from the image encoding device 100 to the image decoding device 200. The prediction mode information may be included in a bitstream and received by the image decoding device 200. The prediction mode information may include index information indicating one of a plurality of candidate modes. Alternatively, the inter prediction mode may be indicated by hierarchical signaling of flag information. In this case, the prediction mode information may include one or more flags. For example, a skip flag may be signaled to indicate whether the skip mode is applied, and if the skip mode is not applied, a merge flag may be signaled to indicate whether the merge mode is applied, and if the merge mode is not applied, an MVP mode may be indicated to be applied or a flag for additional classification may be further signaled. The affine mode may be signaled in an independent mode, or the affine mode may be signaled in a mode dependent on the merge mode or the MVP mode. For example, the affine mode may include an affine merge mode and an affine MVP mode.

[0126] Derivation of motion information

[0127] Inter-frame prediction can be performed using the motion information of the current block. The image encoding device 100 can derive the best motion information for the current block through a motion estimation process. For example, the image encoding device 100 can use the original block in the original picture for the current block to search for a similar reference block with high correlation in the reference picture in units of fractional pixels within a predetermined search range, thereby deriving motion information. The similarity of the blocks can be derived based on the difference in sample values ​​based on the phase. For example, the similarity of the blocks can be calculated based on the SAD between the current block (or the template of the current block) and the reference block (or the template of the reference block). In this case, the motion information can be derived based on the reference block with the minimum SAD in the search area. The derived motion information can be signaled to the image decoding device 200 according to various methods based on the inter-frame prediction mode.

[0128] DMVR (Decoder-side Motion Vector Refinement)

[0129] DMVR is a method of performing motion prediction by refining the motion information of adjacent blocks at the decoder side. When DMVR is applied, the decoder can derive the refined motion information through cost comparison based on a template generated using the motion information of adjacent blocks in merge / skip mode. According to an embodiment of the present invention, the accuracy of motion prediction can be improved, and compression performance can be improved without additional signaling information.

[0130] Hereinafter, for ease of explanation, the following description focuses on the decoder side, but the DMVR of the present disclosure can be performed on the encoder side in the same manner. At the same time, DMVR can be regarded as an example of a motion information derivation process because the motion vector is refined, or can be regarded as an example of a prediction sample generation process because the prediction sample is generated based on a reference block indicated by a refined MV pair.

[0131] In the bidirectional prediction process, the refined MV can be searched around the initial MV in the reference picture list L0 and the reference picture list L1. According to the bilateral matching (BM) method, the distortion between two candidate blocks in the reference picture list L0 and the list L1 can be calculated. Fig. 9 , the SAD (indicated by MVdiff) between red blocks can be calculated based on each MV candidate within the search range centered on the initial MV. At this time, the MV candidate with the lowest SAD can be the refined MV and can be used to generate a bilateral prediction signal.

[0132] In one embodiment, the decoder may invoke the DMVR process to improve the accuracy of the initial motion compensated prediction (i.e., motion compensated prediction via conventional merge / skip mode). For example, when the prediction mode of the current block is merge mode or skip mode, the decoder may perform the DMVR process and apply bilateral bidirectional prediction in which bilateral reference pictures are in opposite directions in display order relative to the current picture to the current block.

[0133] Specifically, for example, DMVR may be applied to a CU encoded with the following modes and features.

[0134] CU-level merge mode with bilateral prediction MV

[0135] One reference picture is before the current picture, and the other reference picture is after the current picture

[0136] The distances from the two reference pictures to the current picture (i.e., POC differences) are equal to each other

[0137] CU has 64 luma samples

[0138] CU height and CU width are both greater than or equal to 8 luma samples

[0139] BCW weight index indicates the same weight

[0140] ·Do not activate WP for the current block

[0141] The refined MV derived by the DMVR process can be used not only to generate inter-frame prediction samples, but also to predict the temporal motion vector for future picture encoding. The original MV can be used not only in the deblocking process, but also to predict the spatial motion vector for future CU encoding. The additional features of VTM5 DVMR are as follows.

[0142] (1) Search solution

[0143] In DMVR, the search points surround the initial MV, and the MV offset complies with the MV difference mirror rule. In other words, all points checked by DMVR (denoted as candidate MV pairs (MV0, MV1)) comply with the following equations 1 and 2.

[0144] [Formula 1]

[0145] MVO′=MVO+MV_offset

[0146] [Formula 2]

[0147] MN1′=MV1-MV_offset

[0148] Here, MV_offset may represent a refinement offset between an initial MV and a refinement MV in one of the reference pictures. In VTM5, the refinement search range may be two integer luma samples from the initial MV. Furthermore, the search process may include an integer sample offset search phase and a fractional sample refinement phase.

[0149] A full search of 25 points can be applied to the integer sample offset search. First, the SAD of the initial MV pair can be calculated. If the SAD of the initial MV is less than a predetermined threshold, the integer sample stage of DMVR can be terminated. Otherwise, the SAD of the remaining 24 points can be calculated and checked in raster scan order. At this point, the point with the smallest SAD can be selected as the output of the integer sample offset search stage.

[0150] After the integer sample search, fractional sample refinement may be performed. To reduce computational complexity, fractional sample refinement may be derived using a parameter error surface formula rather than an additional search via SAD comparison. Fractional sample refinement may be conditionally performed based on the output of the integer sample search phase. If the integer sample search phase ends at the center with the minimum SAD in the primary iterative search or the secondary iterative search, fractional sample refinement may be additionally applied.

[0151] In the sub-pixel offset estimation based on the parameter error surface, the cost at the center position and the costs at four surrounding positions from the center can be used to fit the 2-D parabolic error surface formula as shown in Equation 3.

[0152] [Formula 3]

[0153] E(x, y) = A(x min ) 2 +B(yy min ) 2 +Cwhere (x min ,y min ) corresponds to the fractional position of the minimum cost, and C may correspond to the minimum cost value. By solving the above equation using the cost values ​​of the five points, (x ) may be calculated as in Equations 4 and 5. min ,y min ).

[0154] [Formula 4]

[0155] x min =(E(-1,0)-E(1,0)) / (2(E(-1,0)+E(1,0)-2E(0,0)))

[0156] [Formula 5]

[0157] y min=(E(0,-1)-E(0,1)) / (2((E(0,-1)+E(0,1)-2E(0,0)))

[0158] Since all cost values ​​are positive and the minimum is E(0,0), x min and min The value may be automatically constrained between -8 and 8. This may correspond to a half-pixel offset with 1 / 16 pixel MV precision in VTM5. At the same time, the calculated (xmin, ymin) may be added to the integer distance refinement MV to obtain a sub-pixel accurate refinement delta MV.

[0159] (2) Bilinear interpolation and sample filling

[0160] The resolution of the MV can be 1 / 16 of a luma sample. The fractional position samples can be interpolated using an 8-tap interpolation filter. In DMVR, the search point can be offset by integer samples around the initial fractional pixel MV. Therefore, the fractional position samples need to be interpolated for the DMVR search process. In order to reduce computational complexity, a bilinear interpolation filter can be used to generate fractional samples for the search process in DMVR. Another important effect is that the use of a bilinear filter enables DMVR to not access more reference samples than a general motion compensation process within a 2-sample search range. After obtaining the refined MV through the DMVR search process, a general 8-tap interpolation filter can be applied to generate the final prediction. In order not to access more reference samples than a general motion compensation process, samples that are not required by the interpolation process based on the original MV but are required by the interpolation process based on the refined MV can be filled in from the available samples.

[0161] (3) Maximum DMVR processing unit

[0162] If the CU width and / or height is greater than 16 luma samples, the CU may be split into sub-blocks with width and / or height equal to 16 luma samples. The maximum unit size of the DMVR search process may be limited to 16×16.

[0163] Generation of prediction samples

[0164] A prediction block for a current block may be derived based on motion information derived according to a prediction mode. The prediction block may include prediction samples (prediction sample arrays) of the current block. When a motion vector of the current block indicates a fractional sample unit, an interpolation process may be performed, by which prediction samples of the current block may be derived based on reference samples in fractional sample units within a reference picture. When affine inter prediction is applied to the current block, prediction samples may be generated based on sample / sub-block units MV. When bidirectional prediction is applied, prediction samples derived by weighting or weighted averaging (according to phase) prediction samples derived based on L0 prediction (that is, prediction using a reference picture and MVL0 in a reference picture list L0) and prediction samples derived based on L1 prediction (that is, prediction using a reference picture and MVL1 in a reference picture list L1) may be used as prediction samples of the current block. When bidirectional prediction is applied, if a reference picture for L0 prediction and a reference picture for L1 prediction are located in different temporal directions relative to the current picture (i.e., bidirectional prediction and bi-prediction), it may be referred to as true bidirectional prediction.

[0165] As described above, reconstructed samples and reconstructed pictures may be generated based on the derived prediction samples, and thereafter, processes such as in-loop filtering may be performed.

[0166] Template Matching(TM)

[0167] Fig.10 is a diagram for explaining an encoding / decoding method based on template matching.

[0168] Template matching (TM) is a motion vector derivation method performed on the decoder side, and is a method of refining the motion information of the current block by finding a template (hereinafter referred to as "reference template") that is most similar to a template (hereinafter referred to as "current template") adjacent to the current block (e.g., current coding unit, current CU) in a reference picture. The current template may be a top neighbor block and / or a left neighbor block of the current block, or may be some of these neighbor blocks. In addition, it may be determined that the reference template has the same size as the current template.

[0169] like Fig.10 As shown, when the initial motion vector of the current block is derived, a better search for the motion vector can be performed in the surrounding area of ​​the initial motion vector. For example, the range of the surrounding area where the search is performed can be within a [-8, +8] pixel search area centered on the initial motion vector. In addition, the size of the search step used to perform the search can be determined based on the AMVR mode of the current block. In addition, in the merge mode, template matching can be continuously performed using a bilateral matching process.

[0170] If the prediction mode of the current block is the AMVP mode, a motion vector predictor candidate (MVP candidate) may be determined based on a template matching error. For example, a motion vector predictor candidate (MVP candidate) that minimizes the error between the current template and the reference template may be selected. Thereafter, template matching for refining the motion vector may be performed on the selected motion vector predictor candidate. At this time, template matching for refining the motion vector may not be performed on the unselected motion vector predictor candidate.

[0171] More specifically, the refinement of the selected motion vector predictor candidate can start from full pixel (integer pixel) precision within the [-8, +8] pixel search area using an iterative diamond search. Alternatively, in the case of a 4-pixel AMVR mode, it can start from 4-pixel precision. Thereafter, depending on the AMVR mode, a search with half-pixel and / or quarter-pixel precision can be performed next. According to the search process, the motion vector predictor candidate can maintain the same motion vector precision as that indicated by the AMVR mode even after the template matching process. During the iterative search process, if the difference between the previous minimum cost and the current minimum cost is less than an arbitrary threshold, the search process terminates. The threshold can be equal to the area of ​​the block, that is, the number of samples in the block. Table 1 shows examples of search patterns according to the AMVR mode and the merge mode accompanying the AMVR.

[0172] [Table 1]

[0173]

[0174] If the prediction mode of the current block is the merge mode, a similar search method can be applied to the merge candidate indicated by the merge index. As shown in Table 1 above, template matching up to 1 / 8 pixel accuracy can be performed, or half-pixel accuracy or lower accuracy can be skipped, which can be determined depending on whether an alternative interpolation filter is used based on the merged motion information. In this case, the alternative interpolation filter may be a filter used when the AMVR is in half-pixel mode. In addition, if template matching is available, then depending on whether bilateral matching (BM) is available, template matching can be run as an independent process, or can be run as an additional motion vector refinement process between block-based bilateral matching and sub-block-based bilateral matching. Whether template matching is available and / or whether bilateral matching is available can be determined based on an availability condition check. In the above, the accuracy of the motion vector may refer to the accuracy of the motion vector difference (MVD).

[0175] Multi-pass decoder-side motion vector refinement

[0176] When applying multiple passes of decoder-side motion vector refinement, in the first pass, bilateral matching (BM) may be applied to the coding block. In the second pass, BM may be applied to each 16×16 sub-block in the coding block. In the third pass, the MV of each 8×8 sub-block may be refined by applying bidirectional optical flow (BDOF). The refined MV may be stored for both spatial and temporal motion vector prediction.

[0177] (1) First pass – Block-based bilateral matching MV refinement

[0178] In the first pass, a refined MV can be derived by applying BM to the coding block. Similar to decoder-side motion vector refinement (DMVR), in a bidirectional prediction operation, a refined MV can be searched around two initial MVs (MV0 and MV1) of reference picture lists L0 and L1. Refined MVs (MV0_pass0 and MV1_pass1) can be searched around the initial MV based on the minimum bilateral matching cost between the two reference blocks of L0 and L1.

[0179] In order to derive integer sample precision intDeltaMV during BM, a local search may be performed. The local search may be looped in a search range [–sHor, sHor] in the horizontal direction and a search range [–sVer, sVer] in the vertical direction by applying a 3×3 square search pattern. Here, the values ​​of sHor and sVer may be determined based on the block size, and the maximum values ​​of sHor and sVer may be 8.

[0180] The bilateral matching cost can be derived as follows: bilCost = mvDistanceCost + sadCost. When the block size cbW*cbH is greater than 64, the MRSAD cost function can be applied to remove the DC effect of distortion between reference blocks. When the bilCost at the center point of the 3×3 search pattern is the minimum cost, the intDeltaMV local search can be terminated. Otherwise, the current minimum cost search point becomes the new center point of the 3×3 search pattern, and the search for the minimum cost can continue until the end of the search range is reached. The existing fractional sample refinement can be further applied to derive the final deltaMV. After the first pass, the refined MV can be derived as follows:

[0181] MV0_pass1 = MV0 + deltaMV

[0182] MV1_pass1 = MV1 – deltaMV

[0183] (2) Second pass: Sub-block-based bilateral matching MV refinement

[0184] In the second pass, the refined MV can be derived by applying BM to the 16×16 grid sub-blocks. In each sub-block, the refined MV can be searched around the two MVs (MV0_pass1 and MV1_pass1) obtained in the first pass of the reference picture lists L0 and L1. The refined MVs MV0_pass2(sbIdx2) and MV1_pass2(sbIdx2) can be derived based on the minimum bilateral matching cost between the two reference sub-blocks of L0 and L1.

[0185] In each sub-block, a full search may be performed to derive integer sample precision intDeltaMV during BM. The full search may have a search range of [–sHor, sHor] in the horizontal direction and a search range of [–sVer, sVer] in the vertical direction. Here, the values ​​of sHor and sVer may be determined based on the block size, and the maximum values ​​of sHor and sVer may be 8.

[0186] The bilateral matching cost can be calculated by applying the cost factor to the SATD cost between two reference blocks: bilCost = satdCost * costFactor. Fig.11 As shown, the search area (2*sHor+1)*(2*sVer+1) can be divided into up to five diamond-shaped search areas. Fig.11 is a diagram showing search areas that can be applied in multi-pass DMVR (decoder-side motion vector refinement). Each search area is assigned a costFactor determined by the distance intDeltaMV between each search point and the starting MV, and each diamond area can be processed sequentially starting from the center of the search area. In each area, the search points can be processed in a raster scan order starting from the upper left corner to the lower right corner of the area. When the minimum bilCost in the current search area is less than a threshold equal to sbW*sbH, the integer pixel (int-pel) full search is terminated, but in the opposite case, the integer pixel search can continue to the next search area until all search points are searched. In addition, if the difference between the previous minimum cost and the current minimum cost in the loop is less than a threshold equal to the area of ​​the block, the search process can be terminated.

[0187] The existing VVC DMVR fractional sample refinement can be further applied to derive the final deltaMV (sbIdx2). In the second pass, the refined MV can be derived as follows:

[0188] ·MV0_pass2(sbIdx2)=MV0_pass1+deltaMV(sbIdx2)

[0189] ·MV1_pass2(sbIdx2)=MV1_pass1–deltaMV(sbIdx2)

[0190] (3) The third pass: sub-block-based bidirectional optical flow MV refinement

[0191] In the third pass, a refined MV can be derived by applying BDOF to the 8×8 grid sub-blocks. For each 8×8 sub-block, starting from the refined MV of the upper sub-block of the second pass, BDOF refinement can be applied to derive scaled Vx and Vy without clipping. The derived bioMv(Vx, Vy) is rounded to 1 / 16 sample precision and can be clipped to a value between -32 and 32. The refined MVs MV0_pass3(sbIdx3) and MV1_pass3(sbIdx3) of the third pass can be derived as follows:

[0192] ·MV0_pass3(sbIdx3)=MV0_pass2(sbIdx2)+bioMv

[0193] ·MV1_pass3(sbIdx3)=MV0_pass2(sbIdx2)–bioMv

[0194] Adaptive decoder-side motion vector refinement

[0195] The adaptive decoder side motion vector refinement technique is an extension of multi-pass DMVR consisting of two new merge modes, which refine MV in only one direction of L0 or L1 direction of bidirectional prediction for merge candidates that meet DMVR conditions. The multi-pass DMVR process can be applied to the selected merge candidate to refine its motion vector, but MVD0 or MVD1 can be set to 0 in the first pass (i.e., the first pass) (i.e., PU level) DMVR. Similar to the conventional merge mode, the merge candidates of the new merge mode can be derived from spatial neighbor coding blocks, TMVP, non-adjacent blocks, HMVP and paired candidates. The only difference is that only items that meet DMVR conditions can be added to the candidate list. The same merge candidate list can be used in the two new merge modes. If the BM candidate list includes inherited BCW weights, if the weights are unequal or the bidirectional prediction is weighted by the BCW weights, the DMVR process can remain unchanged except for the distortion calculation generated using MRSAD or MRSATD. The merge index can be encoded as in the conventional merge mode.

[0196] At the same time, the amvpMerge mode has been proposed to improve the prediction accuracy in bidirectional prediction. The amvpMerge mode is an inter-frame prediction mode that combines the AMVP mode and the merge mode in different prediction directions. According to the amvpMerge mode, the AMVP mode is applied to any prediction direction, and the merge mode is applied to the opposite prediction direction. In addition, of course, the above-mentioned motion information refinement scheme can be applied to the amvpMerge mode. For example, the motion vector obtained in the amvpMerge mode can be refined based on template matching (TM) or bilateral matching (BM). In the amvpMerge mode, the motion information refinement process operates only when a predetermined syntax element or variable that controls DMVD (decoder-side motion vector derivation) is true. In other words, the above-mentioned refinement tools are controlled together at a higher level (e.g., sequence level) based on a single flag information, or are controlled dependently so that the remaining tools are enabled only when one tool is enabled. However, since template matching (TM) and bilateral matching (BM) are different and separate tools, this tool dependency increases the signaling overhead of the relevant information and reduces the encoding / decoding efficiency.

[0197] In order to solve these problems, the present disclosure proposes an independent control method and syntax of a motion information refinement tool. The various embodiments described in the present disclosure can be applied individually or in combination of two or more. Hereinafter, the embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.

[0198] Table 2 below is a diagram showing a syntax structure for controlling a motion information refinement tool according to one embodiment of the present disclosure.

[0199] [Table 2]

[0200]

[0201] The syntax in Table 2 may include syntax elements Template_matching_based_refinement_enabled_flag and Bilateral_matching_based_refinement_enabled_flag for the motion information refinement tool.

[0202] Template_matching_based_refinement_enabled_flag may indicate whether a template matching based motion information refinement process (or template matching based refinement tool) is enabled. For example, a first value (e.g., 1) of Template_matching_based_refinement_enabled_flag may indicate that a decoder-side template matching based motion information refinement process is enabled for CLVS (coding layer video sequence). Conversely, a second value (e.g., 0) of Template_matching_based_refinement_enabled_flag may indicate that a decoder-side template matching based motion information refinement process is disabled for CLVS.

[0203] Bilateral_matching_based_refinement_enabled_flag may indicate whether a bilateral matching based motion information refinement process (or bilateral matching based refinement tool) is enabled. For example, a first value (e.g., 1) of bilateral_matching_based_refinement_enabled_flag may indicate that a decoder-side bilateral matching based motion information refinement process is enabled for CLVS. In contrast, a second value (e.g., 0) of bilateral_matching_based_refinement_enabled_flag may indicate that a decoder-side bilateral matching based motion information refinement process is disabled for CLVS.

[0204] Depending on the implementation, the syntax in Table 2 may be implemented as one of a sequence parameter set (SPS), a picture parameter set (PPS), a picture header (PH), a slice header (SH), or a video parameter set (VPS).

[0205] In the amvpMerge mode, the process of performing motion information refinement based on the syntax in Table 2 may be divided as shown in Table 3 below.

[0206] [Table 3]

[0207]

[0208] Referring to Table 3, in 'Case 0', the refinement process may be skipped in the motion information derivation process using amvpMerge. In 'Case 1', the decoder-side motion information refinement process based on bilateral matching (BM) may be conditionally applied in the motion information derivation process using amvpMerge. In 'Case 2', the decoder-side motion information refinement process based on template matching (TM) may be conditionally applied in the motion information derivation process using amvpMerge. In 'Case 3', the decoder-side motion information refinement process based on template matching (TM) or the decoder-side motion information refinement process based on bilateral matching (BM) may be conditionally applied in the motion information derivation process using amvpMerge.

[0209] In the above-mentioned 'Case 1' to 'Case 3', the additional condition of the motion information refinement may involve the distance between the reference picture and the current picture. Specifically, depending on whether the distance based on the picture order count (POC) difference between the reference picture and the current picture is the same for all prediction directions, a bilateral matching (BM)-based refinement tool (if the condition is true) or a template matching (TM)-based refinement tool (if the condition is false) may be selectively applied.

[0210] Fig.12 is a flowchart illustrating a motion information refinement process according to an embodiment of the present disclosure. Fig.12 Each step of can be performed by the image encoding device 100 or the image decoding device 200. In the following, for the convenience of explanation, the image decoding device 200 will be described. Fig.12 every step.

[0211] Reference Fig.12 , the image decoding apparatus 200 may derive motion information of the current block for each prediction direction based on applying the amvpMerge mode to the current block ( S1210 ).

[0212] Specifically, the image decoding device 200 may determine the prediction mode to be applied to each prediction direction based on predetermined flag information (e.g., amvpMergeModeFlag[mergeDir]). For example, if amvpMergeModeFlag[0] is true, the image decoding device 200 may apply the merge mode to the L0 direction and the AMVP mode to the L1 direction. Conversely, if amvpMergeModeFlag[1] is true, the image decoding device 200 may apply the merge mode to the L1 direction and the AMVP mode to the L0 direction.

[0213] The image decoding device 200 may construct a reference picture list for each prediction direction according to the determined prediction mode. For example, when the merge mode is applied to the L0 direction, the image decoding device 200 may set the reference picture list of the merge mode (e.g., refListMerge) to REF_PIC_LIST_0. Conversely, when the merge mode is applied to the L1 direction, the image decoding device 200 may set the reference picture list of the merge mode (e.g., refListMerge) to REF_PIC_LIST_1. The reference picture list of the AMVP mode (e.g., refListAmvp) may be set to '1-refListMerge' because it has a prediction direction opposite to the merge mode.

[0214] The image decoding device 200 may determine the reference picture for each prediction direction based on the reference picture list (e.g., refListMerge and refListAmvp) and the reference index (e.g., refIdx[refListMerge], refIdx[refListAmvp]), and derive the motion information of the current block based on the determined reference picture. The motion information may include the motion vector and POC (Picture Order Count) information of the current block, for example, curPoc, pocMerge, or pocAmvp. Here, curPoc may indicate the POC of the current picture, pocMerge may indicate the POC of the reference picture for the merge mode, and pocAmvp may indicate the POC of the reference picture for the AMVP mode.

[0215] In addition, the image decoding device 200 may determine whether to enable a template matching (TM)-based refinement tool or a bilateral matching (BM)-based refinement tool to refine the derived motion information (S1220). Here, whether to enable the template matching (TM)-based refinement tool may be determined according to the call result value of useTM(). useBM() may mean a function that determines whether to enable a decoder-side motion information refinement process based on template matching (TM) based on the syntax element Template_matching_based_refinement_enabled_flag described above with reference to Table 2 or through a separate derivation process. For example, when the call result value of useBM() is true, the decoder-side motion information refinement process based on template matching (TM) may be enabled. Conversely, when the call result value of useBM() is false, the decoder-side motion information refinement process based on template matching (TM) may be disabled.

[0216] In addition, whether to enable the bilateral matching (BM) based refinement tool can be determined based on the call result value of useBM(). useBM() may mean a function that determines whether to enable the decoder-side motion information refinement process based on bilateral matching (BM) based on the syntax element bilateral_matching_based_refinement_enabled_flag described above with reference to Table 2 or through a separate derivation process. For example, if the call result value of useBM() is true, the decoder-side motion information refinement process based on bilateral matching (BM) can be enabled. On the contrary, if the call result value of useBM() is false, the decoder-side motion information refinement process based on bilateral matching (BM) can be disabled.

[0217] If at least one of the template matching (TM) based refinement tool or the bilateral matching (BM) based refinement tool is enabled (e.g., (useTM()||useBM()) = true) ("Yes" of S1220), the image decoding device 200 can determine whether the bilateral matching (BM) based refinement tool (e.g., useBM()) is enabled (S1230).

[0218] As a result of the determination, if the bilateral matching (BM) based refinement tool is enabled (e.g., useBM() = true) ("Yes" in S1230), the image decoding device 200 can determine whether the POC difference between the reference picture and the current picture in the merge mode (i.e., abs(curPoc-pocMerge)) (hereinafter referred to as the "first POC difference") is equal to the POC difference between the reference picture and the current picture in the AMVP mode (i.e., abs(curPoc-pocAmvp)) (hereinafter referred to as the "second POC difference") (S1240).

[0219] If the first POC difference is equal to the second POC difference (Yes of S1240 ), the image decoding apparatus 200 may refine the motion information of the current block derived through the amvpMerge mode based on bilateral matching (BM) ( S1250 ).

[0220] Conversely, if the bilateral matching (BM) based refinement tool is disabled ('No' of S1230) or the first POC difference is different from the second POC difference ('No' of S1240), the image decoding device 200 may determine whether the template matching (TM) based refinement tool is enabled (e.g., useTM()) (S1260).

[0221] As a result of the determination, if the template matching (TM) based refinement tool is enabled (eg, useTM() = true) ('Yes' of S1260), the image decoding apparatus 200 may refine the motion information of the current block derived through the amvpMerge mode based on template matching (TM) (S1270).

[0222] On the contrary, if the template matching (TM) based refinement tool is disabled (e.g., useTM() = false) ('No' in S1260), the image decoding device 200 may determine not to perform the motion information refinement process and may use the motion information derived in step S1210 to generate a prediction block for the current block.

[0223] At the same time, despite Fig.12 The case of amvpMerge mode is illustrated, but this is only an example, and the embodiments of the present disclosure are not limited thereto. For example, it goes without saying that Fig.12 The motion information refinement process can also be applied to the general merging mode.

[0224] According to the embodiments of the present disclosure, the refinement tool based on template matching (TM) and the refinement tool based on bilateral matching (BM) can be controlled individually. Therefore, tool dependency can be eliminated, the signaling overhead of related information can be reduced, and the encoding / decoding efficiency can be further improved.

[0225] In the following, reference is made to Fig.13 and Fig.14 , an image encoding / decoding method according to an embodiment of the present disclosure will be described in detail.

[0226] Fig.13 is a flowchart illustrating an image encoding method according to an embodiment of the present disclosure. Fig.13 The image encoding method can be Figure 2 The image encoding device is executed.

[0227] Reference Fig.13 , if the prediction mode of the current block is an inter-frame prediction mode (e.g., merge, AMVP, amvpMerge, etc.), the image encoding device can derive motion information of the current block (S1310) and generate a prediction block of the current block based on the motion information (S1320).

[0228] In one embodiment, information on decoder-side refinement of motion information may be encoded in a bitstream. The information on decoder-side refinement may include flag information indicating whether a predetermined refinement tool is enabled.

[0229] In one embodiment, the refinement tools may include template matching-based tools and bilateral matching-based tools. In addition, whether to enable the bilateral matching-based tools may be determined independently of whether to enable the template matching-based tools.

[0230] In one embodiment, the flag information may include first flag information indicating whether a template matching-based tool is enabled and second flag information indicating whether a bilateral matching-based tool is enabled. In this case, the second flag information may be encoded regardless of the value of the first flag information. In addition, the first flag information and the second flag information may be encoded at a sequence level (e.g., SPS), a picture level (e.g., PPS, PH), a slice level (e.g., SH), or a video level (e.g., VPS).

[0231] In one embodiment, decoder-side refinement may be performed based on bilateral matching based tools when bilateral matching based tools are enabled and a picture order count (POC) difference between a current picture including the current block and a reference picture of the current block is the same for all prediction directions of the current block.

[0232] In one embodiment, when a bilateral matching based tool is enabled and a picture order count (POC) difference between a current picture including a current block and a reference picture of the current block is different for a prediction direction of the current block, decoder-side refinement may be performed based on a template matching based tool being enabled.

[0233] In one embodiment, when the bilateral matching based tool is disabled and the template matching based tool is enabled, the decoder-side refinement may be performed based on the template matching based tool.

[0234] The bit stream generated by the above-mentioned image encoding method may be stored in a computer-readable recording medium or transmitted to an image decoding device via a network.

[0235] Fig.14 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure. Fig.14 The image decoding method can be Figure 3 The image decoding device is executed.

[0236] Reference Fig.14 , if the prediction mode of the current block is an inter-frame prediction mode (e.g., merge, AMVP, amvpMerge, etc.), the image decoding device can derive motion information of the current block (S1410), refine the motion information based on an enabled predetermined refinement tool (S1420), and generate a prediction block of the current block based on the refined motion information (S1430).

[0237] In one embodiment, the refinement tool includes a template matching-based tool and a bilateral matching-based tool, and whether to enable the bilateral matching-based tool may be determined independently of whether to enable the template matching-based tool.

[0238] In one embodiment, whether to enable a template matching-based tool may be determined based on the first flag information, and whether to enable a bilateral matching-based tool may be determined based on the second flag information. In this case, the second flag information may be signaled regardless of the value of the first flag information. In addition, the first flag information and the second flag information may be signaled at a sequence level (e.g., SPS), a picture level (e.g., PPS, PH), a slice level (e.g., SH), or a video level (e.g., VPS).

[0239] In one embodiment, when a bilateral matching-based tool is enabled and a picture order count (POC) difference between a current picture including the current block and a reference picture of the current block is the same for all prediction directions of the current block, the motion information of the current block may be refined based on the bilateral matching-based tool.

[0240] In one embodiment, when a bilateral matching-based tool is enabled and a picture order count (POC) difference between a current picture of the current block and a reference picture of the current block is different for each prediction direction of the current block, the motion information of the current block may be refined based on a template matching-based tool based on that a template matching-based tool is enabled.

[0241] In one embodiment, when the bilateral matching based tool is disabled and the template matching based tool is enabled, the motion information of the current block may be refined based on the template matching based tool.

[0242] Although the exemplary method of the present disclosure is represented as a series of operations for the sake of clarity of description, it is not intended to limit the order of executing the steps, and the steps can be executed simultaneously or in different orders as needed. In order to implement the method according to the present disclosure, the steps described may also include other steps, may include the remaining steps except some steps, or may include other additional steps except some steps.

[0243] In the present disclosure, an image encoding device or an image decoding device that performs a predetermined operation (step) may perform an operation (step) of confirming an execution condition or situation of the corresponding operation (step). For example, if it is described that a predetermined operation is performed when a predetermined condition is met, the image encoding device or the image decoding device may perform the predetermined operation after determining whether the predetermined condition is met.

[0244] The various embodiments of the present disclosure are not a list of all possible combinations and are intended to describe representative aspects of the present disclosure, and matters described in the various embodiments may be applied independently or in combination of two or more.

[0245] Various embodiments of the present disclosure may be implemented in hardware, firmware, software or a combination thereof. In the case of implementing the present disclosure in hardware, the present disclosure may be implemented using an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a general purpose processor, a controller, a microcontroller, a microprocessor, etc.

[0246] In addition, the image decoding device and the image encoding device applied by the embodiments of the present invention can be included in a multimedia broadcast sending and receiving device, a mobile communication terminal, a home theater video device, a digital theater video device, a surveillance camera, a video chat device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a video on demand (VoD) service provider, an OTT video (over the top video) device, an Internet streaming service provider, a three-dimensional (3D) video device, a video phone video device, a medical video device, etc., and can be used to process a video signal or a data signal. For example, an OTT video device may include a game console, a Blu-ray player, an Internet access TV, a home theater system, a smart phone, a tablet PC, a digital video recorder (DVR), etc.

[0247] Fig.15 is a diagram showing a content streaming system to which an embodiment of the present disclosure can be applied.

[0248] like Fig.15 As shown, the content streaming system to which the embodiments of the present disclosure are 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.

[0249] The encoding server compresses the content input from the multimedia input device such as a smart phone, a camera, a camcorder, etc. into digital data to generate a bit stream and sends the bit stream to the streaming server. As another example, when the multimedia input device such as a smart phone, a camera, a camcorder, etc. directly generates a bit stream, the encoding server can be omitted.

[0250] A bitstream may be generated by an image encoding method or an image encoding device to which an embodiment of the present disclosure is applied, and a streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0251] The streaming server sends multimedia data to the user device based on the user's request through the network server, and the network server is used as a medium to inform the user of the service. When the user requests the required service from the network server, the network server can deliver it to the streaming server, and the streaming server can send the multimedia data to the user. In this case, the content streaming system may include a separate control server. In this case, the control server is used to control the command / response between the devices in the content streaming system.

[0252] The streaming server may receive content from a media storage device and / or an encoding server. For example, when receiving content from an 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 within a predetermined time.

[0253] Examples of user devices may include mobile phones, smart phones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smart watches, smart glasses, head-mounted displays), digital televisions, desktop computers, digital signage, etc.

[0254] Each server in the content streaming system may operate as a distributed server, in which case data received from each server may be distributed.

[0255] The scope of the present disclosure includes software or machine-executable commands (e.g., operating systems, applications, firmware, programs, etc.) for enabling operations of methods according to various embodiments to be performed on a device or computer, and non-transitory computer-readable media having such software or commands stored thereon and executable on a device or computer.

[0256] Industrial Applicability

[0257] The embodiments of the present disclosure may be used to encode or decode an image.

Claims

1. An image decoding method performed by an image decoding device, the image decoding method comprising: Derive the motion information of the current block; Refining the motion information based on an enabled predetermined refinement tool; as well as generating a prediction block of the current block based on the refined motion information, The refinement tool includes a template matching-based tool and a bilateral matching-based tool, and Whether to enable the bilateral matching-based tool is determined independently of whether to enable the template matching-based tool.

2. The image decoding method according to claim 1, in, Determine whether to enable the template matching-based tool based on the first flag information, and determine whether to enable the bilateral matching-based tool based on the second flag information, and Wherein, the second flag information is signaled regardless of the value of the first flag information.

3. The image decoding method according to claim 2, wherein: The first flag information and the second flag information are signaled at a sequence level, a picture level, a slice level or a video level.

4. The image decoding method according to claim 1, wherein: Based on whether the bilateral matching based tool is enabled and whether a picture order count (POC) difference between a current picture including the current block and a reference picture of the current block is the same for all prediction directions of the current block, the motion information of the current block is refined based on the bilateral matching based tool.

5. The image decoding method according to claim 1, wherein: Based on the bilateral matching based tool being enabled and whether a picture order count (POC) difference between a current picture including the current block and a reference picture of the current block is different for all prediction directions of the current block, based on the template matching based tool being enabled, the motion information of the current block is refined based on the template matching based tool.

6. The image decoding method according to claim 1, wherein: Based on the bilateral matching based tool being disabled and the template matching based tool being enabled, the motion information of the current block is refined based on the template matching based tool.

7. An image decoding device, the image decoding device comprising a memory and at least one processor, in, The at least one processor is configured to: Derive the motion information of the current block; Refining the motion information based on an enabled predetermined refinement tool; as well as generating a prediction block of the current block based on the refined motion information, The refinement tool includes a template matching-based tool and a bilateral matching-based tool, and Whether to enable the bilateral matching-based tool is determined independently of whether to enable the template matching-based tool.

8. An image encoding method performed by an image encoding device, the image encoding method comprising: Derive the motion information of the current block; as well as generating a prediction block of the current block based on the motion information, wherein information on decoder-side refinement of the motion information is encoded in a bitstream, and the information on the decoder-side refinement includes flag information indicating whether a predetermined refinement tool is enabled, The refinement tool includes a template matching-based tool and a bilateral matching-based tool, and Whether to enable the bilateral matching-based tool is determined independently of whether to enable the template matching-based tool.

9. The image encoding method according to claim 8, in, The flag information includes first flag information indicating whether to enable the template matching-based tool and second flag information indicating whether to enable the bilateral matching-based tool, and The second flag information is encoded regardless of the value of the first flag information.

10. The image encoding method according to claim 9, wherein: The first flag information and the second flag information are encoded at a sequence level, a picture level, a slice level or a video level.

11. The image encoding method according to claim 8, wherein: The decoder-side refinement is performed based on the bilateral matching based tool, based on the bilateral matching based tool being enabled and whether a picture order count (POC) difference between a current picture including the current block and a reference picture of the current block is the same for all prediction directions of the current block.

12. The image encoding method according to claim 8, wherein: Based on the bilateral matching based tool being enabled and whether a picture order count (POC) difference between a current picture including the current block and a reference picture of the current block is different for all prediction directions of the current block, the decoder-side refinement is performed based on the template matching based tool being enabled.

13. The image encoding method according to claim 8, wherein: Based on the bilateral matching based tool being disabled and the template matching based tool being enabled, the decoder-side refinement based on the template matching based tool is performed. 14 . A non-transitory computer-readable recording medium for storing a bit stream generated by the image encoding method according to claim 8 .

15. A method for transmitting a bit stream generated by an image encoding method, the image encoding method comprising: Derive the motion information of the current block; as well as generating a prediction block of the current block based on the motion information, wherein information on decoder-side refinement of the motion information is encoded in a bitstream, and the information on the decoder-side refinement includes flag information indicating whether a predetermined refinement tool is enabled, The refinement tool includes a template matching-based tool and a bilateral matching-based tool, and Whether to enable the bilateral matching-based tool is determined independently of whether to enable the template matching-based tool.