Image encoding / decoding method and device for executing PROF and method for transmitting bit stream
By adopting optical flow prediction refinement (PROF) technology in image encoding/decoding, differential motion vectors and gradients are derived, PROF offsets are calculated, and prediction samples are refined, the problem of low high-resolution and high-quality image encoding/decoding efficiency in the prior art is solved, and more efficient image transmission and storage are achieved.
Patent Information
- Application Number
- CN202080073335.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-09-23
- Filing Date
- 2020-08-27
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2040-08-27
AI Technical Summary
The prior art is difficult to effectively improve the encoding/decoding efficiency of high resolution and high-quality images, resulting in increased transmission and storage costs.
Optical flow prediction refinement (PROF) technology is used to derive differential motion vectors and gradients, calculate PROF offsets, and use them to refine prediction samples, thereby improving encoding/decoding efficiency.
Improve the efficiency of image encoding/decoding, reduce the amount of bits transmitted and stored, reduce costs, and achieve higher quality image transmission and storage.
Smart Images

Figure CN114586345B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to an image encoding / decoding method and apparatus and a method for transmitting a bitstream, and more particularly, to an image encoding / decoding method and apparatus for performing prediction refinement with optical flow (PROF), and a method for transmitting a bitstream generated by the image encoding method / apparatus 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] Another object of the present disclosure is to provide an image encoding / decoding method and apparatus for performing PROF shift.
[0007] Another object of the present disclosure is to provide an image encoding / decoding method and apparatus for performing PROF.
[0008] Another object of the present disclosure is to provide a method for transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure.
[0009] Another object of the present disclosure is to provide a recording medium storing a bit stream generated by the image encoding method or apparatus according to the present disclosure.
[0010] Another object of the present disclosure is to provide a 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.
[0011] The technical problems solved by the present disclosure are not limited to the above-mentioned technical problems, and other technical problems not described here will be clear to those skilled in the art through the following description.
[0012] Technical Solution
[0013] According to one aspect of the present disclosure, an image decoding method may include: deriving a prediction sample of the current block based on motion information of the current block; determining whether optical flow prediction refinement (PROF) is applied to the current block; deriving a differential motion vector for each sample position in the current block based on the PROF being applied to the current block; deriving a gradient for each sample position in the current block; deriving a PROF offset based on the differential motion vector and the gradient; and deriving a refined prediction sample for the current block based on the PROF offset.
[0014] In the image decoding method according to the present disclosure, deriving the differential motion vector may include rounding the differential motion vector, and the rounding of the differential motion vector may generate a rounded differential motion vector by right-shifting the differential motion vector by 8.
[0015] In the image decoding method according to the present disclosure, deriving the differential motion vector may include limiting the rounded differential motion vector within a predetermined range, and the predetermined range may be set based on a fixed value dmvLimit derived independently of the bit depth of the current block.
[0016] In the image decoding method according to the present disclosure, the predetermined range may be specified by a minimum value and a maximum value derived based on dmvLimit, and an absolute value of the minimum value and an absolute value of the maximum value may be set to the same value.
[0017] In the image decoding method according to the present disclosure, the minimum value may be (-dmvLimit+1), and the maximum value may be (dmvLimit-1).
[0018] In the image decoding method according to the present disclosure, dmvLimit may be (1<<5).
[0019] In the image decoding method according to the present disclosure, deriving the gradient may include right-shifting the neighboring predicted sample value at each sample position in the current block by a first shift, and the first shift may be set to a fixed value independent of the bit depth of the current block.
[0020] In the image decoding method according to the present disclosure, the first shift may be 6.
[0021] In the image decoding method according to the present disclosure, the PROF offset derived in deriving the PROF offset may be clipped within a predetermined range.
[0022] In the image decoding method according to the present disclosure, the predetermined range of the PROF offset may be clipped based on a value diLimit, and the value diLimit is derived based on a bit depth of the current block.
[0023] In the image decoding method according to the present disclosure, the predetermined range of the clipping PROF offset may be [-dILimit,dILimit-1].
[0024] In the image decoding method according to the present disclosure, dILimit may be (1< <max(13,Bitdepth+1))。
[0025] 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 include: deriving a prediction sample of the current block based on motion information of the current block; determining whether optical flow prediction refinement (PROF) is applied to the current block; deriving a differential motion vector of each sample position in the current block based on the PROF being applied to the current block; deriving a gradient of each sample position in the current block; deriving a PROF offset based on the differential motion vector and the gradient; and deriving a refined prediction sample of the current block based on the PROF offset.
[0026] According to another aspect of the present disclosure, an image encoding method may include: deriving a prediction sample of the current block based on motion information of the current block; determining whether optical flow prediction refinement (PROF) is applied to the current block; deriving a differential motion vector for each sample position in the current block based on the PROF being applied to the current block; deriving a gradient for each sample position in the current block; deriving a PROF offset based on the differential motion vector and the gradient; and deriving a refined prediction sample of the current block based on the PROF offset.
[0027] In addition, a computer-readable recording medium according to another aspect of the present disclosure may store a bit stream generated by the image encoding device or the image encoding method of the present disclosure.
[0028] 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.
[0029] Beneficial Effects
[0030] According to the present disclosure, an image encoding / decoding method and apparatus with improved encoding / decoding efficiency can be provided.
[0031] Furthermore, according to the present disclosure, an image encoding / decoding method and apparatus for deriving a PROF offset may be provided.
[0032] Furthermore, according to the present disclosure, an image encoding / decoding method and apparatus for performing PROF may be provided.
[0033] Furthermore, according to the present disclosure, it is possible to provide a method of transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure.
[0034] Furthermore, according to the present disclosure, it is possible to provide a recording medium storing a bit stream generated by the image encoding method or apparatus according to the present disclosure.
[0035] Furthermore, according to the present disclosure, it is possible to provide a recording medium that stores a bit stream received and decoded by the image decoding device according to the present disclosure and used to reconstruct an image.
[0036] 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
[0037] Figure 1 is a view schematically illustrating a video encoding system to which an embodiment of the present disclosure is applicable.
[0038] Figure 2 is a view schematically illustrating an image encoding device to which an embodiment of the present disclosure is applicable.
[0039] Figure 3 is a view schematically illustrating an image decoding device to which an embodiment of the present disclosure is applicable.
[0040] Figure 4 is a flowchart illustrating a video / image encoding method based on inter-frame prediction.
[0041] Figure 5 is a view illustrating a configuration of the inter prediction unit 180 according to the present disclosure.
[0042] Figure 6 is a flowchart illustrating a video / image decoding method based on inter-frame prediction.
[0043] Figure 7 is a view illustrating a configuration of the inter prediction unit 260 according to the present disclosure.
[0044] Figure 8 is a view illustrating neighboring blocks that may be used as spatial merging candidates.
[0045] Fig. 9 is a view schematically illustrating a merge candidate list construction method according to an example of the present disclosure.
[0046] Fig.10 is a diagram illustrating candidate pairs for redundancy checking performed on spatial candidates.
[0047] Fig.11is a view illustrating a method of scaling a motion vector of a temporal candidate.
[0048] Fig.12 is a view illustrating the position of deriving time candidates.
[0049] Fig.13 is a view schematically illustrating a motion vector predictor candidate list configuration method according to an example of the present disclosure.
[0050] Fig.14 is a view illustrating a parametric model of an affine pattern.
[0051] Fig.15 is a view illustrating a method of generating an affine merge candidate list.
[0052] Fig.16 is a view illustrating CPMV derived from neighboring blocks.
[0053] Fig.17 is a diagram illustrating neighboring blocks used to derive and construct affine merge candidates.
[0054] Fig.18 is a view illustrating a method of generating an affine MVP candidate list.
[0055] Fig.19 is a view illustrating neighboring blocks of a sub-block based TMVP mode.
[0056] Fig. 20 is a view illustrating a method of deriving a motion vector field according to a sub-block based TMVP mode.
[0057] Fig.21 is a diagram illustrating a CU extended to perform BDOF.
[0058] Fig. 22 is a view illustrating the relationship between Δv(i,j), v(i,j), and a sub-block motion vector.
[0059] Fig.23 is a view illustrating a process of deriving a prediction sample of a current block by applying PROF.
[0060] Fig.24 is a view illustrating an example of a PROF process according to the present disclosure.
[0061] Fig.25 is a view illustrating a refinement PROF process according to an embodiment of the present disclosure.
[0062] Fig.26 is a view illustrating a refined diffMv derivation process according to an embodiment of the present disclosure.
[0063] Fig. 27 is a view illustrating a refinement PROF process according to another embodiment of the present disclosure.
[0064] Fig.28 is a view illustrating a refinement PROF process according to another embodiment of the present disclosure.
[0065] Fig.29 is a view illustrating a refinement PROF process according to another embodiment of the present disclosure.
[0066] Fig.30 is a view illustrating a refined diffMv derivation process according to another embodiment of the present disclosure.
[0067] Fig.31 is a view illustrating a refined diffMv derivation process according to another embodiment of the present disclosure.
[0068] Fig.32 is a view illustrating a refined diffMv derivation process according to another embodiment of the present disclosure.
[0069] Fig.33 is a diagram illustrating a refined PROF process of performing a clipped PROF offset according to the present disclosure.
[0070] Fig.34 is a diagram showing a content streaming system to which an embodiment of the present disclosure is applicable. DETAILED DESCRIPTION
[0071] 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 can be implemented in various forms and is not limited to the embodiments described herein.
[0072] 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.
[0073] 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.
[0074] In the present disclosure, the terms first, second, etc. are 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.
[0075] 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 specifically stated, embodiments in which these components are integrated or distributed are also included in the scope of the present disclosure.
[0076] In the present disclosure, the components described in the various embodiments are not necessarily essential components, and some components may be optional components. Therefore, the embodiments consisting of the subset of the components described in the embodiments are also included in the scope of the present disclosure. In addition, the embodiments that also include other components in addition to the components described in the various embodiments are included in the scope of the present disclosure.
[0077] 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.
[0078] 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 that constitutes 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).
[0079] 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.
[0080] 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. 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.
[0081] 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".
[0082] In the present disclosure, the term " / " or "," may be interpreted as indicating "and / or". For example, "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".
[0083] In the present disclosure, the term "or" should be interpreted to indicate "and / or". For example, the expression "A or B" may include 1) only "A", 2) only "B", or 3) both "A and B". In other words, in the present disclosure, "or" should be interpreted to indicate "additionally or alternatively".
[0084] Overview of Video Coding Systems
[0085] Figure 1 is a diagram schematically illustrating a video encoding system according to the present disclosure.
[0086] 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.
[0087] The encoding device 10 according to the embodiment may include a video source generator 11, an encoding unit 12, and a transmitter 13. The decoding device 20 according to the embodiment may include a receiver 21, a decoding unit 22, and a renderer 23. The encoding unit 12 may be called a video / image encoding unit, and the decoding unit 22 may be called a video / image decoding unit. 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.
[0088] The video source generator 11 can obtain the video / image by capturing, synthesizing or generating the video / image process. 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 (electronically) generate the video / image. 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 for generating relevant data.
[0089] 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 encoded data (encoded video / image information) in the form of a bitstream.
[0090] The transmitter 13 may transmit the encoded video / image information or data output in the form of a bit stream to the receiver 21 of the decoding device 20 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 transmission through a broadcast / communication network. The receiver 21 may extract / receive a bit stream from a storage medium or a network and transmit the bit stream to the decoding unit 22.
[0091] 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.
[0092] The renderer 23 may render the decoded video / image. The rendered video / image may be displayed through a display.
[0093] Overview of image encoding apparatus
[0094] Figure 2 is a diagram schematically showing an image encoding device to which an embodiment of the present disclosure is applicable.
[0095] like Figure 2As 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.
[0096] 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.
[0097] 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 then the binary tree structure and / or the ternary tree structure may be applied. 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 a transform coefficient.
[0098] 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 transmit 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.
[0099] The intra prediction unit 185 can predict the current block by referring to the samples in the current picture. Depending on the intra prediction mode and / or the 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.
[0100] The inter prediction unit 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 transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples 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 prediction direction (L0 prediction, L1 prediction, dual 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, the residual signal may not be transmitted. 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.
[0101] The prediction unit can generate a prediction signal based on the various prediction methods and prediction techniques described below. For example, the prediction unit can apply not only intra prediction or inter prediction, but also intra prediction and inter prediction at the same time to predict the current block. The prediction method that simultaneously applies both intra prediction and inter prediction to predict the current block can be called combined inter and intra prediction (CIIP). In addition, the prediction unit can perform intra block copy (IBC) to predict the current block. Intra block copy can be used for content image / video encoding of games, etc., for example, 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 position separated by a predetermined distance from the current block. When IBC is applied, the position of the reference block in the current picture can be encoded as a vector (block vector) corresponding to a predetermined distance.
[0102] 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 transmitted to the transformer 120.
[0103] 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 instead of square.
[0104] The quantizer 130 may quantize the transform coefficients and transmit 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 in the block form 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.
[0105] The entropy encoder 190 may perform various encoding methods, such as 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.
[0106] The bitstream may be transmitted over 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) for transmitting a signal output from the entropy encoder 190 and / or a storage unit (not shown) for storing 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.
[0107] 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.
[0108] 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 when 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.
[0109] In addition, as described below, luma mapping and chroma scaling (LMCS) is applicable to the picture coding process.
[0110] 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 transmit 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.
[0111] The modified reconstructed picture transferred 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 device 100, prediction mismatch between the image encoding device 100 and the image decoding device may be avoided and encoding efficiency may be improved.
[0112] 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 from which the motion information in the current picture is derived (or encoded) and / or the motion information of the reconstructed block in the picture. The stored motion information may be transmitted 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.
[0113] Overview of image decoding device
[0114] Figure 3 is a diagram schematically showing an image decoding device to which an embodiment of the present disclosure is applicable.
[0115] 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 prediction unit 260, and an intra-frame prediction unit 265. The inter-frame prediction unit 260 and the intra-frame prediction unit 265 may be collectively referred to as a "prediction unit". The dequantizer 220 and the inverse transformer 230 may be included in a residual processor.
[0116] According to an embodiment, all or at least some of the plurality of components configuring the image decoding apparatus 200 may be configured by hardware components (eg, a decoder or a processor). In addition, the memory 250 may include a decoded picture buffer (DPB) or may be configured by a digital storage medium.
[0117] The image decoding apparatus 200 having received a bit stream including video / image information may perform the same operation as that performed by Figure 2 The image is reconstructed by processing corresponding to the processing performed by the image encoding device 100. For example, the image decoding device 200 can perform decoding using a processing unit applied in the image encoding device. Therefore, the processing unit of decoding can be, for example, a coding unit. The coding unit can be obtained by splitting the coding tree unit or the maximum coding unit. The reconstructed image signal decoded and output by the image decoding device 200 can be reproduced by a reproduction device (not shown).
[0118] The image decoding apparatus 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 the prediction in the information decoded by the entropy decoder 210 can be provided to the prediction unit (inter-frame prediction unit 260 and intra-frame prediction unit 265), and the residual value of the entropy decoding performed on it in the entropy decoder 210, that is, the quantized transform coefficient and the related parameter information can be input to the dequantizer 220. In addition, the information about filtering in 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 device may be further configured as an internal / external element of the image decoding device 200 , or the receiver may be a component of the entropy decoder 210 .
[0119] 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, at least one of an inter-frame prediction unit 160 or an intra-frame prediction unit 265.
[0120] 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.
[0121] The inverse transformer 230 may inversely transform the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0122] 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).
[0123] 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) described later.
[0124] The intra prediction unit 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 prediction unit 265.
[0125] The inter prediction unit 260 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 transmitted 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, dual 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. For example, the inter prediction unit 260 may configure a motion information candidate list based on the neighboring blocks, and derive a motion vector and / or a reference picture index of the current block based on the received candidate selection information. Inter prediction may be performed based on various prediction modes, and information about the prediction may include information indicating an inter prediction mode of the current block.
[0126] The adder 235 can generate a reconstructed 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 prediction unit 260 and / or the intra-prediction unit 265). The description of the adder 155 is also applicable to the adder 235.
[0127] In addition, as described below, luma mapping and chroma scaling (LMCS) is applied to the picture decoding process.
[0128] 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.
[0129] The (modified) reconstructed picture stored in the DPB of the memory 250 may be used as a reference picture in the inter prediction unit 260. The memory 250 may store the motion information of the block from which the motion information in the current picture is derived (or decoded) and / or the motion information of the reconstructed block in the picture. The stored motion information may be transmitted to the inter prediction unit 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 may store the reconstructed samples of the reconstructed block in the current picture and transmit the reconstructed samples to the intra prediction unit 265.
[0130] 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 prediction unit 260 and the intra-frame prediction unit 265 of the image decoding device 200.
[0131] Overview of Inter Prediction
[0132] The image encoding device / image decoding device may perform inter-frame prediction in units of blocks to derive prediction samples. Inter-frame prediction may mean prediction derived in a manner that depends on data elements of pictures other than the current picture. When inter-frame prediction is applied to the current block, a prediction block of the current block may be derived based on a reference block specified by a motion vector on a reference picture.
[0133] In this case, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information of the current block can be derived based on the correlation of the motion information between the neighboring blocks and the current block, and the motion information can be derived in units of blocks, sub-blocks or samples. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction type information. Here, the inter-frame prediction type information may mean the direction information of the inter-frame prediction. The inter-frame prediction type information may indicate that the current block is predicted using one of L0 prediction, L1 prediction or dual prediction.
[0134] When inter prediction is applied to the current block, the neighboring blocks of the current block 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 of the current 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), and the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic).
[0135] Furthermore, a motion information candidate list may be constructed based on neighboring blocks of the current block, and in this case, a flag or index information indicating which candidate to use in order to derive a motion vector and / or a reference picture index of the current block may be signaled.
[0136] According to the inter prediction type, the motion information may include L0 motion information and / or L1 motion information. A motion vector in the L0 direction may be defined as an L0 motion vector or MVL0, and a motion vector in the L1 direction may be defined as an L1 motion vector or MVL1. Prediction based on the L0 motion vector may be defined as L0 prediction, prediction based on the L1 motion vector may be defined as L1 prediction, and prediction based on both the L0 motion vector and the L1 motion vector may be defined as dual prediction. Here, the L0 motion vector may mean a motion vector associated with the reference picture list L0, and the L1 motion vector may mean a motion vector associated with the reference picture list L1.
[0137] The reference picture list L0 may include pictures before the current picture in the output order as reference pictures, and the reference picture list L1 may include pictures after the current picture in the output order. The previous picture may be defined as a forward (reference) picture, and the subsequent picture may be defined as a backward (reference) picture. In addition, the reference picture list L0 may also include pictures after the current picture in the output order as reference pictures. In this case, in the reference picture list L0, the previous picture may be indexed first, and then the subsequent picture may be indexed. The reference picture list L1 may also include pictures before the current picture in the output order as reference pictures. In this case, in the reference picture list L1, the subsequent picture may be indexed first, and then the previous picture may be indexed. Here, the output order may correspond to a picture order count (POC) order.
[0138] Figure 4 is a flowchart illustrating a video / image encoding method based on inter-frame prediction.
[0139] Figure 5 is a view illustrating a configuration of the inter predictor 180 according to the present disclosure.
[0140] Figure 6 The encoding method can be Figure 2 The image encoding device of the present invention may be performed by the image encoding device. Specifically, step S410 may be performed by the inter-frame predictor 180, and step S420 may be performed by the residual processor. Specifically, step S420 may be performed by the subtractor 115. Step S430 may be performed by the entropy encoder 190. The prediction information of step S630 may be derived by the inter-frame predictor 180, and the residual information of step S630 may be derived by the residual processor. The residual information is information about the residual sample. The residual information may include information about the quantized transform coefficient for the residual sample. As described above, the residual sample may be derived as a transform coefficient by the transformer 120 of the image encoding device, and the transform coefficient may be derived as a quantized transform coefficient by the quantizer 130. The information about the quantized transform coefficient may be encoded by the entropy encoder 190 through the residual encoding process.
[0141] The image encoding device may perform inter-frame prediction for the current block (S410). The image encoding device may derive the inter-frame prediction mode and motion information of the current block and generate a prediction sample of the current block. Here, the inter-frame prediction mode determination, motion information derivation, and prediction sample generation processes may be performed simultaneously or any one of them may be performed before the other processes. For example, Figure 5 As shown, the inter prediction unit 180 of the image encoding device 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 the prediction mode of the current block, the motion information derivation unit 182 may derive the motion information of the current block, and 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 may search for a block similar to the current block in a predetermined area (search area) of the reference picture through motion estimation, and derive a reference block whose difference with the current block is equal to or less than a predetermined criterion or a minimum value. Based on this, a reference picture index indicating the reference picture in which the reference block is located may be derived, and a motion vector may be derived based on the position difference between the reference block and the current block. The image encoding device may determine a mode applied to the current block among various inter prediction modes. The image encoding device may compare rate-distortion (RD) costs for various prediction modes, and determine the best inter prediction mode for the current block. However, the method of determining the inter prediction mode of the current block by the image encoding device is not limited to the above example, and various methods may be used.
[0142] For example, the inter prediction mode of the current block may be determined as at least one of a merge mode, a merge skip mode, a motion vector prediction (MVP) mode, a symmetric motion vector difference (SMVD) mode, an affine mode, a sub-block based merge mode, an adaptive motion vector resolution (AMVR) mode, a history-based motion vector predictor (HMVP) mode, a pairwise average merge mode, a merge mode with motion vector difference (MMVD) mode, a decoder-side motion vector refinement (DMVR) mode, a combined inter- and intra-prediction (CIIP) mode, or a geometric partitioning mode (GPM).
[0143] For example, when the skip mode or merge mode is applied to the current block, the image encoding device may derive a merge candidate from a neighboring block of the current block, and use the derived merge candidate to construct a merge candidate list. In addition, the image encoding device may derive a reference block whose difference with the current block is equal to or less than a predetermined criterion or a minimum value from 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 image decoding device. The motion information of the selected merge candidate may be used to derive the motion information of the current block.
[0144] As another example, when the MVP mode is applied to the current block, the image encoding device may derive a motion vector predictor (MVP) candidate from a neighboring block of the current block, and construct an MVP candidate list using the derived MVP candidate. In addition, the image encoding device may use the motion vector of the MVP candidate selected from among the MVP candidates included in the MVP candidate list as the MVP of the current block. In this case, for example, the motion vector indicating the reference block derived by the above-mentioned motion estimation may be used as the motion vector of the current block, and the MVP candidate having the smallest motion vector difference with the motion vector of the current block among the MVP candidates 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, index information indicating the selected MVP candidate and information about the MVD may be signaled to the image decoding device. In addition, when the MVP mode is applied, the value of the reference picture index may be constructed as reference picture index information and separately signaled to the image decoding device.
[0145] The image encoding device may derive residual samples based on the predicted samples (S420). The image encoding device may derive residual samples by comparing the original samples of the current block with the predicted samples. For example, the residual samples may be derived by subtracting the corresponding predicted samples from the original samples.
[0146] The image encoding device may encode the image information including the prediction information and the residual information (S430). The image encoding device may output the encoded image information in the form of a bitstream. The prediction information may include prediction mode information (e.g., a skip flag, a merge flag, or a mode index, etc.) and information about motion information as information related to the prediction process. Among the prediction mode information, the skip flag indicates whether the skip mode is applied to the current block, and the merge flag indicates whether the merge mode is applied to the current block. Alternatively, the prediction mode information may indicate one of a plurality of prediction modes, such as a mode index. When the skip flag and the merge flag are 0, it can be determined that the MVP mode is applied to the current block. 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. Among the candidate selection information, the merge index may be signaled when the merge mode is applied to the current block, and may be information for selecting one of the merge candidates included in the merge candidate list. Among the candidate selection information, the MVP flag or the MVP index may be signaled when the MVP mode is applied to the current block, and may be information for selecting one of the MVP candidates in the MVP candidate list. Specifically, the MVP flag may be signaled using a syntax element mvp_10_flag or mvp_11_flag. In addition, the information about the motion information may include information about the above-mentioned MVD and / or reference picture index information. In addition, the information about the motion information may include information indicating whether L0 prediction, L1 prediction, or bi-prediction is applied. The residual information is information about the residual sample. The residual information may include information about the quantized transform coefficients used for the residual sample.
[0147] The output bit stream may be stored in a (digital) storage medium and transmitted to the image decoding device or may be transmitted to the image decoding device via a network.
[0148] As described above, the image encoding device can generate a reconstructed picture (a picture including reconstructed samples and reconstructed blocks) based on the reference samples and the residual samples. This is for the image encoding device to derive the same prediction result as the prediction result performed by the image decoding device, thereby improving the coding efficiency. Therefore, the image encoding device can store the reconstructed picture (or reconstructed samples and reconstructed blocks) in a memory and use it as a reference picture for inter-frame prediction. As described above, the in-loop filtering process is also applicable to the reconstructed picture.
[0149] Figure 6 is a flowchart illustrating a video / image decoding method based on inter-frame prediction.
[0150] Figure 7 is a view illustrating a configuration of the inter prediction unit 260 according to the present disclosure.
[0151] The image decoding device may perform an operation corresponding to the operation performed by the image encoding device. The image decoding device may perform prediction on the current block based on the received prediction information and derive a prediction sample.
[0152] Figure 6 The decoding method can be obtained by Figure 3 The image decoding device of the present invention is performed. Steps S610 to S630 may be performed by the inter-prediction unit 260, and the prediction information of step S610 and the residual information of step S640 may be obtained from the bitstream by the entropy decoder 210. The residual processor of the image decoding device may derive the residual samples of the current block based on the residual information (S640). Specifically, the dequantizer 220 of the residual processor may perform dequantization based on the quantized transform coefficient derived according to the residual information to derive the transform coefficient, and the inverse transformer 230 of the residual processor may perform inverse transform on the transform coefficient to derive the residual sample of the current block. Step S650 may be performed by the adder 235 or the reconstructor.
[0153] Specifically, the image decoding apparatus may determine a prediction mode of the current block based on the received prediction information (S610). The image decoding apparatus may determine which inter prediction mode is applied to the current block based on prediction mode information in the prediction information.
[0154] For example, it may be determined whether the skip mode is applied to the current block based on a skip flag. In addition, it may be determined whether the merge mode or the MVP mode is applied to the current block based on a merge flag. Alternatively, one of various inter-frame prediction mode candidates may be selected based on a mode index. The inter-frame prediction mode candidate may include a skip mode, a merge mode, and / or an MVP mode or may include various inter-frame prediction modes to be described below.
[0155] The image decoding device may derive motion information of the current block based on the determined inter prediction mode (S620). For example, when the skip mode or merge mode is applied to the current block, the image decoding device may construct a merge candidate list to be described below, and select one of the merge candidates included in the merge candidate list. The selection may be performed based on the above-mentioned candidate selection information (merge index). The motion information of the current block may be derived using the motion information of the selected merge candidate. For example, the motion information of the selected merge candidate may be used as the motion information of the current block.
[0156] As another example, when the MVP mode is applied to the current block, the image decoding device may construct an MVP candidate list, and use the motion vector of the MVP candidate selected from the MVP candidates included in the MVP candidate list as the MVP of the current block. The selection may be performed based on the above-mentioned candidate 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 of the current block may be derived as a reference picture referenced for inter-frame prediction of the current block.
[0157] The image decoding device may generate a prediction sample of the current block based on the motion information of the current block (S630). 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 by a motion vector of the current block on the reference picture may be used to derive the prediction sample of the current block. In some cases, a prediction sample filtering process may also be performed for all or some of the prediction samples of the current block.
[0158] For example, Figure 7 As shown, the inter-frame prediction unit 260 of the image decoding device may include a prediction mode determination unit 261, a motion information derivation unit 262, and a prediction sample derivation unit 263. In the inter-frame prediction unit 260 of the image decoding device, the prediction mode determination unit 261 may determine the prediction mode of the current block based on the received prediction mode information, the motion information derivation unit 262 may derive the motion information (motion vector and / or reference picture index, etc.) of the current block based on the received motion information, and the prediction sample derivation unit 263 may derive the prediction sample of the current block.
[0159] The image decoding device may generate residual samples of the current block based on the received residual information (S640). The image decoding device may generate reconstructed samples of the current block based on the predicted samples and the residual samples and generate a reconstructed picture based thereon (S650). Thereafter, the in-loop filtering process is applied to the reconstructed picture as described above.
[0160] As described above, the inter-frame prediction process may include a step of determining an inter-frame prediction mode, a step of deriving motion information according to the determined prediction mode, and a step of performing prediction (generating prediction samples) based on the derived motion information. As described above, the inter-frame prediction process may be performed by an image encoding device and an image decoding device.
[0161] Hereinafter, the steps of deriving motion information according to the prediction mode will be described in more detail.
[0162] As described above, inter-frame prediction can be performed using the motion information of the current block. The image encoding device can derive the best motion information of the current block through a motion estimation process. For example, the image encoding device can use the original block in the original picture of the current block in fractional pixel units to search for a similar reference block with high correlation within a predetermined search range in the reference picture, and use it to derive motion information. The similarity of the blocks can be calculated based on the sum of absolute differences (SAD) between the current block and the reference block. In this case, the motion information can be derived based on the reference block with the smallest SAD in the search area. The derived motion information can be notified to the image decoding device with a signal according to various methods based on the inter-frame prediction mode.
[0163] When the merge mode is applied to the current block, the motion information of the current block is not directly sent, and the motion information of the neighboring blocks is used to derive the motion information of the current block. Therefore, the motion information of the current prediction block can be indicated by sending flag information indicating that the merge mode is used and candidate selection information (e.g., merge index) indicating which neighboring block is used as a merge candidate. In the present disclosure, since the current block is a prediction execution unit, the current block can be used as the same meaning as the current prediction block, and the neighboring block can be used as the same meaning as the neighboring prediction block.
[0164] The image encoding device may search for a merge candidate block for deriving motion information of the current block to perform a merge mode. For example, up to five merge candidate blocks may be used, but not limited thereto. The maximum number of merge candidate blocks may be sent in a slice header or a tile group header, but not limited thereto. After finding the merge candidate block, the image encoding device may generate a merge candidate list and select the merge candidate block with the minimum RD cost as the final merge candidate block.
[0165] The present disclosure provides various embodiments for configuring a merge candidate block of a merge candidate list. The merge candidate list may use, for example, five merge candidate blocks. For example, four spatial merge candidates and one temporal merge candidate may be used.
[0166] Figure 8 is a view illustrating neighboring blocks that may be used as spatial merging candidates.
[0167] Fig. 9 is a view schematically illustrating a method for constructing a merge candidate list according to an example of the present disclosure.
[0168] The image encoding / decoding apparatus may insert a spatial merge candidate derived by searching for spatial neighboring blocks of the current block into the merge candidate list (S910). Figure 8As shown, the spatial neighboring blocks may include a lower left neighboring block A0, a left neighboring block A1, an upper right neighboring block B0, an upper neighboring block B1, and an upper left neighboring block B2 of the current block. However, this is an example, and in addition to the above-mentioned spatial neighboring blocks, additional neighboring blocks such as a right neighboring block, a lower neighboring block, and a lower right neighboring block may be further used as spatial neighboring blocks. The image encoding / decoding device may detect available blocks by searching the spatial neighboring blocks based on priority, and derive motion information of the detected blocks as spatial merging candidates. For example, the image encoding / decoding device may detect available blocks by searching in the order of A1, B1, B0, A0, and B2. Figure 8 The five blocks shown are indexed in turn to build a merge candidate list.
[0169] The image encoding / decoding device may insert a temporal merge candidate derived by searching for temporal neighboring blocks of the current block into a merge candidate list (S920). The temporal neighboring block may be located on a reference picture different from the current picture in which the current block is located. The reference picture in which the temporal neighboring block is located may be referred to as a collocated picture or a col picture. The temporal neighboring blocks may be searched in the order of the lower right corner neighboring block and the lower right center block of the collocated block of the current block on the col picture. In addition, when motion data compression is applied in order to reduce memory load, specific motion information may be stored as representative motion information of each predetermined storage unit of the col picture. In this case, it is not necessary to store motion information of all blocks in the predetermined storage unit, thereby obtaining a motion data compression effect. In this case, the predetermined storage unit may be predetermined to be, for example, a 16×16 sample unit or an 8×8 sample unit, or the size information of the predetermined storage unit may be notified to the image decoding device from the image encoding device with a signal. When motion data compression is applied, the motion information of the temporal neighboring block may be replaced with the representative motion information of the predetermined storage unit in which the temporal neighboring block is located. That is, in this case, from the perspective of implementation, the temporal merging candidate can be derived based on the motion information of the prediction block covering the arithmetically left-shifted position after being arithmetically right-shifted by a predetermined value based on the coordinates (upper left sample position) of the temporal neighboring block (rather than the prediction block located on the coordinates of the temporal neighboring block). For example, when the predetermined storage unit is 2 n ×2 nWhen the coordinates of the sample unit and the temporally neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the modified position ((xTnb >> n) << n), (yTnb >> n) << n)) can be used for temporal merge candidates. Specifically, for example, when the predetermined storage unit is a 16×16 sample unit and the coordinates of the temporally neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the modified position ((xTnb >> 4) << 4), (yTnb >> 4) << 4)) can be used for temporal merge candidates. Alternatively, for example, when the predetermined storage unit is an 8×8 sample unit and the coordinates of the temporally neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the modified position ((xTnb >> 3) << 3), (yTnb >> 3) << 3)) can be used for temporal merge candidates.
[0170] Referring again to Fig. 9 , the image encoding / decoding device may check whether the current number of merge candidates is less than the maximum number of merge candidates (S930). The maximum number of merge candidates may be predefined or signaled from the image encoding device to the image decoding device. For example, the image encoding device may generate and encode information about the maximum number of merge candidates and send the encoded information to the image decoding device in the form of a bitstream. When the maximum number of merge candidates is satisfied, the subsequent candidate addition process S940 may not be performed.
[0171] When, as a result of the check in step S930, the current number of merge candidates is less than the maximum number of merge candidates, the image encoding / decoding device may derive additional merge candidates according to a predetermined method and then insert the additional merge candidates into the merge candidate list (S940). For example, the additional merge candidates may include at least one of history-based merge candidates, pairwise average merge candidates, ATMVP, combined bi-prediction merge candidates (when the slice / tile group type of the current slice / tile group is of type B), and / or zero vector merge candidates.
[0172] When, as a result of the check in step S930, the current number of merge candidates is not less than the maximum number of merge candidates, the image encoding / decoding device may end the construction of the merge candidate list. In this case, the image encoding device may select the best merge candidate from among the merge candidates configuring the merge candidate list and signal candidate selection information (e.g., merge candidate index or merge index) indicating the selected merge candidate to the image decoding device. The image decoding device may select the best merge candidate based on the merge candidate list and the candidate selection information.
[0173] As described above, the motion information of the selected merge candidate may be used as the motion information of the current block, and the prediction sample of the current block may be derived based on the motion information of the current block. The image encoding device may derive the residual sample of the current block based on the prediction sample, and signal the residual information of the residual sample to the image decoding device. As described above, the image decoding device may generate a reconstructed sample based on the residual sample derived from the residual information and the prediction sample, and generate a reconstructed picture based thereon.
[0174] When the skip mode is applied to the current block, the motion information of the current block can be derived using the same method as the case where the merge mode is applied. However, when the skip mode is applied, the residual signal of the corresponding block is omitted, and thus the prediction sample can be directly used as the reconstructed sample. For example, when the value of cu_skip_flag is 1, the above skip mode can be applied.
[0175] Hereinafter, a method of deriving a spatial candidate in a merge mode and / or a skip mode will be described. The spatial candidate may refer to the above-mentioned spatial merge candidate.
[0176] The derivation of spatial candidates can be performed based on spatial neighboring blocks. For example, Figure 8 The candidate blocks at the positions shown derive up to four spatial candidates. The order of deriving spatial candidates may be A1->B1->B0->A0->B2. However, the order of deriving spatial candidates is not limited to the above order, and may be, for example, B1->A1->B0->A0->B2. When at least one of the current four positions (A1, B1, B0, and A0 in the above example) is unavailable, the last position in the order (position B2 in the above example) may be considered. In this case, the block at the unavailable predetermined position may include a corresponding block belonging to a slice or patch different from the current block or a corresponding block as an intra-prediction block. When a spatial candidate is derived from the first position in the order (A1 or B1 in the above example), a redundancy check may be performed on the spatial candidates at subsequent positions. For example, when the motion information of the subsequent spatial candidate is the same as the motion information of the spatial candidate already included in the merge candidate list, the subsequent spatial candidate may not be included in the merge candidate list, thereby improving coding efficiency. The redundancy check performed on the subsequent spatial candidate may be performed on some candidate pairs rather than all possible candidate pairs, thereby reducing computational complexity.
[0177] Fig.10 is a diagram illustrating candidate pairs for redundancy checking performed on spatial candidates.
[0178] exist Fig.10In the example shown, a redundant check on the spatial candidate at position B0 may be performed only on the spatial candidate at position A0. In addition, a redundant check on the spatial candidate at position B1 may be performed only on the spatial candidate at position B0. In addition, a redundant check on the spatial candidate at position A1 may be performed only on the spatial candidate at position A0. Finally, a redundant check on the spatial candidate at position B2 may be performed only on the spatial candidates at positions A0 and B0.
[0179] exist Fig.10 In the example shown, the order of deriving spatial candidates is A0->B0->B1->A1->B2. However, the present disclosure is not limited thereto, and even if the order of deriving spatial candidates is changed, such as Fig.10 In the example shown, redundancy checking may be performed only on some of the candidate pairs.
[0180] Hereinafter, a method of deriving a temporal candidate in the case of a merge mode and / or a skip mode will be described. The temporal candidate may represent the temporal merge candidate described above. In addition, the motion vector of the temporal candidate may correspond to the temporal candidate of the MVP mode.
[0181] In the case of a temporal candidate, only one candidate may be included in the merge candidate list. In the process of deriving a temporal candidate, the motion vector of the temporal candidate may be scaled. For example, scaling may be performed based on a collocated block (CU) (hereinafter referred to as a "col block") belonging to a collocated reference picture (colPic) (hereinafter referred to as a "col picture"). The reference picture list for deriving the col block may be explicitly signaled in the slice header.
[0182] Fig.11 is a view illustrating a method of scaling a motion vector of a temporal candidate.
[0183] exist Fig.11 In the above, curr_CU and curr_pic represent the current block and the current picture, respectively, and col_CU and col_pic represent the col block and the col picture, respectively. In addition, curr_ref represents the reference picture of the current block, and col_ref represents the reference picture of the col block. In addition, tb represents the distance between the reference picture of the current block and the current picture, and td represents the distance between the reference picture of the col block and the col picture. tb and td can represent values corresponding to the difference in POC (picture order count) between pictures. Scaling of the motion vector of the temporal candidate can be performed based on tb and td. In addition, the reference picture index of the temporal candidate can be set to 0.
[0184] Fig.12 is a view illustrating the position of deriving time candidates.
[0185] exist Fig.12In the figure, the block with thick solid line represents the current block. Fig.12 The temporal candidate is derived from the block corresponding to position C0 (lower right position) or C1 (center position). First, it can be determined whether position C0 is available, and when position C0 is available, the temporal candidate can be derived based on position C0. When position C0 is not available, the temporal candidate can be derived based on position C1. For example, when the block at position C0 in the col picture is an intra-frame prediction block or is located outside the current CTU row, it can be determined that position C0 is not available.
[0186] As described above, when motion data compression is applied, the motion vector of the col block may be stored for each predetermined unit block. In this case, in order to derive the motion vector of the block covering position C0 or position C1, position C0 or position C1 may be modified. For example, when the predetermined unit block is an 8×8 block and position C0 or position C1 is (xColCi, yColCi), the position for deriving the temporal candidate may be modified to ((xColCi>>3)<<3, (yColCi>>3)<<3).
[0187] Hereinafter, a method of deriving a history-based candidate in case of a merge mode and / or a skip mode will be described.The history-based candidate may be represented by a history-based merge candidate.
[0188] After the spatial candidates and temporal candidates are added to the merge candidate list, history-based candidates may be added to the merge candidate list. For example, the motion information of a previously encoded / decoded block may be stored in a table and used as a history-based candidate for the current block. The table may store multiple history-based candidates during the encoding / decoding process. The table may be initialized at the beginning of a new CTU row. Initializing the table may mean clearing the corresponding table by deleting all history-based candidates stored in the table. Whenever there is an inter-prediction block, the relevant motion information may be added to the table as the last entry. In this case, the inter-prediction block may not be a block based on sub-block prediction. The motion information added to the table may be used as a new history-based candidate.
[0189] The table of history-based candidates may have a predetermined size. For example, the size may be 5. In this case, the table may store up to five history-based candidates. When a new candidate is added to the table, a limited first-in, first-out (FIFO) rule of redundant checking of whether there is an identical candidate in the table may be applied. If an identical candidate already exists in the table, the identical candidate may be deleted from the table and the positions of all subsequent history-based candidates may be moved forward.
[0190] History-based candidates can be used in the process of configuring a merge candidate list. In this case, the history-based candidates most recently included in the table can be checked in sequence and located after the temporal candidates in the merge candidate list. When a history-based candidate is included in the merge candidate list, a redundant check with a spatial candidate or a temporal candidate already included in the merge candidate list can be performed. If a spatial candidate or a temporal candidate already included in the merge candidate list overlaps with a history-based candidate, the history-based candidate may not be included in the merge candidate list. The amount of computation can be reduced by simplifying the redundant check as follows.
[0191] The number of history-based candidates used to generate the merge candidate list may be set to (N<=4)?M:(8-N). In this case, N may represent the number of candidates already included in the merge candidate list, and M may represent the number of available history-based candidates included in the table. That is, when the merge candidate list includes 4 or fewer candidates, the number of history-based candidates used to generate the merge candidate list may be M, and when the merge candidate list includes 4 or fewer candidates, the number of history-based candidates used to generate the merge candidate list may be M.
[0192] When N candidates are greater than 4, the history-based candidate list used to generate the merged candidate list
[0193] The number of selections can be set to (8-N).
[0194] When the total number of available merge candidates reaches (maximum allowed number of merge candidates - 1), configuration of the merge candidate list using history-based candidates may end.
[0195] Hereinafter, a method of deriving a pairwise average candidate in case of a merge mode and / or a skip mode will be described. The pairwise average candidate may be represented by a pairwise average merge candidate or a pairwise candidate.
[0196] Paired average candidates can be generated by obtaining predefined candidate pairs from the candidates included in the merge candidate list and averaging them. The predefined candidate pairs can be {(0,1), (0,2), (1,2), (0,3), (1,3), (2,3)} and the number configuring each candidate pair can be the index of the merge candidate list. That is, the predefined candidate pair (0,1) can mean a pair of index 0 candidates and index 1 candidates of the merge candidate list, and the paired average candidate can be generated by the average of the index 0 candidate and the index 1 candidate. The derivation of the paired average candidates can be performed in the order of the predefined candidate pairs. That is, after deriving the paired average candidates of the candidate pair (0,1), the process of deriving the paired average candidates can be performed in the order of the candidate pair (0,2) and the candidate pair (1,2). The paired average candidate derivation process can be performed until the configuration of the merge candidate list is completed. For example, the paired average candidate derivation process can be performed until the number of merge candidates included in the merge candidate list reaches the maximum number of merge candidates.
[0197] Pairwise average candidates may be calculated separately for each reference picture list. When two motion vectors are available for one reference picture list (L0 list or L1 list), the average of the two motion vectors may be calculated. In this case, even if the two motion vectors indicate different reference pictures, the average of the two motion vectors may be performed. If only one motion vector is available for one reference picture list, the available motion vector may be used as the motion vector of the pairwise average candidate. If both motion vectors are unavailable for one reference picture list, it may be determined that the reference picture list is invalid.
[0198] When configuration of the merge candidate list is not completed even after the pairwise average candidate is included in the merge candidate list, a zero vector may be added to the merge candidate list until the maximum number of merge candidates is reached.
[0199] When the MVP mode is applied to the current block, the reconstructed spatial neighboring blocks (e.g., Figure 8The motion vector predictor (MVP) candidate list is generated based on the motion vector of the neighboring block (as shown) and / or the motion vector corresponding to the temporal neighboring block (or Col block). That is, the motion vector of the reconstructed spatial neighboring block and the motion vector corresponding to the temporal neighboring block can be used as the motion vector predictor candidate of the current block. When bidirectional prediction is applied, the MVP candidate list for L0 motion information derivation and the MVP candidate list for L1 motion information derivation are separately generated and used. The prediction information (or information about the prediction) of the current block may include candidate selection information (e.g., MVP flag or MVP index) indicating the best motion vector predictor candidate selected from the motion vector predictor candidates included in the MVP candidate list. In this case, the prediction unit can use the candidate selection information to select the motion vector predictor of the current block from the motion vector predictor candidates included in the MVP candidate list. The prediction unit of the image encoding device can obtain and encode the motion vector difference (MVD) between the motion vector of the current block and the motion vector predictor and output the encoded MVD in the form of a bitstream. That is, the MVD can be obtained by subtracting the motion vector predictor from the motion vector of the current block. The prediction unit of the image decoding device may obtain the motion vector difference included in the information about the prediction and derive the motion vector of the current block by adding the motion vector difference to the motion vector predictor. The prediction unit of the image decoding device may obtain or derive a reference picture index indicating the reference picture from the information about the prediction.
[0200] Fig.13 is a view schematically illustrating a method for constructing a motion vector predictor candidate list according to an example of the present disclosure.
[0201] First, the spatial candidate blocks of the current block can be searched and the available candidate blocks can be inserted into the MVP candidate list (S1010). Thereafter, it is determined whether the number of MVP candidates included in the MVP candidate list is less than 2 (S1020), and when the number of MVP candidates is 2, the construction of the MVP candidate list can be completed.
[0202] In step S1020, when the number of available spatial candidate blocks is less than 2, the temporal candidate blocks of the current block may be searched and the available candidate blocks may be inserted into the MVP candidate list (S1030). When the temporal candidate blocks are not available, a zero motion vector may be inserted into the MVP candidate list (S1040), thereby completing the construction of the MVP candidate list.
[0203] In addition, when the MVP mode is applied, the reference picture index may be explicitly signaled. In this case, the reference picture index refidxL0 for L0 prediction and the reference picture index refidxL1 for L1 prediction may be signaled separately. For example, when the MVP mode is applied and dual prediction is applied, information about refidxL0 and information about refidxL1 may be signaled.
[0204] As described above, when the MVP mode is applied, information about the MVP derived by the image encoding device may be signaled to the image decoding device. For example, the information about the MVD may include the MVD absolute value and information indicating the x and y components for the sign. In this case, when the MVD absolute value is greater than 0, whether the MVD absolute value is greater than 1 and information indicating the MVD remainder may be signaled step by step. For example, only when the value of the flag information indicating whether the MVD absolute value is greater than 0 is 1, the information indicating whether the MVD absolute value is greater than 1 may be signaled.
[0205] Overview of Affine Mode
[0206] Hereinafter, an affine mode as an example of an inter-frame prediction mode will be described in detail. In a conventional video encoding / decoding system, only one motion vector is used to express the motion information of a current block. However, in this method, there is a problem that the best motion information is expressed only in units of blocks, but the best motion information cannot be expressed in units of pixels. In order to solve this problem, an affine mode that defines the motion information of a block in units of pixels has been proposed. According to the affine mode, two to four motion vectors associated with the current block can be used to determine the motion vectors of each pixel and / or sub-block unit of the block.
[0207] Compared with the existing motion information expressed using translational motion (or displacement) of pixel values, in the affine mode, the motion information of each pixel can be expressed using at least one of translational motion, scaling, rotation, or shearing. Among them, the affine mode that uses displacement, scaling, or rotation to express the motion information of each pixel can be a similar or simplified affine mode. The affine mode in the following description can mean a similar or simplified affine mode.
[0208] The motion information in the affine mode can be expressed using two or more control point motion vectors (CPMVs). The CPMVs can be used to derive the motion vectors for a specific pixel position of the current block. In this case, the set of motion vectors for each pixel and / or sub-block of the current block can be defined as an affine motion vector field (affine MVF).
[0209] Fig.14 is a view illustrating a parametric model of an affine pattern.
[0210] When the affine mode is applied to the current block, the affine MVF can be derived using one of a 4-parameter model and a 6-parameter model. In this case, the 4-parameter model may refer to a model type using two CPMVs, and the 6-parameter model may refer to a model type using three CPMVs. Fig.14 (a) and Fig.14 (b) shows the CPMV used in the 4-parameter model and the 6-parameter model respectively.
[0211] When the position of the current block is (x, y), the motion vector according to the pixel position may be derived according to the following formula 1 or formula 2. For example, the motion vector according to the 4-parameter model may be derived according to formula 1, and the motion vector according to the 6-parameter model may be derived according to formula 2.
[0212] [Formula 1]
[0213]
[0214] [Formula 2]
[0215]
[0216] In Equations 1 and 2, mv0={mv_0x, mv_0y} may be the CPMV at the upper left corner position of the current block, v1={mv_1x, mv_1y} may be the CPMV at the upper right position of the current block, and mv2={mv_2x, mv_2y} may be the CPMV at the lower left position of the current block. In this case, W and H correspond to the width and height of the current block, respectively, and mv={mv_x, mv_y} may mean the motion vector of the pixel position {x, y}.
[0217] In the encoding / decoding process, the affine MVF can be determined in units of pixels and / or predefined sub-blocks. When the affine MVF is determined in units of pixels, the motion vector can be derived based on the individual pixel values. In addition, when the affine MVF is determined in units of sub-blocks, the motion vector of the corresponding block can be derived based on the center pixel value of the sub-block. The center pixel value may mean a virtual pixel present in the center of the sub-block or a lower right pixel among the four pixels present in the center. In addition, the center pixel value may be a specific pixel in the sub-block and may be a pixel representing the sub-block. In the present disclosure, the case of determining the affine MVF in units of 4×4 sub-blocks will be described. However, this is only for the convenience of description, and the size of the sub-block may be changed differently.
[0218] That is, when affine prediction is available, the motion model applicable to the current block may include three models, namely, a translation motion model, a 4-parameter affine motion model, and a 6-parameter affine motion model. Here, the translation motion model may represent a model used by an existing block unit motion vector, the 4-parameter affine motion model may represent a model used by two CPMVs, and the 6-parameter affine motion model may represent a model used by three CPMVs. The affine mode may be divided into detailed modes according to the motion information encoding / decoding method. For example, the affine mode may be further divided into an affine MVP mode and an affine merge mode.
[0219] When the affine merge mode is applied to the current block, the CPMV may be derived from a neighboring block of the current block encoded / decoded in the affine mode. The affine merge mode may be applied to the current block when at least one neighboring block of the current block is encoded / decoded in the affine mode. That is, when the affine merge mode is applied to the current block, the CPMV of the current block may be derived using the CPMV of the neighboring block. For example, the CPMV of the neighboring block may be determined as the CPMV of the current block, or the CPMV of the current block may be derived based on the CPMV of the neighboring block. When the CPMV of the current block is derived based on the CPMV of the neighboring block, at least one encoding parameter of the current block or the neighboring block may be used. For example, the CPMV of the neighboring block may be modified based on the size of the neighboring block and the size of the current block and used as the CPMV of the current block.
[0220] In addition, the affine merge that derives MV in units of sub-blocks may be referred to as a sub-block merge mode, which may be specified by a merge_subblock_flag having a first value (e.g., 1). In this case, the affine merge candidate list described below may be referred to as a sub-block merge candidate list. In this case, the candidate derived as the SbTMVP described below may be further included in the sub-block merge candidate list. In this case, the candidate derived as the sbTMVP may be used as a candidate of index #0 of the sub-block merge candidate list. In other words, the candidate derived as the sbTMVP may be located in front of the inherited affine candidate and the constructed affine candidate described below in the sub-block merge candidate list.
[0221] For example, an affine mode flag specifying whether affine mode is applicable to the current block may be defined, which may be signaled at at least one higher level (e.g., sequence, picture, slice, patch, patch group, tile, etc.) of the current block. For example, the affine mode flag may be named sps_affine_enabled_flag.
[0222] When the affine merge mode is applied, the affine merge candidate list may be configured to derive the CPMV of the current block. In this case, the affine merge candidate list may include at least one of an inherited affine merge candidate, a constructed affine merge candidate, or a zero merge candidate. When the neighboring blocks of the current block are encoded / decoded in affine mode, the inherited affine merge candidate may mean a candidate derived using the CPMV of the neighboring block. Constructing an affine merge candidate may mean deriving candidates for each CPMV based on the motion vectors of the neighboring blocks of each control point (CP). In addition, a zero merge candidate may mean a candidate consisting of a CPMV of size 0. In the following description, CP may mean a specific position of a block used to derive a CPMV. For example, CP may be each vertex position of a block.
[0223] Fig.15 is a view illustrating a method of generating an affine merge candidate list.
[0224] Reference Fig.15 , the affine merge candidates can be added to the affine merge candidate list in the order of inheriting the affine merge candidate (S1210), constructing the affine merge candidate (S1220), and the zero merge candidate (S1230). When the number of candidates included in the candidate list does not meet the maximum number of candidates even if all the inherited affine merge candidates and the constructed affine merge candidates are added to the affine merge candidate list, the zero merge candidate can be added. In this case, the zero merge candidate can be added until the number of candidates in the affine merge candidate list meets the maximum number of candidates.
[0225] Fig.16 is a view illustrating a control point motion vector (CPMV) derived from a neighboring block.
[0226] For example, up to two inherited affine merge candidates may be derived, each of which may be derived based on at least one of the left neighboring block and the upper neighboring block. Figure 8 Describes neighboring blocks used to derive an inherited affine merge mode. The inherited affine merge candidate derived based on the left neighboring block is derived based on at least one of A0 or A1, and the inherited affine merge candidate derived based on the upper neighboring block can be derived based on at least one of B0, B1, or B2. In this case, the scanning order of the neighboring blocks may be A0 to A1 and B0, B1, and B2, but is not limited thereto. For each of left and upper, the inherited affine merge candidate can be derived based on the first neighboring block available in the scanning order. In this case, no redundancy check may be performed between the candidates derived from the left neighboring block and the upper neighboring block.
[0227] For example, Fig.16As shown, when the left neighboring block A is encoded / decoded in affine mode, at least one of the motion vectors v2, v3, and v4 corresponding to the CP of the neighboring block A can be derived. When the neighboring block A is encoded / decoded by a 4-parameter affine model, the inherited affine merge candidate can be derived using v2 and v3. In contrast, when the neighboring block A is encoded / decoded by a 6-parameter affine model, the inherited affine merge candidate can be derived using v2, v3, and v4.
[0228] Fig.17 is a diagram illustrating neighboring blocks used to derive and construct affine merge candidates.
[0229] Constructing an affine candidate may mean a candidate having a CPMV derived using a combination of general motion information of neighboring blocks. The motion information of each CP may be derived using a spatial neighboring block or a temporal neighboring block of the current block. In the following description, CPMVk may mean a motion vector representing the kth CP. For example, referring to Fig.17 , CPMV1 may be determined as the first motion vector available among the motion vectors of B2, B3, and A2, and in this case, the scanning order may be B2, B3, and A2. CPMV2 may be determined as the first motion vector available among the motion vectors of B1 and B0, and in this case, the scanning order may be B1 and B0. CPMV3 may be determined as one of the motion vectors of A1 and A0, and in this case, the scanning order may be A1 and A0. When TMVP is applicable to the current block, CPMV4 may be determined as the motion vector of the temporally neighboring block T.
[0230] After deriving the four motion vectors of each CP, the constructed affine merge candidate can be derived based on this. The constructed affine merge candidate can be configured by including at least two motion vectors selected from the four motion vectors of each CP derived. For example, the constructed affine merge candidate can be composed of at least one of {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2} or {CPMV1, CPMV3} in this order. The constructed affine candidate consisting of three motion vectors can be a candidate for a 6-parameter affine model. In contrast, the constructed affine candidate consisting of two motion vectors can be a candidate for a 4-parameter affine model. In order to avoid the scaling process of the motion vector, when the reference picture indexes of the CPs are different from each other, the combination of the relevant CPMVs can be ignored and not used to derive the constructed affine candidate.
[0231] When the affine MVP mode is applied to the current block, the encoding / decoding device may derive two or more CPMV predictors and CPMV of the current block and derive the CPMV difference based on them. In this case, the CPMV difference may be signaled from the encoding device to the decoding device. The image decoding device may derive the CPMV predictor of the current block, reconstruct the signaled CPMV difference, and then derive the CPMV of the current block based on the CPMV predictor and the CPMV difference.
[0232] In addition, the affine MVP mode may be applied to the current block only when the affine merge mode or the sub-block based TMVP is not applied to the current block. In addition, the affine MVP mode may be expressed as an affine CP MVP mode.
[0233] When affine MVP is applied to the current block, the affine MVP candidate list can be configured to derive the CPMV of the current block. In this case, the affine MVP candidate list can include at least one of an inherited affine MVP candidate, a constructed affine MVP candidate, a translation motion affine MVP candidate, or a zero MVP candidate.
[0234] In this case, the inherited affine MVP candidate may mean a candidate derived based on the CPMV of a neighboring block when the neighboring block of the current block is encoded / decoded in affine mode. The constructed affine MVP candidate may mean a candidate derived by generating a CPMV combination based on the motion vector of the CP neighboring block. The zero MVP candidate may mean a candidate consisting of a CPMV with a value of 0. The derivation method and the characteristics of the inherited affine MVP candidate and the constructed affine MVP candidate are the same as those of the inherited affine candidate and the constructed affine candidate described above, so their description will be omitted.
[0235] When the maximum number of candidates in the affine MVP candidate list is 2, constructing affine MVP candidates, translational motion affine MVP candidates, and zero MVP candidates may be added when the current number of candidates is less than 2. Specifically, the translational motion affine MVP candidates may be derived in the following order.
[0236] For example, when the number of candidates included in the affine MVP candidate list is less than 2 and CPMV0 for constructing the affine MVP candidate is valid, CPMV0 can be used as the affine MVP candidate. That is, the affine MVP candidate whose all motion vectors of CP0, CP1, and CP2 are CPMV0 can be added to the affine MVP candidate list.
[0237] Next, when the number of candidates in the affine MVP candidate list is less than 2 and CPMV1 for constructing the affine MVP candidate is valid, CPMV1 can be used as the affine MVP candidate. That is, the affine MVP candidate whose motion vectors of CP0, CP1, and CP2 are all CPMV1 can be added to the affine MVP candidate list.
[0238] Next, when the number of candidates in the affine MVP candidate list is less than 2 and CPMV2 for constructing the affine MVP candidate is valid, CPMV2 can be used as the affine MVP candidate. That is, the affine MVP candidate whose motion vectors of CP0, CP1, and CP2 are all CPMV2 can be added to the affine MVP candidate list.
[0239] Regardless of the above conditions, when the number of candidates of the affine MVP candidate list is less than 2, a temporal motion vector predictor (TMVP) of the current block may be added to the affine MVP candidate list.
[0240] Regardless of the addition of the translation motion affine MVP candidate, when the number of candidates of the affine MVP candidate list is less than 2, a zero MVP candidate may be added to the affine MVP candidate list.
[0241] Fig.18 is a view illustrating a method of generating an affine MVP candidate list.
[0242] Reference Fig.18 , the candidates may be added to the affine MVP candidate list in the order of inheriting the affine MVP candidate (S1610), constructing the affine MVP candidate (S1620), translating the motion affine MVP candidate (S1630), and zeroing the MVP candidate (S1640). As described above, steps S1620 to S1640 may be performed depending on whether the number of candidates included in the affine MVP candidate list in each step is less than 2.
[0243] The scanning order of the inherited affine MVP candidate may be equal to the scanning order of the inherited affine merge candidate. However, in the case of the inherited affine MVP candidate, only the neighboring blocks that refer to the same reference picture as the reference picture of the current block may be considered. When the inherited affine MVP candidate is added to the affine MVP candidate list, redundancy check may not be performed.
[0244] To derive and construct affine MVP candidates, we can only consider Fig.17 The spatial neighboring blocks shown. In addition, the scanning order for constructing the affine MVP candidate can be equal to the scanning order for constructing the affine merge candidate. In addition, in order to derive the construction of the affine MVP candidate, the reference picture index of the neighboring block can be checked, and in the scanning order, the first neighboring block that is inter-coded and references the same reference picture as the reference picture of the current block can be used.
[0245] Overview of the Sub-Block-Based TMVP (SbTMVP) Mode
[0246] Hereinafter, a subblock-based TMVP mode as an example of an inter prediction mode will be described in detail. According to the subblock-based TMVP mode, a motion vector field (MVF) of a current block may be derived and a motion vector may be derived in units of subblocks.
[0247] Unlike the conventional TMVP mode performed in units of coding units, for coding units to which the sub-block based TMVP mode is applied, motion vectors may be encoded / decoded in units of sub-coding units. In addition, according to the conventional TMVP mode, temporal motion vectors may be derived from collocated blocks, but in the sub-block based TMVP mode, motion vector fields may be derived from reference blocks specified by motion vectors derived from neighboring blocks of the current block. Hereinafter, the motion vector derived from the neighboring blocks may be referred to as motion shift or representative motion vector of the current block.
[0248] Fig.19 is a view illustrating neighboring blocks of a sub-block based TMVP mode.
[0249] When the sub-block based TMVP mode is applied to the current block, the neighboring blocks used to determine the motion shift may be determined. Fig.19 The neighboring blocks for determining motion shift are scanned in the order of blocks A1, B1, B0 and A0 of the current block. As another example, the neighboring blocks for determining motion shift may be limited to specific neighboring blocks of the current block. For example, the neighboring block for determining motion shift may always be determined as block A1. When a neighboring block has a motion vector of a reference col picture, the corresponding motion vector may be determined as motion shift. The motion vector determined as motion shift may be referred to as a temporal motion vector. In addition, when the above-mentioned motion vector cannot be derived from the neighboring block, the motion shift may be set to (0,0).
[0250] Fig. 20 is a view illustrating a method of deriving a motion vector field according to a sub-block based TMVP mode.
[0251] Next, the reference block on the collocated picture specified by the motion shift can be determined. For example, the sub-block-based motion information (motion vector or reference picture index) can be obtained from the col picture by adding the motion shift to the coordinates of the current block. Fig. 20In the example shown, it is assumed that the motion shift is the motion vector of the A1 block. By applying the motion shift to the current block, the sub-blocks (col sub-blocks) corresponding to the respective sub-blocks configuring the current block in the col picture can be specified. Thereafter, using the motion information of the corresponding sub-blocks (col sub-blocks) in the col picture, the motion information of the respective sub-blocks of the current block can be derived. For example, the motion information of the corresponding sub-block can be obtained from the center position of the corresponding sub-block. In this case, the center position can be the position of the lower right sample among the four samples located at the center of the corresponding sub-block. When the motion information of a particular sub-block of the col block corresponding to the current block is not available, the motion information of the center sub-block of the col block can be determined as the motion information of the corresponding sub-block. When deriving the motion vector of the corresponding sub-block, similar to the above-mentioned TMVP process, it is possible to switch to the reference picture index and the motion vector of the current sub-block. That is, when deriving a sub-block-based motion vector, the POC of the reference picture of the reference block can be considered to perform scaling of the motion vector.
[0252] As described above, a sub-block-based TMVP candidate of the current block may be derived using a motion vector field or motion information of the current block derived based on the sub-blocks.
[0253] Hereinafter, a merge candidate list configured in subblock units is defined as a subblock-unit merge candidate list. The above-mentioned affine merge candidates and subblock-based TMVP candidates may be merged to configure a subblock-unit merge candidate list.
[0254] In addition, a sub-block-based TMVP mode flag that specifies whether the sub-block-based TMVP mode is applicable to the current block may be defined, which may be signaled at at least one level among the higher levels of the current block (e.g., sequence, picture, slice, patch, patch group, tile, etc.). For example, the sub-block-based TMVP mode flag may be named sps_sbtmvp_enabled_flag. When the sub-block-based TMVP mode is applicable to the current block, the sub-block-based TMVP candidate may be first added to the sub-block unit merge candidate list, and then the affine merge candidate may be added to the sub-block unit merge candidate list. In addition, the maximum number of candidates that may be included in the sub-block unit merge candidate list may be signaled. For example, the maximum number of candidates that may be included in the sub-block unit merge candidate list may be 5.
[0255] The size of the subblock used to derive the subblock unit merge candidate list may be signaled or preset to M×N. For example, M×N may be 8×8. Therefore, the affine mode or subblock-based TMVP mode is applicable to the current block only when the size of the current block is 8×8 or larger.
[0256] The following will describe an embodiment of the predictive execution method disclosed in the present invention. Figure 4 Step S410 or Figure 6 The following prediction execution method is performed in step S630.
[0257] A prediction block of a current block may be generated based on motion information derived according to a prediction mode. A prediction block (predicted block) may include prediction samples (prediction sample array) of a current block. When a motion vector of a current block specifies a partial sample unit, an interpolation process may be performed, and thereby, a prediction sample of a current block may be derived based on a reference sample in a partial sample unit within a reference picture. When affine inter prediction is applied to a current block, a prediction sample may be generated based on a sample / sub-block unit MV. When bi-prediction is applied, a prediction sample derived by a weighted sum or weighted average (according to a phase) of a prediction sample derived based on L0 prediction (i.e., prediction using MVL0 and a reference picture within a reference picture list L0) and a prediction sample derived based on L1 prediction (i.e., prediction using MLV1 and a reference picture within a reference picture list L1) may be used as a prediction sample of a current block. When bi-prediction is applied and a reference picture for L0 prediction and a reference picture for L1 prediction are located in different temporal directions relative to a current picture (i.e., if it corresponds to bi-prediction and bi-directional prediction), this may be referred to as true bi-prediction.
[0258] In the image decoding device, reconstructed samples and reconstructed pictures can be generated based on the derived prediction samples, and then an in-loop filtering process can be performed. In addition, in the image encoding device, residual samples can be derived based on the derived prediction samples, and encoding of image information including prediction information and residual information can be performed.
[0259] Bi-prediction with CU-level weights (BCW)
[0260] When the dual prediction is applied to the current block as described above, the prediction sample can be derived based on the weighted average. Conventionally, the dual prediction signal (i.e., the dual prediction sample) can be derived by a simple average of the L0 prediction signal (L0 prediction sample) and the L1 prediction signal (L1 prediction sample). That is, the dual prediction sample is derived by averaging the L0 prediction sample based on the L0 reference picture and MVL0 and the L1 prediction sample based on the L1 reference picture and MVL1. However, according to the present disclosure, when the dual prediction is applied, the dual prediction signal (dual prediction sample) can be derived by a weighted average of the L0 prediction signal and the L1 prediction signal as follows.
[0261] [Formula 3]
[0262] P bi-pred =((8-w)*P0+w*P1+4)>>3
[0263] In the above formula 3, P bi-predrepresents a dual prediction signal (dual prediction block) derived by weighted averaging, P0 and P1 represent L0 prediction samples (L0 prediction block) and L1 prediction samples (L1 prediction block), respectively. In addition, (8-w) and w represent weights applied to P0 and P1, respectively.
[0264] When generating a dual prediction signal by weighted averaging, five weights may be allowed. For example, the weight w may be selected from {-2, 3, 4, 5, 10}. For each dual prediction CU, the weight w may be determined by one of two methods. As the first of the two methods, when the current CU is not in merge mode (non-merged CU), the weight index may be signaled together with the motion vector difference. For example, the bitstream may include information about the weight index after the information about the motion vector difference. As the second of the two methods, when the current CU is in merge mode (merged CU), the weight index may be derived from the neighboring block based on the merge candidate index (merged index).
[0265] Generating a dual prediction signal by weighted averaging can be limited to being applied only to CUs having a size including 256 or more samples (luminance component samples). That is, dual prediction by weighted averaging can be performed only for CUs whose product of the width and height of the current block is 256 or more. In addition, the weight w can be used as one of the five weights as described above, and one of a different number of weights can be used. For example, depending on the characteristics of the current image, five weights can be used for low-latency pictures and three weights can be used for non-low-latency pictures. In this case, the three weights can be {3, 4, 5}.
[0266] By applying a fast search algorithm, the image encoding device can determine the weight index without significantly increasing complexity. In this case, the fast search algorithm can be summarized as follows. Hereinafter, unequal weights may mean that the weights applied to P0 and P1 are not equal. In addition, equal weights may mean that the weights applied to P0 and P1 may be equal.
[0267] - In the case where the AMVR mode in which the resolution of the motion vector is adaptively changed is applied together, when the current picture is a low-delay picture, unequal weights may be conditionally checked only for each of the 1-pel motion vector resolution and the 4-pel motion vector resolution.
[0268] - In the case where the affine mode is applied together and the affine mode is selected as the optimal mode of the current block, the image encoding apparatus may perform affine motion estimation (ME) for respective unequal weights.
[0269] - Unequal weights may only be checked conditionally when the two reference pictures used for bi-prediction are equal.
[0270] - When the predetermined condition is met, the unequal weight may not be checked. The predetermined picture may be based on the POC distance between the current picture and the reference picture, the quantization parameter (QP), the temporal level, etc.
[0271] The weight index of the BCW can be encoded using one context coding bin and one or more subsequent bypass coding bins. The first context coding bin specifies whether equal weights are used. When unequal weights are used, additional bins can be bypass coded and signaled. Additional bins can be signaled to specify which weights to use.
[0272] Weighted prediction (WP) is a tool for efficiently encoding images including faded images. According to weighted prediction, weighting parameters (weights and offsets) can be signaled for each reference picture included in each of the reference picture lists L0 and L1. Then, when motion compensation is performed, the weights and offsets can be applied to the corresponding reference pictures. Weighted prediction and BCW can be used for different types of images. In order to avoid interaction between weighted prediction and BCW, the BCW weight index may not be signaled for a CU using weighted prediction. In this case, the weight may be inferred to be 4. That is, equal weights may be applied.
[0273] In the case of a CU to which merge mode is applied, a weight index can be inferred from neighboring blocks based on a merge candidate index. This can be applied to both general merge mode and inherited affine merge mode.
[0274] In the case of constructing the affine merge mode, the affine motion information can be configured based on the motion information of up to three blocks. In this case, for a CU using the constructing affine merge mode, the following process can be performed to derive the BCW weight index.
[0275] (1) First, the range of BCW weight index {0, 1, 2, 3, 4} can be divided into three groups {0}, {1, 2, 3} and {4}. When the BCW weight indexes of all CPs are from the same group, the BCW weight index can be derived by the following step (2). Otherwise, the BCW weight index can be set to 2.
[0276] (2) When at least two CPs have the same BCW weight index, the same BCW weight index may be assigned as the weight index for constructing an affine merge candidate. Otherwise, the weight index for constructing an affine merge candidate may be set to 2.
[0277] Bidirectional Optical Flow (BDOF)
[0278] According to the present disclosure, BDOF can be used to refine the bi-prediction signal. BDOF is to generate prediction samples by calculating refined motion information when bi-prediction is applied to the current block (e.g., CU). Therefore, the process of calculating the refined motion information by applying BDOF can be included in the above-mentioned motion information derivation step.
[0279] For example, BDOF may be applied at a 4×4 sub-block level. That is, BDOF may be performed in units of 4×4 sub-blocks within the current block.
[0280] For example, BODF can be applied to a CU that satisfies the following conditions.
[0281] 1) The height of the CU is not 4 and the size of the CU is not 4×8
[0282] 2) CU is not in affine mode or ATMVP merge mode
[0283] 3) The CU is encoded in true bi-prediction mode, that is, one of the two reference pictures is before the current picture in time order, and the other is after the current picture in time order
[0284] In addition, BDOF may be applied only to the luma component. However, the present disclosure is not limited thereto, and BDOF may be applied to the chroma component or both the luma component and the chroma component.
[0285] The BDOF mode is based on the concept of optical flow. That is, it is assumed that the motion of the object is smooth. When BDOF is applied, for each 4×4 sub-block, the motion refinement (v x ,v y ). Motion refinement can be calculated by minimizing the difference between L0 prediction samples and L1 prediction samples. Motion refinement can be used to adjust the bi-prediction sample values within the 4×4 sub-block.
[0286] Hereinafter, the process of performing BDOF will be described in more detail.
[0287] First, the horizontal gradient of the two prediction signals can be calculated and vertical gradient In this case, k may be 0 or 1. The gradient may be calculated by directly calculating the difference between two adjacent samples as shown in Equation 4 below.
[0288] [Formula 4]
[0289]
[0290]
[0291] In the above formula 4, I (k)(i, j) represents the sample value of the coordinate (i, j) of the prediction signal in list k (k = 0, 1). (0) (i, j) can represent the sample value at position (i, j) in the L0 prediction block, I (1) (i, j) may represent a sample value at position (i, j) in the L1 prediction block.
[0292] In the above formula 4, the difference between the two samples is right-shifted by 4. However, the present disclosure is not limited thereto, and the right shift shift1 can be determined based on the bit depth of the luma component. For example, when the bit depth of the luma component is bitDepth, shift1 can be determined as max(6, bitDepth-6), or can be simply determined as a fixed value of 6. In the above formula 4, for the gradient calculation, the difference between the two samples is first calculated, and then the right shift operation is applied to the difference. However, the present disclosure is not limited thereto, and the gradient can be calculated by applying a right shift operation to the two sample values and then calculating the difference between the right-shifted values.
[0293] As described above, after the gradients are calculated, the autocorrelations and cross-correlations S1, S2, S3, S5, and S6 between the gradients may be calculated as follows.
[0294] [Formula 5]
[0295] S1=∑ (i,j)∈Ω ψ x (i, j)·ψ x (i, j), S3 = ∑ (i,j)∈Ω θ(i, j)·ψ x (i, j)
[0296]
[0297]
[0298] in
[0299]
[0300]
[0301] θ(i,j)=(I (1) (i,j)>>n b )-(I (0) (i,j)>>n b )
[0302] where Ω is a 6×6 window around the 4×4 sub-block.
[0303] The motion refinement (v) can be derived using the autocorrelation and cross-correlation between the above gradients as follows x ,vy ).
[0304] [Formula 6]
[0305]
[0306]
[0307] in th′ BIO =2 13-BD . is the floor function.
[0308] Based on the derived motion refinement and gradients, the following adjustments may be performed for each sample in the 4x4 sub-block.
[0309] [Formula 7]
[0310]
[0311] Finally, the prediction sample pred of the CU to which BDOF is applied can be calculated by adjusting the bi-prediction sample of the CU as follows: BDOF .
[0312] [Formula 8]
[0313] pred BDOF (x, y) = (I (0) (x,y)+I (1) (x, y) + b(x, y) + o offset )>>shift
[0314] In the above formula, n a 、n b and n S2 They can be 3, 6 and 12 respectively. These values can be selected so that the multiplier does not exceed 15 bits and the bit width of the intermediate parameters is maintained within 32 bits in the BDOF process.
[0315] In order to derive the gradient value, the prediction samples I in the list k (k=0, 1) that exist outside the current CU can be generated (k) (i, j). Fig.21 is a diagram illustrating a CU extended to perform BDOF.
[0316] like Fig.21 As shown, to perform BDOF, rows / columns extending around the boundaries of the CU can be used. In order to control the computational complexity of generating prediction samples outside the boundaries, the extended area ( Fig.21 The predicted samples in the white area in ) can be generated using a bilinear filter, and the CU ( Fig.21The prediction samples in the extended position (the gray area in the CU) can be generated using a normal 8-tap motion compensated interpolation filter. The sample values at the extended position can be used only for gradient calculation. When sample values and / or gradient values outside the CU boundary are needed to perform the remaining steps of the BDOF process, the nearest neighbor sample values and / or gradient values can be padded (repeated) and used.
[0317] When the width and / or height of a CU is greater than 16 luma samples, the corresponding CU may be divided into sub-blocks having a width and / or height of 16 luma samples. The boundaries of sub-blocks may be processed in the BDOF process in the same manner as the above-described CU boundaries. The maximum unit size for performing BDOF processing may be limited to 16×16.
[0318] When BCW is available for the current block, for example, when the BCW weight index specifies unequal weights, BDOF may not be applied. Similarly, when WP is available for the current block, for example, when luma_weight_lx_flag of at least one of the two reference pictures is 1, BDOF may not be applied. In this case, luma_weight_lx_flag may be information specifying the weighting factor of WP for the luminance component of lx prediction (x is 0 or 1) in the bitstream or information specifying whether WP is applied to the luminance component of lx prediction. When the CU is encoded in SMVD mode, BDOF may not be applied.
[0319] Optical flow prediction refinement (PROF)
[0320] Hereinafter, a method for refining a sub-block based affine motion compensation prediction block by applying optical flow will be described. The prediction samples generated by performing sub-block based affine motion compensation can be refined based on the difference derived from the optical flow equation. The refinement of these prediction samples may be referred to as optical flow prediction refinement (PROF) in the present disclosure. Through PROF, inter-frame prediction at pixel level granularity can be achieved without increasing the bandwidth of memory access.
[0321] The parameters of the affine motion model can be used to derive motion vectors for each pixel in the CU. However, since pixel-based affine motion compensation prediction results in high complexity and an increase in memory access bandwidth, sub-block-based affine motion compensation prediction can be performed. When performing sub-block-based affine motion compensation prediction, the CU can be divided into 4×4 sub-blocks, and motion vectors can be determined for each sub-block. In this case, the motion vectors of each sub-block can be derived from the CPMV of the CU. Sub-block-based affine motion compensation has a trade-off relationship between coding efficiency and complexity and memory access bandwidth. Since motion vectors are derived in sub-block units, complexity and memory access bandwidth are reduced, but prediction accuracy is reduced.
[0322] Therefore, motion compensation of refined granularity can be achieved through refinement by applying optical flow to sub-block based affine motion compensation prediction.
[0323] As described above, the luma prediction samples can be refined by adding the difference derived from the optical flow equation after performing sub-block based affine motion compensation. More specifically, PROF can be performed in the following four steps.
[0324] Step 1) Generate a predicted sub-block I(i, j) by performing sub-block based affine motion compensation.
[0325] Step 2) Calculate the spatial gradient g of the prediction sub-block at each sample position x (i, j) and g y (i, j). In this case, a 3-tap filter may be used, and the filter coefficients may be [-1, 0, 1]. For example, the spatial gradient may be calculated as follows.
[0326] [Formula 9]
[0327] g x (i,j)=I(i+1,j)-I(i-1,j)
[0328] g y (i,j)=I(i,j+1)-I(i,j-1)
[0329] To calculate the gradients, the prediction subblock can be extended by one pixel on each side. In this case, to reduce memory bandwidth and complexity, the pixels at the extended boundary can be copied from the nearest integer number of pixels in the reference picture. Thus, additional interpolation of the padded area can be skipped.
[0330] Step 3) The brightness prediction refinement (ΔI(i, j)) can be calculated by the optical flow equation. For example, the following equation can be used.
[0331] [Formula 10]
[0332] ΔI(i, j) = g x (i, j)*Δv x (i, j)+g y (i, j)*Δv y (i, j)
[0333] In the above formula, Δv(i, j) represents the difference between the pixel motion vector (pixel MV, v(i, j)) calculated at the sample position (i, j) and the sub-block MV of the sub-block to which the sample (i, j) belongs.
[0334] Fig. 22 is a view illustrating the relationship between Δv(i, j), v(i, j), and a sub-block motion vector.
[0335] exist Fig. 22 In the example shown, for example, the motion vector v(i, j) at the upper left sample position of the current sub-block is equal to the motion vector v of the current sub-block. SB The difference between φ(i, j) and φ(j) may be represented by a thick dashed arrow, and the vector represented by the thick dashed arrow may correspond to Δv(i, j).
[0336] The affine model parameters and pixel position from the center of the sub-block do not change. Therefore, Δv(i, j) can be calculated only for the first sub-block and can be reused for other sub-blocks in the same CU. Assuming that the horizontal offset and vertical offset from the pixel position to the center of the sub-block are x and y respectively, Δv(x, y) can be derived as follows.
[0337] [Formula 11]
[0338]
[0339] For the 4-parameter affine model,
[0340]
[0341] For the 6-parameter affine model,
[0342]
[0343] In the above text, (v 0x , v 0y )、(v 1x , v 1y ) and (v 2x , v 2y ) correspond to the upper-left CPMV, upper-right CPMV and lower-left CPMV respectively, and w and h represent the width and height of the CU respectively.
[0344] Step 4) Finally, the final prediction block I'(i, j) can be generated based on the calculated luma prediction refinement ΔI(i, j) and the prediction sub-block I(i, j). For example, the final prediction block I' can be generated as follows.
[0345] [Formula 12]
[0346] I′(i,j)=I(i,j)+ΔI(i,j)
[0347] As described above, by applying BDOF in the inter-frame prediction process to refine the reference sample in the motion compensation process, the compression performance of the image can be increased. BDOF can be performed in the normal mode. That is, BDOF is not performed in the case of the affine mode, GPM mode or CIIP mode.
[0348] As a method similar to BDOF, PROF may be performed on a block encoded in an affine mode. As described above, by refining reference samples in each 4×4 sub-block through PROF, compression performance of an image may be increased.
[0349] The present disclosure proposes various methods that can prevent potential errors of PROF and improve performance by applying normalization and clipping when deriving PROF offsets (refining ΔI or dI) to refine reference samples in the PROF process. In the present disclosure, normalization may refer to unifying values expressed in various units (e.g., 1 / 64 pixel, 1 / 32 pixel, 2 pixels, etc.) into values in predetermined units (e.g., 1 pixel). In addition, in the present disclosure, [a, b] may refer to a range of values from a to b, and clipping a certain value x within the range of [a, b] may refer to a range of x being limited to having a value of a when x is less than a, having a value of b when x is greater than b, and having a value of x in other cases. In addition, in the present disclosure, the bit depth is not limited to the bit depth of the luminance component, and may include, for example, a bit depth when the bit depths of the luminance component and the chrominance component are the same.
[0350] According to an embodiment of the present disclosure, the above-mentioned affine motion (sub-block motion) information of the current block may be derived, and the affine motion information may be refined through the above-mentioned PROF process, or the prediction sample derived based on the affine motion information may be refined.
[0351] Fig.23 is a view illustrating a process of deriving a prediction sample of a current block by applying PROF.
[0352] Can be performed by an image encoding device and an image decoding device Fig.23 PROF-based inter-frame prediction process.
[0353] First, in step S2310, motion information of the current block may be derived. The motion information of the current block may be derived by various methods described in the present disclosure. For example, the motion information of the current block may be derived by the method described in the above-mentioned affine mode or the sub-block-based TMVP mode. The motion information may include sub-block motion information of the current block. The sub-block motion information may include bidirectional prediction sub-block motion information (L0 sub-block motion information and L1 sub-block motion information). For example, the L0 sub-block motion information may include sbMVL0 (L0 sub-block motion vector) and refIdxL0 (L0 reference picture index), and the L1 sub-block motion information may include sbMVL1 (L1 sub-block motion vector) and refIdxL1 (L1 reference picture index).
[0354] Thereafter, a prediction sample of the current block may be derived based on the derived motion information of the current block (S2320). Specifically, an L0 prediction sample for each subblock of the current block may be derived based on the L0 subblock motion information. In addition, an L1 prediction sample for each subblock of the current block may be derived based on the L1 subblock motion information.
[0355] Thereafter, PROF offsets may be derived based on the derived prediction samples (S2330). The PROF of step S2330 may be performed according to the methods described in the present disclosure. For example, the differential motion vector diffMv and the gradient of the LX (x=0 or 1) prediction samples may be calculated, and based on these, PROF offsets dI or ΔI may be derived according to the methods described in the present disclosure. Various examples of the present disclosure relate to differential motion vector derivation, gradient derivation, and / or PROF offset derivation.
[0356] Thereafter, based on the LX (X=0 or 1) prediction samples and the PROF offset, a refined prediction sample of the current block may be derived (S2340). The refined prediction sample may be used to generate a final prediction block of the current block. For example, the final prediction block of the current block may be generated by weighted summing the refined L0 prediction sample and the refined L1 prediction sample.
[0357] The image encoding device can be based on Fig.23 The predicted samples of the current block generated by the method are compared with the original samples to derive residual samples. Information about the residual samples (residual information) can be included and encoded in the image / video information and output in the form of a bitstream as described above. In addition, as described above, the image decoding device can be based on Fig.23 The reconstructed current block is generated by using the prediction samples of the current block generated by the method and the residual samples obtained based on the residual information in the bitstream.
[0358] Fig.24 is a view illustrating an example of a PROF process according to the present disclosure.
[0359] according to Fig.24 For example, the width sbWidth, height sbHeight, predicted sub-block predSamples in which the boundary area extends by a predetermined length borderExtention, and differential motion vector diffMv of the current sub-block may be used as input to perform the PROF process. In this case, the predicted sub-block may be, for example, a predicted sub-block generated by performing affine motion compensation. As a result of performing the PROF process, a refined predicted sub-block pbSamples may be generated.
[0360] In order to perform the PROF process, a predetermined first shift shift1 may be calculated. The bit depth BitDepth of the luminance component may be Y Derive the first shift. For example, the first shift can be derived as 6 and (BitDepth Y -6) maximum value.
[0361] After that, the horizontal gradient gradientH(g x ) and vertical gradient gradientV(g y ). Fig.24 Equations (1) and (2) calculate the horizontal and vertical gradients.
[0362] Thereafter, based on the horizontal gradient, the vertical gradient and the differential motion vector diffMv, the PROF offset dI or ΔI for each sample position can be calculated. Fig.24 The PROF offset is calculated using equation (3). In equation (3), the differential motion vector diffMv used to calculate the PROF offset may refer to the reference Fig. 22 In this case, diffMv can be limited by dmvLimit as follows, and dmvLimit can be based on BitDepth as follows Y calculate.
[0363] [Formula 13]
[0364] dmvLimit=1<<Max(5, BitDepth Y-7),
[0365] diffMv[x][y][i]=Clip3(-dmvLimit, dmvLimit-1, diffMv[x][y][i])
[0366] Thereafter, the refined prediction sub-block pbSamples may be derived based on the calculated PROF offset and the prediction sub-block predSamples. Fig.24 Equation (4) derives the refined prediction sub-block.
[0367] according to Fig.24 For example, you can export the BitDepth as shown in the following table Y The bit width of each parameter of predSample and prof.
[0368] [Table 1]
[0369]
[0370] In Table 1 above, for example, when BitDepth Y When BitDepth is 8, predSample has a value in the range of 16 bits, gradient uses 11 bits, diffMv uses 6 bits, and the range of dI values is [-49856, 48298]. As shown in Table 1 above, as BitDepth Y changes, the bit width of predSample changes. However, even when BitDepth Y When changing, with BitDepth Y The gradients with height correlation also have a fixed bit width (11 bits). In addition, the bit width of diffMv not associated with BitDepthY increases with BitDepth Y Change for change.
[0371] According to the following embodiments of the present disclosure, by refining the normalization and limiting of the parameters used in the PROF process, the parameters and BitDepth can be more accurately reflected. Y Therefore, the parameters can have more accurate values and the memory overflow problem in the PROF process can be solved.
[0372] Fig.25 is a view illustrating a refinement PROF process according to an embodiment of the present disclosure.
[0373] Fig.25 The input and output of the PROF process are equal to Fig.24 The input and output of the PROF process are described below, so its detailed description will be omitted. Fig.25 , the first shift shift1 for performing the PROF process can be set to a fixed value regardless of the bit depth. For example, the first shift can be set to 6. Thereafter, Fig.25 The horizontal and vertical gradients are calculated using equations (1) and (2), and the PROF offset can be calculated according to equation (3). Fig.25 Equation (4) derives the refined prediction sub-block.
[0374] Fig.26 is a view illustrating a refined diffMv derivation process according to an embodiment of the present disclosure.
[0375] according to Fig.26 In the example of , when cbProfFlagLX is 1, that is, when PROF is determined to be applicable, diffMv can be derived. In this case, dmvLimit for clipping diffMv can be set to a fixed value regardless of the bit depth. For example, according to Fig.26 According to equation (3), dmvLimit can be set to “1<<5”.
[0376] exist Fig.25 and Fig.26 In the disclosed embodiment, the horizontal gradient and the vertical gradient represent the slope at a distance of 2 pixels in the horizontal and vertical directions of the current sample position. In addition, when diffMv is 1 / 32 pixel precision and has a value range of [-32, 31] or [-32, 32], the value 1 of diffMv represents the actual 1 / 32 pixel distance. Therefore, diffMv can be regarded as applying the "1<<5" operation to a 1 pixel unit value.
[0377] according to Fig.25 and Fig.26 In the disclosed embodiment, the parameters (horizontal gradient, vertical gradient, diffMv) used to calculate the PROF offset can be normalized to 1 pixel unit value. For example, for the gradient as the slope of the 2 pixel distance, the normalization to 1 pixel unit value can be performed by applying the ">>1" operation. In addition, for the diffMv of 1 / 32 pixel accuracy, the normalization to 1 pixel unit value can be performed by applying the ">>5" operation. With this in mind, Fig.25 As shown in equation (3), the “>>6” operation can be applied to the value obtained by multiplying the gradient by diffMv for normalization. That is, according to Fig.25 and Fig.26 According to the embodiment disclosed in the embodiment, the first shift can be set to a fixed value without considering the bit depth, and normalization to a 1-pixel unit value can be performed while considering both the gradient and the diffMv. In addition, dmvLimit representing the limit range of the diffMv value can be set to a fixed value without considering the bit depth.
[0378] according to Fig.25 and Fig.26 For example, you can change the BitDepth as shown in the following table Y The bit width of each parameter of predSample and prof.
[0379] [Table 2]
[0380]
[0381] As shown in Table 2 above, the gradient that is highly correlated with the bit depth changes according to the bit depth. In addition, since the range of the gradient value is determined based on the predSample value, the accuracy of the gradient value may increase. In addition, the bit width of diffMv, which is not related to the bit depth, may have a fixed value regardless of the bit depth. According to Table 2, instead of increasing the range of the gradient value, the range of the dI value may not be affected because the range of the value of diffMv is reduced.
[0382] Fig. 27 is a view illustrating a refinement PROF process according to another embodiment of the present disclosure.
[0383] Fig. 27 The input and output of the PROF process are equal to Fig.24 The input and output of the PROF process are described below, so its detailed description will be omitted. Fig. 27 , the first shift shift1 for performing the PROF process can be set to a fixed value regardless of the bit depth. For example, the first shift can be set to 5. Thereafter, the first shift shift1 can be set to a fixed value regardless of the bit depth. Fig. 27 The horizontal and vertical gradients are calculated using equations (1) and (2), and the PROF offset can be calculated according to equation (3). Fig. 27 The refined prediction subblock is derived from equation (4) of Fig.26 The method disclosed in derives diffMv.
[0384] As mentioned above, in Fig.25 In the embodiment of , the gradient and diffMv can be normalized to 1 pixel unit value. However, according to Fig.25 In the embodiment of the present invention, bit overflow may occur during the gradient calculation process. Fig. 27 The embodiment of can prevent bit overflow in the gradient calculation process. Fig.25 As shown in equations (1) and (2), when no shift operation is performed during the gradient calculation process, a 32-bit operation can be performed to calculate the gradient. That is, a bit overflow may occur when calculating the gradient. Fig. 27 In the embodiment, taking this into account, as Fig. 27 As shown in Equations (1) and (2), when calculating the gradient, gradient normalization can be applied.
[0385] according to Fig. 27 According to the embodiment disclosed in , when calculating the gradient, normalization can be performed by applying a ">>1" operation to prevent bit overflow. Fig. 27 In the example of , the gradient may not exceed 16 bits. Meanwhile, the normalization of diffMv may be performed by equation (3), for which the first shift may be set to a fixed value regardless of the bit depth. For example, the first shift may be set to 5.
[0386] according to Fig. 27 Example, according to BitDepth Y The bit width of each parameter of predSample and prof can be changed as shown in the following table.
[0387] [Table 3]
[0388]
[0389] As shown in Table 3 above, the gradient that is highly correlated with the bit depth changes according to the bit depth. Fig. 27 The shift operation in equation (1) and equation (2) can prevent bit overflow when calculating the gradient. In addition, the bit width of diffMv that is independent of the bit depth can have a fixed value regardless of the bit depth.
[0390] Fig.28 is a view illustrating a refinement PROF process according to another embodiment of the present disclosure.
[0391] Fig.28 The input and output of the PROF process are equal to Fig.24 The input and output of the PROF process are described below, so its detailed description will be omitted. Fig.28 , the first shift shift1 for performing the PROF process can be set to a fixed value regardless of the bit depth. For example, the first shift can be set to 6. Thereafter, Fig.28 The horizontal and vertical gradients are calculated using equations (1) and (2), and the PROF offset can be calculated according to equation (3). Fig.28 The refined prediction subblock is derived from equation (4) of Fig.26 The method disclosed in derives diffMv.
[0392] As mentioned above, in Fig.25 In the embodiment of , the gradient and diffMv can be normalized to 1 pixel unit value. However, according to Fig.25 In the embodiment of , as described above, bit overflow may occur during the gradient calculation process. Fig.28 In the embodiment, taking this into account, as Fig.28 As shown in equations (1) and (2), when calculating the gradient, a right shift operation can be performed. Fig.28 According to the embodiment disclosed in , when calculating the gradient, bit overflow can be prevented by applying the ">>shift1" operation. Fig.28 For example, the gradient may not exceed 16 bits.
[0393] according to Fig.28 Example, according to BitDepth Y The bit width of each parameter of predSample and prof can be changed as shown in the following table.
[0394] [Table 4]
[0395]
[0396] As shown in Table 4 above, the gradient that is highly correlated with the bit depth changes according to the bit depth. In addition, by performing the shift operations in Fig.28 Equations (1) and (2), bit overflow during gradient calculation can be prevented. In addition, the bit width of diffMv that is not related to the bit depth can have a fixed value regardless of the bit depth.
[0397] Fig.29 is a view illustrating a refined PROF process according to another embodiment of the present disclosure.
[0398] Fig.29 The input and output of the PROF process of Fig.24 are respectively equal to the input and output of the PROF process of Fig.29 , and thus its detailed description will be omitted. According to Fig.29 , the first shift shift1 for performing the PROF process can be set to a fixed value regardless of the bit depth. For example, the first shift can be set to 6. In addition, clipping can be performed so that no bit overflow occurs during gradient calculation, and gradLimit for specifying the clipping range of the gradient can be set. gradLimit can be set so that the gradient does not exceed 16 bits. For example, gradLimit can be set to "1<<Max(15,BitDepth+3)". Thereafter, according to Fig.29 Equations (1) and (2), the horizontal gradient and the vertical gradient can be calculated, and the PROF offset can be calculated according to Equation (3). Thereafter, according to Fig.29 Equation (4), the refined prediction sub-block can be derived. In this case, for example, diffMv can be derived according to the method disclosed in Fig.26 .
[0399] As described above, in the Fig.25 embodiment, the gradient and diffMv can be normalized to a 1-pixel unit value. However, according to the Fig.25 embodiment, as described above, bit overflow can occur during the gradient calculation process. According to the Fig.29 embodiment, bit overflow during the gradient calculation process can be prevented. For example, as shown in Fig.29 Equations (1) and (2), bit overflow can be prevented by performing a clipping operation during the gradient calculation process.
[0400] As described above, in the Fig.25 example, for the gradient, normalization to a 1-pixel unit value can be performed by applying the ">>1" operation, and for diffMv, normalization to a 1-pixel unit value can be performed by applying the ">>5" operation. According to the Fig.29 embodiment, as Fig.29As shown in equation (3), for normalization, the ">>6" operation can be applied to the value obtained by multiplying the gradient by diffMv. That is, according to Fig.29 In the embodiment disclosed in, the first shift can be set to a fixed value without considering the bit depth, and normalization to a 1-pixel unit value can be performed while considering both the gradient and diffMv. In addition, in order to prevent bit overflow, a clipping operation can be performed during the gradient calculation process.
[0401] according to Fig.29 Example, according to BitDepth Y The bit width of each parameter of predSample and prof can be changed as shown in the following table.
[0402] [Table 5]
[0403]
[0404] As shown in Table 5 above, the gradient that is highly correlated with the bit depth changes according to the bit depth. Fig.29 The clipping operation in equation (1) and equation (2) can prevent bit overflow when calculating the gradient. In addition, the bit width of diffMv that is independent of the bit depth can have a fixed value regardless of the bit depth.
[0405] Hereinafter, a refined diffMv derivation process according to the present disclosure will be described.
[0406] Fig.30 is a view illustrating a refined diffMv derivation process according to another embodiment of the present disclosure.
[0407] according to Fig.30 For example, when cbProfFlagLX is 1, diffMv can be derived. In this case, dmvLimit for clipping diffMv can be set to a fixed value regardless of the bit depth. Fig.30Equation (3), dmvLimit can be set to "1<<5". In addition, the right shift rightShift in the rounding process of diffMv can be adjusted so that diffMv is 1 / 32 pixel precision and has a value range of [-32,31] or [-32,32]. For example, as a right shift, a value of 6 can be used instead of 7. diffMv can be used to calculate the PROF offset, as described above. Therefore, the right shift operation applied to the PROF offset can be applied to the calculation of diffMv. With this in mind, for example, a value of 8 can be used as a right shift in the rounding process of diffMv. In the present disclosure, the rounding process of diffMv can be a process of inputting diffMv and right shifting rightShift and outputting a rounded diffMv generated by right shifting the input diffMv rightShift.
[0408] According to an embodiment of the present disclosure, diffMv may be limited within the range of [-dmvLimit, dmvLimit-1]. That is, the absolute value of the minimum value of the limiting range of diffMv is different from the absolute value of the maximum value. In the above-mentioned embodiment of the present disclosure, it may be modified so that the absolute value of the minimum value of the limiting range of diffMv is equal to the absolute value of the maximum value. For example, diffMv may be modified to be limited within the range of [-dmvLimit, dmvLimit] or to be limited within the range of [-dmvLimit+1, dmvLimit-1]. Therefore, the value of diffMv according to the present disclosure can be included in various ranges of [-16, 15], [-16, 16], [-15, 15], [-32, 31], [-32, 32], [-31, 31], [-64, 63], [-64, 64], [-63, 63], [-128, 127], [-128, 128] or [-127, 127] with 1 / 32 pixel precision or 1 / 64 pixel precision.
[0409] Fig.31 is a view illustrating a refined diffMv derivation process according to another embodiment of the present disclosure.
[0410] according to Fig.31 For example, when cbProfFlagLX is 1, diffMv can be derived. In this case, dmvLimit for clipping dIffMv can be set to a fixed value regardless of the bit depth. Fig.31 According to equation (3), dmvLimit may be set to "1<<5". Furthermore, as described above, the right shift in the rounding process of diffMv may be set to a value of 8 in consideration of the right shift operation to be applied to the PROF offset.
[0411] In addition, the clipping range of diffMv can be set so that the absolute value of the minimum value and the absolute value of the maximum value of the clipping range of diffMv are equal. Fig.31 As shown in equation (8), diffMv can be limited to the range of [-dmvLimit+1, dmvLimit-1].
[0412] Fig.32 is a view illustrating a refined diffMv derivation process according to another embodiment of the present disclosure.
[0413] according to Fig.32 For example, when cbProfFlagLX is 1, diffMv may be derived. In this case, when the affine mode is applied to the current block to limit the range of the value of CPMV, the clipping of diffMv may not be performed. Fig.32 In the example of , dmvLimit for limiting diffMv may not be set, and the process of limiting diffMv may be omitted.
[0414] According to the refined diffMv derivation process according to the present disclosure, diffMv may be limited to a predetermined range of values without considering the bit depth.
[0415] Hereinafter, a modified example of the embodiment of the present disclosure when diffMv has 1 / 64 pixel accuracy will be described.
[0416] For example, when diffMv has 1 / 64 pixel precision, in Fig.25 In the disclosed embodiment, the first shift may be changed to 7. That is, the ">>1" operation may be applied to the normalization of the gradient, and the ">>6" operation may be applied to the normalization of the diffMv of 1 / 64 pixel accuracy. Therefore, the ">>7" operation may be applied to the value obtained by multiplying the gradient by the diffMv for normalization.
[0417] For example, when diffMv has 1 / 64 pixel precision, in Fig. 27 In the embodiment disclosed in , the first shift can be changed to 6. That is, in order to prevent bit overflow, when calculating the gradient, normalization of the gradient can be performed by applying a ">>1" operation. At the same time, a ">>6" operation can be applied to the value obtained by multiplying the gradient by diffMv to normalize the diffMv of 1 / 64 pixel precision.
[0418] For example, when diffMv has 1 / 64 pixel precision, in Fig.28In the embodiment disclosed in , the first shift can be changed to 7. That is, in order to prevent bit overflow, the ">>Shift1" operation can be applied when calculating the gradient. Alternatively, in Fig.28 In the embodiment disclosed in , instead of changing the first shift, a ">>1" operation can be applied to PROF offset dI. That is, in Fig.28 In equation (4), dI can be replaced by (dI+1)>>1.
[0419] For example, when diffMv has 1 / 64 pixel precision, in Fig.29 In the embodiment disclosed in , the first shift can be changed to 7. That is, the ">>1" operation can be applied to the normalization of the gradient, and the ">>6" operation can be applied to the normalization of the diffMv of 1 / 64 pixel accuracy. Therefore, the ">>7" operation can be applied to the value obtained by multiplying the gradient by diffMv for normalization.
[0420] Hereinafter, embodiments of clipping PROF offset according to the present disclosure will be described.
[0421] The prediction sample predSample generated by interpolation of inter-frame prediction has a range of values determined by the input bit depth and the coefficient of the interpolation filter, and in the worst case, has a range of values of [-16830, 33150]. In this case, by adding a value of -8192 to the predSample value in order to prevent 16-bit overflow, as shown in Table 1, the value of predSample can be adjusted to the range of [-25022, 24958].
[0422] Therefore, as shown in Table 1, when BitDepth Y When is 8, predSample has a value in the range of 16 bits, gradient uses 11 bits, diffMv uses 6 bits, and the final dI ranges from [-49856, 48298]. Therefore, according to various embodiments of the present disclosure, when predSample and dI are added, a 16-bit overflow may occur.
[0423] According to the present disclosure, when the value of the refined prediction sample is calculated by limiting the PROF offset (dI) value within a predetermined range, a 16-bit overflow can be prevented. More specifically, when the bit depth is 8 to 12, predSample has a value in the 16-bit range, and when the bit depth is 14 and 16, predSample has a value in the 18-bit range and the 20-bit range. Therefore, the bit depth can also be considered to define the limiting range of dI. For example, a variable diLimit that specifies the limiting range of dI can be defined based on the bit depth, and the limiting of dI can be additionally applied to the embodiments of the present disclosure.
[0424] For example, in Fig.24 In the disclosed embodiment, ((dI+1)>>1) of equation (4) may be clipped within the range of [-dILimit,dILimit-1]. In this case, dILimit may be defined based on the bit depth. For example, dILimit may be set to “1< <Max(12,BitDepth Y )”.
[0425] For example, in Fig.25 , Fig. 27 , Fig.28 and Fig.29 In the disclosed embodiment, dI in equation (4) may be clipped within the range of [-dILimit, dILimit-1]. In this case, dILimit may be defined based on the bit depth. For example, dILimit may be set to “1< <Max(12,BitDepth Y )”.
[0426] According to another embodiment of the present disclosure, the embodiment of clipping the above-mentioned PROF offset may be modified and applied as follows.
[0427] The prediction sample predSample generated by interpolation of inter-frame prediction has a range of values determined by the input bit depth and the coefficients of the interpolation filter, and when predicting the current block in affine mode, due to the application of a 6-tap interpolation filter, and in the worst case, has a range of values of [-14066, 27509]. In this case, the value of predSample can be adjusted to the range of [-22258, 19317] by adding a value of -8192 to the predSample value in order to prevent 16-bit overflow.
[0428] Therefore, when BitDepth Y When is 8, predSample has a value in the range of 16 bits, gradient uses 11 bits, diffMv uses 6 bits, and the final dI value ranges from [-41471, 40824]. Therefore, according to various embodiments of the present disclosure, when predSample and dI are added, a 16-bit overflow may be generated.
[0429] According to the present disclosure, when the value of the refined prediction sample is calculated by limiting the PROF offset (dI) value within a predetermined range, a 16-bit overflow can be prevented. More specifically, when the bit depth is 8 to 12, predSample has a value in the 16-bit range, and when the bit depth is 14 and 16, predSample has a value in the 18-bit range and the 20-bit range. Therefore, the bit depth can also be considered to define the limiting range of dI. For example, a variable diLimit that specifies the limiting range of dI can be defined based on the bit depth, and the limiting of dI can be additionally applied to the embodiments of the present disclosure.
[0430] According to this modification example, dILimit may be set to "1 < <Max(13,BitDepth Y +1)", and you can Fig.24 Equation (4) of ((dI+1)>>1) and Fig.25 , Fig. 27 , Fig.28 and Fig.29 The dI of equation (4) is limited to the range of [-dILimit,dILimit-1].
[0431] Fig.33 is a diagram illustrating a refined PROF process of performing a clipped PROF offset according to the present disclosure.
[0432] Fig.33 An embodiment may be that the limiting of dI is additionally applied to Fig.28 An embodiment of an embodiment of an embodiment.
[0433] Therefore, the Fig.33 Examples and Fig.28 The common parts of the embodiments of the present invention. Fig.33 In an embodiment, diLimit may be derived based on the bit depth. Fig.33 Equation (4), dILimit can be set to “1< <Max(13,BitDepth Y +1)". In addition, the clipping of dI can be performed based on dILimit. For example, according to Fig.33 According to equation (5), dI can be clipped within the range of [-dILimit,dILimit-1].
[0434] according to Fig.33 Embodiments, except Fig.28 In addition to the effects of the embodiment, when calculating the value of the refined prediction sample, a 16-bit overflow can be prevented from occurring.
[0435] Hereinafter, a method of deriving a PROF offset dI according to another embodiment of the present disclosure will be described.
[0436] According to this embodiment, the right shift operation can be minimized in the gradient calculation process to improve the accuracy of the PROF offset. In addition, when the right shift operation is performed in the dI calculation process, the accuracy of the dI can be further improved by adding an offset value. In this case, the offset can be determined based on the right shift. For example, Fig.25 Equation (3) can be modified as follows.
[0437] dI=(gradientH[x][y]*diffMv[x][y][0]+offset)>>shift1+(gradientV[x][y]*diffMv[x][y][1]+offset)>>shift1
[0438] In the above equation, the offset may be set based on the first shift such as "1<<(shift1-1)".
[0439] The modification of the above equation (3) is not limited to application to Fig.25 and are applicable to other embodiments of the present disclosure.
[0440] According to the present disclosure, various embodiments and modifications of differential motion vector derivation, gradient derivation and / or PROF offset derivation are provided, and the embodiments and modifications are combined to configure new embodiments. For example, the embodiments of differential motion vector derivation (e.g., Fig.26 as well as Figure 30 to Figure 32 ) may be combined with an embodiment of gradient derivation and / or PROF offset derivation (e.g., Fig.24 , Fig.25 , Figure 27 to Figure 29 and Fig.33 A combination in the embodiment of the present invention.
[0441] Although for the sake of clarity of description, the exemplary method of the present disclosure described above is represented as a series of operations, it is not intended to limit the order of executing the steps, and these steps can be performed simultaneously or in different orders when necessary. In order to implement the method according to the present invention, the steps described may further include other steps, may include the remaining steps except some steps, or may include other additional steps except some steps.
[0442] 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.
[0443] 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.
[0444] 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 in 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.
[0445] In addition, the image decoding device and the image encoding device of the embodiment of the present disclosure can be included in multimedia broadcast transmission and reception equipment, mobile communication terminals, home theater video equipment, digital theater video equipment, surveillance cameras, video chat equipment, real-time communication equipment such as video communication, mobile streaming equipment, storage media, cameras, video on demand (VoD) service providing equipment, OTT video (over the top video) equipment, Internet streaming service providing equipment, three-dimensional (3D) video equipment, video phone video equipment, medical video equipment, etc., and can be used to process video signals or data signals. For example, OTT video equipment may include game consoles, Blu-ray players, Internet access TVs, home theater systems, smart phones, tablet PCs, digital video recorders (DVRs), etc.
[0446] Fig.29 is a view showing a content streaming system to which an embodiment of the present disclosure can be applied.
[0447] like Fig.29 As shown in , a content streaming system to which an embodiment of the present disclosure is applied may mainly include an encoding server, a streaming server, a network server, a media storage device, a user device, and a multimedia input device.
[0448] The encoding server compresses the content input from multimedia input devices such as smart phones, cameras, and camcorders into digital data to generate a bitstream and sends the bitstream to the streaming server. As another example, when multimedia input devices such as smart phones, cameras, and camcorders directly generate bitstreams, the encoding server can be omitted.
[0449] The bitstream may be generated by applying the image encoding method or the image encoding device according to the embodiment of the present disclosure, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.
[0450] 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 can 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.
[0451] 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 for a predetermined time.
[0452] 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.
[0453] Each server in the content streaming system may operate as a distributed server, in which case data received from each server may be distributed.
[0454] The scope of the present disclosure includes software or machine-executable commands (e.g., operating systems, applications, firmware, programs, etc.) for enabling operations according to the methods of 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.
[0455] Industrial Applicability
[0456] 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: deriving a prediction sample of the current block based on motion information of the current block; determining whether optical flow prediction refinement (PROF) is applied to the current block; deriving a differential motion vector for each sample position in the current block based on application of the PROF to the current block; deriving a gradient for each sample position in the current block; deriving a PROF offset based on the differential motion vector and the gradient; and deriving a refined prediction sample for the current block based on the PROF offset; wherein deriving the differential motion vector comprises rounding the differential motion vector, and The rounding of the differential motion vector is performed by right-shifting the differential motion vector by 8 to generate a rounded differential motion vector.
2. The image decoding method according to claim 1, in, deriving the differential motion vector comprises clipping the rounded differential motion vector within a predetermined range, and The predetermined range is set based on a fixed value dmvLimit derived independently of the bit depth of the current block.
3. The image decoding method according to claim 2, in, The predetermined range is specified by a minimum and maximum value derived based on dmvLimit, and The absolute value of the minimum value and the absolute value of the maximum value are set to the same value.
4. The image decoding method according to claim 3, in, The minimum value is (-dmvLimit+1), and the maximum value is (dmvLimit-1).
5. The image decoding method according to claim 2, in, dmvLimit is (1<<5).
6. The image decoding method according to claim 1, in, Deriving the gradient includes right-shifting neighboring predicted sample values at each sample position in the current block by a first shift, and The first shift is set to a fixed value regardless of the bit depth of the current block.
7. The image decoding method according to claim 6, in, The first shift is 6.
8. The image decoding method according to claim 1, in, The PROF offset derived in deriving the PROF offset is clipped within a predetermined range.
9. The image decoding method according to claim 8, in, The predetermined range of clipping the PROF offset is set based on a value diLimit, the value diLimit being derived based on a bit depth of the current block.
10. The image decoding method according to claim 9, in, The predetermined range for clipping the PROF offset is [-dILimit, dILimit-1].
11. The image decoding method according to claim 10, in, dILimit is (1< <max(13,Bitdepth+1))。 12. An image decoding device, comprising: Memory; as well as at least one processor, Wherein, the at least one processor is configured to: deriving a prediction sample of the current block based on motion information of the current block; determining whether optical flow prediction refinement (PROF) is applied to the current block; deriving a differential motion vector for each sample position in the current block based on application of the PROF to the current block; deriving a gradient for each sample position in the current block; deriving a PROF offset based on the differential motion vector and the gradient; and deriving a refined prediction sample for the current block based on the PROF offset; wherein deriving the differential motion vector comprises rounding the differential motion vector, and The rounding of the differential motion vector is performed by right-shifting the differential motion vector by 8 to generate a rounded differential motion vector.
13. An image encoding method performed by an image encoding device, the image encoding method comprising: deriving a prediction sample of the current block based on motion information of the current block; determining whether optical flow prediction refinement (PROF) is applied to the current block; deriving a differential motion vector for each sample position in the current block based on application of the PROF to the current block; deriving a gradient for each sample position in the current block; deriving a PROF offset based on the differential motion vector and the gradient; and deriving a refined prediction sample for the current block based on the PROF offset; wherein deriving the differential motion vector comprises rounding the differential motion vector, and The rounding of the differential motion vector is performed by right-shifting the differential motion vector by 8 to generate a rounded differential motion vector.
14. A method of transmitting a bit stream generated by the image encoding method according to claim 13.