Image encoding / decoding method for deriving weight index for bidirectional prediction of merge candidate, device, and method for transmitting bitstream
The image encoding/decoding method enhances efficiency by using weight indices for bi-directional prediction of merge candidates, addressing the cost increase in transmitting and storing high-resolution images.
Patent Information
- Application Number
- JP2024122996
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-08-08
- Filing Date
- 2024-07-30
- Publication Date
- 2024-10-16
- Estimated Expiration
- 2040-07-06
AI Technical Summary
The increasing demand for high-resolution, high-quality images leads to a significant increase in transmission and storage costs due to the higher amount of information required, necessitating highly efficient image compression techniques.
An image encoding/decoding method that includes configuring an affine merge candidate list, selecting candidates, inducing motion information, and generating predicted blocks based on weight indices for bi-directional prediction of combined affine merge candidates, along with a method for transmitting and storing bitstreams.
Improves encoding/decoding efficiency and reduces transmission and storage costs by optimizing the encoding/decoding process for high-resolution images.
Smart Images

Figure 2024147815000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to an image encoding / decoding method, an apparatus, and a method for transmitting a bitstream, and more particularly, to an image encoding / decoding method, an apparatus, and a method for transmitting a bitstream generated by the image encoding method / apparatus of the present disclosure, which derive a weight index for bidirectional prediction of a merge candidate. [Background technology]
[0002] Recently, the demand for high-resolution, high-quality images, for example, HD (High Definition) images and UHD (Ultra High Definition) images, is increasing in various fields. As the resolution and quality of image data increases, the amount of information or bits transmitted increases relatively compared to conventional image data. The increase in the amount of information or bits transmitted leads to an increase in transmission costs and storage costs.
[0003] This requires a highly efficient image compression technique for effectively transmitting, storing, and reproducing high-resolution, high-quality image information. Summary of the Invention [Problem to be solved by the invention]
[0004] An object of the present disclosure is to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.
[0005] Another object of the present disclosure is to provide an image encoding / decoding method and apparatus for deriving weight indices for bidirectional prediction of merge candidates.
[0006] Another object of the present disclosure is to provide a method for transmitting a bitstream generated by the image encoding method or apparatus according to the present disclosure.
[0007] Another object of the present disclosure is to provide a recording medium storing a bitstream generated by the image encoding method or apparatus according to the present disclosure.
[0008] Another object of the present disclosure is to provide a recording medium storing a bitstream that is received by the image decoding device according to the present disclosure, decoded, and used to restore an image.
[0009] The technical problems to be solved by the present disclosure are not limited to the above-mentioned technical problems, and other technical problems not described above will be clearly understood by a person having ordinary skill in the art to which the present disclosure pertains from the following description. [Means for solving the problem]
[0010] An image decoding method according to one aspect of the present disclosure includes, when the inter prediction mode of the current block is an affine merge mode, the steps of constructing an affine merge candidate list for the current block, selecting one affine merge candidate from the affine merge candidate list, deriving motion information of the current block based on motion information of the selected affine merge candidate, generating a predicted block of the current block based on the motion information of the current block, and restoring the current block based on the predicted block of the current block, wherein the step of constructing the affine merge candidate list includes a step of deriving a combined affine merge candidate, and the step of deriving the combined affine merge candidate may include a step of deriving a weight index for bidirectional prediction of the combined affine merge candidate.
[0011] In the image decoding method according to the present disclosure, the step of deriving the combined affine merge candidate may be performed based on motion information for each CP (Control Points) included in a combination of already defined CPs among a plurality of CPs of the current block.
[0012] In the image decoding method according to the present disclosure, the motion information for the CP is derived based on the motion information of a candidate block for the CP, and the candidate block can be an available candidate block among at least one candidate block for the CP.
[0013] In the image decoding method according to the present disclosure, the motion information for the CP includes a weight index for bidirectional prediction, and the weight index for bidirectional prediction can be derived when the CP is the upper left CP or the upper right CP of the current block.
[0014] In the image decoding method according to the present disclosure, the motion information for the CP includes a weight index for bidirectional prediction, and the weight index for bidirectional prediction may not be derived when the CP is a bottom-left CP or a bottom-right CP of the block.
[0015] In the image decoding method according to the present disclosure, if there is no available candidate block among the at least one candidate block for the CP, it may be determined that the CP is unavailable.
[0016] In the image decoding method according to the present disclosure, the step of deriving the combined affine merge candidate may be performed when all CPs included in the combination of the already-defined CPs are available.
[0017] In the image decoding method according to the present disclosure, the already defined CPs have a predetermined order within the combination, and a weight index of the combined affine merge candidate can be derived based on the order within the combination of the already defined CPs.
[0018] In the image decoding method according to the present disclosure, the weight index of the combined affine merge candidate is derived based on whether a prediction direction for the combination can be used, and whether a prediction direction for the combination can be derived based on motion information for a CP included in the combination.
[0019] In the image decoding method according to the present disclosure, when the availability of the prediction direction for the combination is available for both the L0 direction and the L1 direction, the weight index of the combination affine merge candidate can be induced to the weight index of a specified CP in the combination.
[0020] In the image decoding method according to the present disclosure, the predetermined CP in the combination used to derive a weight index for the combined affine merge candidate may be a first CP among the CPs in the combination.
[0021] In the image decoding method according to the present disclosure, when the availability of the prediction direction for the combination is unavailable for at least one of the L0 direction and the L1 direction, the weight index of the combination affine merge candidate can be induced to a predetermined weight index.
[0022] An image decoding device according to another aspect of the present disclosure includes a memory and at least one processor, wherein when an inter prediction mode of a current block is an affine merge mode, the at least one processor configures an affine merge candidate list for the current block, selects one affine merge candidate from the affine merge candidate list, derives motion information of the current block based on motion information of the selected affine merge candidate, generates a predicted block of the current block based on the motion information of the current block, and reconstructs the current block based on the predicted block of the current block, wherein configuring the affine merge candidate list includes deriving a combined affine merge candidate, and deriving the combined affine merge candidate includes deriving a weight index for bidirectional prediction of the combined affine merge candidate.
[0023] An image encoding method according to another aspect of the present disclosure includes a step of generating a predictive block of a current block based on motion information of the current block, a step of encoding the current block based on the predictive block, and a step of encoding the motion information of the current block, wherein the step of encoding the motion information of the current block includes a step of constructing an affine merge candidate list for the current block when the inter prediction mode of the current block is an affine merge mode, and a step of encoding the motion information of the current block based on the affine merge candidate list, wherein the step of constructing the affine merge candidate list includes a step of deriving a combined affine merge candidate, and the step of deriving the combined affine merge candidate may include a step of deriving a weight index for bidirectional prediction of the combined affine merge candidate.
[0024] A computer-readable recording medium according to another aspect of the present disclosure can store a bitstream generated by the image encoding method or image encoding device of the present disclosure.
[0025] The features described above in the brief summary of the present disclosure are merely exemplary embodiments of the detailed description of the present disclosure that follows and are not intended to limit the scope of the present disclosure. Effect of the Invention
[0026] According to the present disclosure, an image encoding / decoding method and apparatus with improved encoding / decoding efficiency can be provided.
[0027] In addition, the present disclosure may provide an image encoding / decoding method and apparatus for deriving weight indices for bidirectional prediction of merge candidates.
[0028] According to the present disclosure, there can also be provided a method for transmitting a bitstream generated by the image encoding method or apparatus according to the present disclosure.
[0029] According to the present disclosure, a recording medium storing a bitstream generated by the image encoding method or apparatus according to the present disclosure can be provided.
[0030] Furthermore, according to the present disclosure, it is possible to provide a recording medium storing a bitstream that is received by the image decoding device according to the present disclosure, decoded, and used to restore an image.
[0031] The effects obtained by the present disclosure are not limited to the effects described above, and other effects not described above will be clearly understood by those having ordinary skill in the art to which the present disclosure pertains from the following description. [Brief description of the drawings]
[0032] [Figure 1] FIG. 1 is a schematic diagram illustrating a video coding system to which an embodiment of the present disclosure can be applied. [Diagram 2] 1 is a diagram illustrating an image encoding device to which an embodiment of the present disclosure can be applied; [Diagram 3] 1 is a diagram illustrating an image decoding device to which an embodiment of the present disclosure can be applied; [Figure 4] 1 is a diagram illustrating an example configuration of an inter prediction unit that performs inter prediction coding according to the present disclosure. [Diagram 5] 1 is a flowchart illustrating an encoding method based on inter prediction. [Figure 6] 1 is a diagram illustrating an example configuration of an inter prediction unit that performs inter prediction decoding according to the present disclosure. [Figure 7] 1 is a flowchart illustrating a decoding method based on inter prediction. [Figure 8] FIG. 13 illustrates an example of neighboring blocks used as spatial merging candidates. [Figure 9] FIG. 2 is a schematic diagram illustrating a merge candidate list construction method according to an example of the present disclosure. [Figure 10] FIG. 2 is a diagram illustrating a motion vector predictor candidate list construction method according to an example of the present disclosure; [Figure 11] FIG. 1 is a diagram for explaining a four-parameter model of an affine mode. [Figure 12] FIG. 1 is a diagram for explaining a six-parameter model of an affine mode. [Figure 13] FIG. 13 is a diagram illustrating a method for generating an affine merge candidate list. [Figure 14] FIG. 13 is a diagram for explaining CPMV induced from surrounding blocks. [Figure 15] FIG. 13 is a diagram for explaining surrounding blocks for deriving combined affine merge candidates. [Figure 16] FIG. 13 is a diagram for explaining a method for generating an affine MVP candidate list. [Figure 17] FIG. 1 is a diagram for explaining peripheral blocks in sub-block-based TMVP mode. [Figure 18] A diagram to explain a method of deriving a motion vector field according to sub-block-based TMVP mode. [Figure 19] FIG. 13 is a diagram for explaining a method for deriving combined affine merge candidates according to another embodiment of the present disclosure. [Figure 20] 20 is a flowchart illustrating a method for deriving information on a CP of a current block according to the embodiment of FIG. 19. [Figure 21] FIG. 20 is a diagram illustrating a method for deriving combined affine merge candidates based on information for each CP according to the embodiment of FIG. 19. [Figure 22] 22 is a diagram illustrating an example of a method for deriving weight indexes for combined affine merge candidates according to the embodiment of FIG. 21. [Diagram 23] FIG. 13 is a diagram illustrating a method for deriving combined affine merge candidates based on information for each CP according to another embodiment of the present disclosure. [Figure 24] 13 is a flowchart illustrating a method for omitting a comparison against bcwIdxCorner2 according to the present disclosure. [Diagram 25] 1 is a flow chart illustrating a method for omitting comparisons for weight index groups according to the present disclosure. [Figure 26] 13 is a flowchart illustrating a method for omitting a comparison for bcwIdxCorner2 and a comparison for a weight index group according to the present disclosure. [Figure 27] FIG. 1 illustrates a content streaming system to which an embodiment of the present disclosure can be applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0033] The present disclosure will be described in detail below with reference to the accompanying drawings so that those skilled in the art can easily implement the present disclosure. However, the present disclosure may be embodied in various different forms and is not limited to the embodiments described herein.
[0034] In describing the embodiments of the present disclosure, if it is determined that a specific description of a known configuration or function may make the gist of the present disclosure unclear, the detailed description thereof will be omitted. In addition, in the drawings, parts that are not related to the description of the present disclosure are omitted, and similar parts are denoted by similar reference numerals.
[0035] In the present disclosure, when a certain component is "connected," "coupled," or "connected" to another component, this includes not only a direct connection relationship, but also an indirect connection relationship in which another component exists between them. Furthermore, when a certain component is described as "including" or "having" another component, this does not mean that the other component is excluded, but that the other component can be further included, unless otherwise specified.
[0036] In this disclosure, terms such as "first" and "second" are used only for the purpose of distinguishing one component from another component, and do not limit the order or importance of the components unless otherwise specified. Therefore, within the scope of this disclosure, a first component in one embodiment may be called a second component in another embodiment, and similarly, a second component in one embodiment may be called a first component in another embodiment.
[0037] In this disclosure, components that are distinguished from one another are used to clearly describe the characteristics of each component, and do not necessarily mean that the components are separate. In other words, multiple components may be integrated and configured as a single hardware or software unit, or one component may be distributed and configured as multiple hardware or software units. Thus, even if not otherwise stated, such integrated or distributed embodiments are also included in the scope of the present disclosure.
[0038] In the present disclosure, the components described in the various embodiments are not necessarily essential components, and some may be optional components. Therefore, an embodiment consisting of a subset of the components described in one embodiment is also included in the scope of the present disclosure. In addition, an embodiment including other components in addition to the components described in the various embodiments is also included in the scope of the present disclosure.
[0039] The present disclosure relates to image encoding and decoding, and terms used in this disclosure may have ordinary meanings in the technical field to which the present disclosure belongs, unless they are newly defined in this disclosure.
[0040] In this disclosure, a "picture" generally means a unit indicating any one image in a particular time period, a slice / tile is a coding unit constituting a part of a picture, and one picture may be composed of one or more slices / tiles. Also, a slice / tile may include one or more coding tree units (CTUs).
[0041] In this disclosure, a "pixel" or a "pel" may refer to the smallest unit constituting one picture (or image). A term corresponding to a pixel may be a "sample." A sample may generally indicate a pixel or a pixel value, may indicate only a pixel / pixel value of a luma component, or may indicate only a pixel / pixel value of a chroma component.
[0042] In this disclosure, a "unit" may refer to a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. A unit may be used interchangeably with terms such as "sample array," "block," or "area," depending on the case. In a general case, an M×N block may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.
[0043] In the present disclosure, a "current block" may refer to any one of a "current coding block," a "current coding unit," a "block to be coded," a "block to be decoded," or a "block to be processed." If prediction is performed, a "current block" may refer to a "current predicted block" or a "block to be predicted." If transformation (inverse transformation) / quantization (inverse quantization) is performed, a "current block" may refer to a "current transformed block" or a "block to be transformed." If filtering is performed, a "current block" may refer to a "block to be filtered."
[0044] In the present disclosure, " / " and "," can be interpreted as "and / or." For example, "A / B" and "A, B" can be interpreted as "A and / or B." Also, "A / B / C" and "A, B, C" can mean "at least one of A, B, and / or C."
[0045] In this disclosure, "or" can be interpreted as "and / or." For example, "A or B" can mean 1) only "A," 2) only "B," or 3) "A and B." Or, in this disclosure, "or" can mean "additionally or alternatively."
[0046] Video Coding System Overview
[0047] FIG. 1 is a diagram illustrating a video coding system according to this disclosure.
[0048] A video coding system according to an embodiment may include an encoding device 10 and a decoding device 20. The encoding device 10 may transmit encoded video and / or image information or data to the decoding device 20 in a file or streaming format via a digital storage medium or a network.
[0049] The encoding device 10 according to an embodiment may include a video source generating unit 11, an encoding unit 12, and a transmitting unit 13. The decoding device 20 according to an embodiment may include a receiving unit 21, a decoding unit 22, and a rendering unit 23. The encoding unit 12 may be referred to as a video / image encoding unit, and the decoding unit 22 may be referred to as a video / image decoding unit. The transmitting unit 13 may be included in the encoding unit 12. The receiving unit 21 may be included in the decoding unit 22. The rendering unit 23 may include a display unit, which may be configured as a separate device or an external component.
[0050] The video source generating unit 11 can obtain videos / images through a process of capturing, synthesizing, or generating videos / images. The video source generating unit 11 can include a video / image capture device and / or a video / image generation device. The video / image capture device can include, for example, one or more cameras, a video / image archive containing previously captured videos / images, etc. The video / image generation device can include, for example, a computer, a tablet, a smartphone, etc., and can (electronically) generate videos / images. For example, a virtual video / image can be generated through a computer, etc., in which case the video / image capture process can be replaced by a process in which related data is generated.
[0051] The encoder 12 may encode the input video / image. The encoder 12 may perform a series of steps such as prediction, transformation, quantization, etc. for compression and encoding efficiency. The encoder 12 may output the encoded data (encoded video / image information) in a bitstream format.
[0052] The transmitting unit 13 may transmit the encoded video / image information or data output in a bitstream format to the receiving unit 21 of the decoding device 20 via a digital storage medium or a network in a file or streaming format. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit 13 may include elements for generating a media file via a predetermined file format and may include elements for transmitting via a broadcasting / communication network. The receiving unit 21 may extract / receive the bitstream from the storage medium or network and transmit it to the decoding unit 22.
[0053] The decoding unit 22 can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, and prediction corresponding to the operations of the encoding unit 12.
[0054] The rendering unit 23 can render the decoded video / images. The rendered video / images can be displayed via a display unit.
[0055] Overview of the image encoding device
[0056] FIG. 2 is a diagram illustrating an image encoding device to which an embodiment of the present disclosure can be applied.
[0057] As shown in Fig. 2, the image coding device 100 may include an image division unit 110, a subtraction unit 115, a transformation unit 120, a quantization unit 130, an inverse quantization unit 140, an inverse transformation unit 150, an addition unit 155, a filtering unit 160, a memory 170, an inter prediction unit 180, an intra prediction unit 185, and an entropy coding unit 190. The inter prediction unit 180 and the intra prediction unit 185 may be collectively referred to as a "prediction unit." The transformation unit 120, the quantization unit 130, the inverse quantization unit 140, and the inverse transformation unit 150 may be included in a residual processing unit. The residual processing unit may further include a subtraction unit 115.
[0058] All or at least some of the components constituting the image encoding device 100 may be realized by a single hardware component (e.g., an encoder or a processor) depending on the embodiment. Also, the memory 170 may include a decoded picture buffer (DPB) and may be realized by a digital storage medium.
[0059] The image division unit 110 may divide an input image (or picture, frame) input to the image encoding device 100 into one or more processing units. As an example, the processing units may be called coding units (CUs). The coding units may be obtained by recursively dividing a coding tree unit (CTU) or a largest coding unit (LCU) according to a QT / BT / TT (Quad-tree / Binary-tree / Ternal-tree) structure. For example, one coding unit may be divided into a plurality of coding units of a deeper depth based on a quad-tree structure, a binary-tree structure, and / or a ternary-tree structure. For dividing the coding units, a quad-tree structure may be applied first, and a binary-tree structure and / or a ternary-tree structure may be applied later. A coding procedure according to the present disclosure may be performed based on a final coding unit that is not further divided. The maximum coding unit may be used as the final coding unit, and a lower depth coding unit obtained by dividing the maximum coding unit may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and / or restoration, which will be described later. As another example, a processing unit of the coding procedure may be a prediction unit (PU) or a transform unit (TU). The prediction unit and the transform unit may be divided or partitioned from the final coding unit, respectively. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.
[0060] The prediction unit (inter prediction unit 180 or intra prediction unit 185) may perform prediction on a block to be processed (current block) and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied in units of a current block or a CU. The prediction unit may generate various information related to prediction of the current block and transmit it to the entropy encoding unit 190. The information related to prediction may be encoded by the entropy encoding unit 190 and output in a bitstream format.
[0061] The intra prediction unit 185 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block according to an intra prediction mode and / or an intra prediction technique. The intra prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The non-directional mode may include, for example, a DC mode and a planar mode. The directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the setting. The intra prediction unit 185 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.
[0062] The inter prediction unit 180 may derive a predicted block for a current block based on a reference block (reference sample array) identified 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 a block, a sub-block, or a sample based on the correlation of motion information between a neighboring block and a current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring block may include a spatial neighboring block present in the current picture and a temporal neighboring block 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 from each other. The temporal neighboring block may be called a collocated reference block, a collocated CU (colCU), etc. The reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 180 may generate information indicating which candidate is used to derive a motion vector and / or a reference picture index of the current block by forming a motion information candidate list based on neighboring blocks. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 180 may use motion information of neighboring blocks as motion information of the current block. In the case of the skip mode, unlike the merge mode, a residual signal may not be transmitted.In the case of a motion vector prediction (MVP) mode, the motion vector of the current block can be signaled by using the motion vector of a neighboring block as a motion vector predictor and encoding a motion vector difference and an indicator for the motion vector predictor. The motion vector difference can mean the difference between the motion vector of the current block and the motion vector predictor.
[0063] The prediction unit may generate a prediction signal based on various prediction methods and / or prediction techniques, which will be described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of the current block, and may simultaneously apply intra prediction and inter prediction. A prediction method that simultaneously applies intra prediction and inter prediction for prediction of the current block may be called combined inter and intra prediction (CIIP). The prediction unit may also perform intra block copy (IBC) for prediction of the current block. Intra block copy can be used for content image / video coding such as games, for example, as in screen content coding (SCC). IBC is a method of predicting a current block using an already restored reference block in a current picture that is located a predetermined distance away from the current block. When IBC is applied, the position of the reference block in the current picture may be coded as a vector (block vector) corresponding to the predetermined distance.
[0064] The prediction signal generated by the prediction unit may be used to generate a restored signal or a residual signal. The subtraction unit 115 may subtract the prediction signal (predicted block, prediction sample array) output from the prediction unit from the input image signal (original block, original sample array) to generate a residual signal (residual block, residual sample array). The generated residual signal may be transmitted to the conversion unit 120.
[0065] The transform unit 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-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. The CNT refers to a transform obtained based on a predicted signal generated using all previously reconstructed pixels. The transform process may be applied to pixel blocks having the same square size, or may be applied to non-square, variable-sized blocks.
[0066] The quantization unit 130 may quantize the transform coefficients and transmit the quantized transform coefficients to the entropy coding unit 190. The entropy coding unit 190 may code the quantized signal (information on the quantized transform coefficients) and output the coded signal in a bitstream format. The information on the quantized transform coefficients may be referred to as residual information. The quantization unit 130 may rearrange the quantized transform coefficients in a block format into a one-dimensional vector format based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector format.
[0067] The entropy coding unit 190 may perform various coding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy coding unit 190 may also code information required for video / image restoration (e.g., values of syntax elements, etc.) together or separately in addition to the quantized transform coefficients. The coded information (e.g., coded video / image information) may be transmitted or stored in a network abstraction layer (NAL) unit unit in a bitstream format. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / image information may further include general constraint information. The signaling information, transmitted information and / or syntax elements referred to in this disclosure may be encoded through the above-mentioned encoding procedures and included in the bitstream.
[0068] The bitstream may be transmitted via a network or may be stored in a digital storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) for transmitting the signal output from the entropy encoding unit 190 and / or a storing unit (not shown) for storing the signal may be provided as an internal / external element of the image encoding device 100, or the transmitting unit may be provided as a component of the entropy encoding unit 190.
[0069] The quantized transform coefficients output from the quantization unit 130 can be used to generate a residual signal. For example, the quantized transform coefficients are subjected to inverse quantization and inverse transformation via the inverse quantization unit 140 and the inverse transformation unit 150, so that a residual signal (residual block or residual sample) can be restored.
[0070] The adder 155 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to a prediction signal output from the inter prediction unit 180 or the intra prediction unit 185. When there is no residual for the current block to be processed, such as when a skip mode is applied, a predicted block may be used as a reconstructed block. The adder 155 may be referred to as a reconstruction unit or a reconstructed block generation unit. The generated reconstructed signal may be used for intra prediction of the next current block to be processed in the current picture, and may also be used for inter prediction of the next picture after filtering as described below.
[0071] Meanwhile, as will be described later, LMCS (luma mapping with chroma scaling) can be applied during the picture encoding process.
[0072] The filtering unit 160 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 160 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may store the modified reconstructed picture in the memory 170, specifically, in the DPB of the memory 170. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, and the like. The filtering unit 160 may generate various information related to filtering, as will be described later in the description of each filtering method, and transmit the information to the entropy coding unit 190. The information related to filtering may be coded by the entropy coding unit 190 and output in a bitstream format.
[0073] The modified reconstructed picture transmitted to the memory 170 may be used as a reference picture in the inter prediction unit 180. When inter prediction is applied through this, the image encoding device 100 may avoid a prediction mismatch between the image encoding device 100 and the image decoding device, and may also improve encoding efficiency.
[0074] The DPB in the memory 170 may store modified reconstructed pictures to be used as reference pictures in the inter prediction unit 180. The memory 170 may store motion information of blocks from which motion information in the current picture is derived (or coded) and / or motion information of already reconstructed intra-picture blocks. The stored motion information may be transmitted to the inter prediction unit 180 to be used as motion information of spatial surrounding blocks or motion information of temporal surrounding blocks. The memory 170 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 185.
[0075] Overview of the image decoding device
[0076] FIG. 3 is a diagram illustrating an image decoding device to which an embodiment of the present disclosure can be applied.
[0077] 3, the image decoding device 200 may include an entropy decoding unit 210, an inverse quantization unit 220, an inverse transform unit 230, an adder 235, a filtering unit 240, a memory 250, an inter prediction unit 260, and an intra prediction unit 265. The inter prediction unit 260 and the intra prediction unit 265 may be collectively referred to as a "prediction unit." The inverse quantization unit 220 and the inverse transform unit 230 may be included in a residual processing unit.
[0078] All or at least some of the components constituting the image decoding device 200 may be realized by one hardware component (e.g., a decoder or a processor) depending on the embodiment. Also, the memory 170 may include a DPB and may be realized by a digital storage medium.
[0079] The image decoding device 200, which receives a bitstream including video / image information, can reconstruct an image by executing a process corresponding to the process performed by the image encoding device 100 of FIG. 1. For example, the image decoding device 200 can perform decoding using a processing unit applied in the image encoding device. Thus, the processing unit for decoding can be, for example, a coding unit. The coding unit can be obtained by dividing a coding tree unit or a maximum coding unit. Then, the reconstructed image signal decoded and output by the image decoding device 200 can be reproduced by a reproduction device (not shown).
[0080] The image decoding apparatus 200 may receive a signal output from the image encoding apparatus of FIG. 1 in the form of a bitstream. The received signal may be decoded via the entropy decoding unit 210. For example, the entropy decoding unit 210 may derive information (e.g., video / image information) required for image restoration (or picture restoration) by parsing the bitstream. The video / image information may further include information on various parameter sets such as an adaptation 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 further include general constraint information. The image decoding apparatus may further use information on the parameter set and / or the general constraint information to decode an image. The signaling information, received information, and / or syntax elements referred to in the present disclosure may be obtained from the bitstream by being decoded via the decoding procedure. For example, the entropy decoding unit 210 may decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values of syntax elements required for image restoration and quantized values of transform coefficients related to the residual. More specifically, the CABAC entropy decoding method may receive bins corresponding to each syntax element from the bitstream, determine a context model using syntax element information to be decoded and decoded information of neighboring blocks and a block to be decoded, or information of a symbol / bin decoded in a previous step, predict the occurrence probability of the bin based on the determined context model, and perform arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element. In this case, the CABAC entropy decoding method may update the context model using information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model.Among the information decoded by the entropy decoding unit 210, information related to prediction is provided to a prediction unit (inter prediction unit 260 and intra prediction unit 265), and residual values entropy-decoded by the entropy decoding unit 210, i.e., quantized transform coefficients and related parameter information, may be input to the inverse quantization unit 220. Also, among the information decoded by the entropy decoding unit 210, information related to filtering may be provided to the filtering unit 240. Meanwhile, a receiving unit (not shown) for receiving a signal output from the image encoding device may be further provided as an internal / external element of the image decoding device 200, or the receiving unit may be provided as a component of the entropy decoding unit 210.
[0081] Meanwhile, the image decoding device according to the present disclosure may be called a video / image / picture decoding device. The image decoding device may include an information decoder (video / image / picture information decoder) and / or a sample decoder (video / image / picture sample decoder). The information decoder may include an entropy decoding unit 210, and the sample decoder may include at least one of an inverse quantization unit 220, an inverse transform unit 230, an adder 235, a filtering unit 240, a memory 250, an inter prediction unit 260, and an intra prediction unit 265.
[0082] The inverse quantization unit 220 may inverse quantize the quantized transform coefficients to output transform coefficients. The inverse quantization unit 220 may rearrange the quantized transform coefficients in a two-dimensional block format. In this case, the rearrangement may be performed based on a coefficient scan order performed in the image encoding device. The inverse quantization unit 220 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.
[0083] The inverse transform unit 230 can inversely transform the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0084] The prediction unit may perform prediction on a current block and generate a predicted block including a prediction sample for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on the prediction information output from the entropy decoding unit 210, and may determine a specific intra / inter prediction mode (prediction technique).
[0085] The prediction unit can generate a prediction signal based on various prediction methods (techniques) described below, as has been described in the explanation of the prediction unit of the image encoding device 100.
[0086] 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 may be similarly applied to the intra prediction unit 265.
[0087] The inter prediction unit 260 may derive a predicted block for the current block based on a reference block (reference sample array) identified 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 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 further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. 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 for the current block based on the received candidate selection information. Inter prediction may be performed based on various prediction modes (techniques), and the prediction information may include information indicating a mode (technique) of inter prediction for the current block.
[0088] The adder 235 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted sample array) output from a prediction unit (including the inter prediction unit 260 and / or the intra prediction unit 265). The description of the adder 155 may be similarly applied to the adder 235.
[0089] Meanwhile, as will be described later, luma mapping with chroma scaling (LMCS) can be applied during picture decoding.
[0090] The filtering unit 240 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 240 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may 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, an adaptive loop filter, a bilateral filter, etc.
[0091] 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 motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 260 to be used as motion information of a spatial surrounding block or motion information of a temporal surrounding block. The memory 250 may store a reconstructed sample of a reconstructed block in the current picture and transmit it to the intra prediction unit 265.
[0092] In this specification, the embodiments described for the filtering unit 160, inter prediction unit 180 and intra prediction unit 185 of the image encoding device 100 can also be applied in a similar or corresponding manner to the filtering unit 240, inter prediction unit 260 and intra prediction unit 265 of the image decoding device 200, respectively.
[0093] Hereinafter, inter-prediction encoding and inter-prediction decoding will be described with reference to FIGS.
[0094] The image encoding / decoding apparatus may perform inter prediction on a block-by-block basis to derive a prediction sample. Inter prediction may refer to a prediction technique derived in a manner dependent on data elements of a picture(s) other than the current picture. When inter prediction is applied to a current block, a prediction block for the current block may be derived based on a reference block identified by a motion vector on a reference picture.
[0095] At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, motion information of the current block may be derived based on correlation of motion information between neighboring blocks and the current block, and motion information may be derived in units of blocks, sub-blocks, or samples. At this time, the motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction type information. Here, the inter prediction type information may mean direction information of inter prediction. The inter prediction type information may indicate that the current block is predicted using any one of L0 prediction, L1 prediction, and Bi prediction.
[0096] When inter prediction is applied to a current block, the neighboring blocks of the current block may include a spatial neighboring block present in the current picture and a temporal neighboring block present in a reference picture. In this case, a reference picture including a reference block for the current block and a reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated coding unit (colCU), etc. The reference picture including the temporal neighboring block may be called a collocated picture (colPic).
[0097] On the other hand, a motion information candidate list can be constructed based on neighboring blocks of the current block, and at this time, flag or index information indicating which candidate is used to derive a motion vector and / or reference picture index for the current block can be signaled.
[0098] The motion information may include L0 motion information and / or L1 motion information based on an inter prediction type. A motion vector in an L0 direction may be defined as an L0 motion vector or MVL0, and a motion vector in an L1 direction may be defined as an L1 motion vector or MVL1. A prediction based on an L0 motion vector may be defined as an L0 prediction, a prediction based on an L1 motion vector may be defined as an L1 prediction, and a prediction based on both the L0 motion vector and the L1 motion vector may be defined as a bi-prediction. Here, an L0 motion vector may mean a motion vector associated with a reference picture list L0, and an L1 motion vector may mean a motion vector associated with a reference picture list L1.
[0099] The reference picture list L0 may include pictures earlier in the output order than the current picture as reference pictures, and the reference picture list L1 may include pictures later in the output order than the current picture. In this case, the earlier pictures may be defined as forward (reference) pictures, and the later pictures may be defined as backward (reference) pictures. Meanwhile, the reference picture list L0 may further include pictures later in the output order than the current picture. In this case, the earlier pictures may be indexed first in the reference picture list L0, and the later pictures may be indexed next. The reference picture list L1 may further include pictures earlier in the output order than the current picture. In this case, the later pictures may be indexed first in the reference picture list L1, and the earlier pictures may be indexed next. Here, the output order may correspond to a picture order count (POC) order.
[0100] FIG. 4 is a diagram illustrating an example configuration of an inter prediction unit that performs inter prediction coding according to the present disclosure.
[0101] For example, the inter prediction unit shown in FIG. 4 may correspond to the inter prediction unit 180 of the image encoding device of FIG. 2. The inter prediction unit 180 according to the present disclosure may include a prediction mode determination unit 181, a motion information derivation unit 182, and a prediction sample derivation unit 183. The inter prediction unit 180 may receive an original picture to be encoded and a reference picture used for inter prediction as input. The prediction mode determination unit 181 may determine a prediction mode for a current block in the original picture. The motion information derivation unit 182 may derive motion information for the current block. The prediction sample derivation unit 183 may derive a prediction sample by performing inter prediction on the current block. The prediction sample may be expressed by a prediction block of the current block. The inter prediction unit 180 may output information on the prediction mode, information on the motion information, and the prediction sample.
[0102] For example, the inter prediction unit 180 of the image encoding device may search for a block similar to the current block within a certain region (search region) of a reference picture through motion estimation, and derive a reference block whose difference from the current block is minimum or equal to or less than a certain criterion. Based on this, a reference picture index indicating a reference picture in which the reference block is located may be derived, and a motion vector may be derived based on a position difference between the reference block and the current block. The image encoding device may determine a mode to be applied to the current block from among various prediction modes. The image encoding device may compare rate-distortion (RD) costs for the various prediction modes and determine an optimal prediction mode for the current block. However, the method in which the image encoding device determines a prediction mode for the current block is not limited to the above example, and various methods may be used.
[0103] For example, the inter prediction mode for the current block can be determined to be at least one of merge mode, skip mode, Motion Vector Prediction mode (MVP mode), Symmetric Motion Vector Difference (SMVD mode), affine mode, subblock-based merge mode, Adaptive Motion Vector Resolution mode (AMVR mode), History-based Motion Vector Predictor mode (HMVP mode), Pair-wise average merge mode, Merge mode with Motion Vector Differences mode (MMVD mode), Decoder side Motion Vector Refinement mode (DMVR mode), Combined Inter and Intra Prediction mode (CIIP mode), and Geometric Partitioning mode (GPM).
[0104] For example, when a skip mode or a merge mode is applied to a current block, the image encoding apparatus may derive merge candidates from neighboring blocks of the current block and construct a merge candidate list using the induced merge candidates. The image encoding apparatus may also derive a reference block whose difference from the current block is minimum or equal to or less than a certain criterion among reference blocks indicated by 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 apparatus. Motion information of the current block may be derived using motion information of the selected merge candidate.
[0105] As another example, when an MVP mode is applied to the current block, the image encoding apparatus may derive motion vector predictor (MVP) candidates from neighboring blocks of the current block, and may construct an MVP candidate list using the induced MVP candidates. Also, the image encoding apparatus may use a motion vector of an MVP candidate selected from among the MVP candidates included in the MVP candidate list as an MVP of the current block. In this case, for example, a motion vector indicating a reference block derived by the above-mentioned motion estimation may be used as the motion vector of the current block, and an MVP candidate having a motion vector with a minimum difference from the motion vector of the current block among the MVP candidates may become the selected MVP candidate. A motion vector difference (MVD), which is 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 regarding the MVD may be signaled to the image decoding apparatus. Also, when an MVP mode is applied, a value of the reference picture index may be configured as reference picture index information and separately signaled to the image decoding apparatus.
[0106] FIG. 5 is a flowchart illustrating a coding method based on inter prediction.
[0107] For example, the encoding method of FIG. 5 may be performed by the image encoding device of FIG. 2. Specifically, steps S510, S520, and S530 may be performed by the inter prediction unit 180, the residual processing unit (e.g., a subtraction unit), and the entropy encoding unit 190, respectively. At this time, prediction information and residual information to be encoded may be derived by the inter prediction unit 180 and the residual processing unit, respectively. The residual information may include information on quantized transform coefficients for the residual samples. As described above, the residual samples may be derived as transform coefficients through the transform unit 120 of the image encoding device, and the transform coefficients may be derived as quantized transform coefficients through the quantization unit 130. Information on the quantized transform coefficients may be encoded in the entropy encoding unit 190 through a residual coding procedure.
[0108] In step S510, the image encoding apparatus may perform inter prediction on the current block. By performing inter prediction, the image encoding apparatus may derive an inter prediction mode for the current block and motion information for the current block, and generate a prediction sample for the current block. Here, the steps of determining the inter prediction mode, deriving the motion information, and generating the prediction sample may be performed simultaneously, or one of the steps may be performed prior to the other steps.
[0109] In step S520, the image coding apparatus may derive a residual sample based on the predicted sample. The image coding apparatus may derive the residual sample based on the original sample of the current block and the predicted sample. For example, the residual sample may be derived by subtracting a corresponding predicted sample from an original sample.
[0110] In step S530, the image encoding apparatus may encode image information including prediction information and residual information. The image encoding apparatus may output the encoded image information in a bitstream format. The prediction information may include prediction mode information (e.g., a skip flag, a merge flag, or a mode index) and information on motion information, which are information related to the prediction procedure. The skip flag of the prediction mode information is information indicating whether a skip mode is applied to the current block, and the merge flag is information indicating whether a merge mode is applied to the current block. Alternatively, the prediction mode information may be information indicating one of a plurality of prediction modes, such as a mode index. If the skip flag and the merge flag are each 0, it may be determined that the MVP mode is applied to the current block. The information on the motion information may include candidate selection information (e.g., a merge index, an MVP flag, or an MVP index), which is information for deriving a motion vector. The merge index of the candidate selection information may be signaled when a merge mode is applied to the current block, and may be information for selecting one of the merge candidates included in a merge candidate list. Among the candidate selection information, the MVP flag or 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 included in the MVP candidate list. Specifically, the MVP flag may be signaled using a syntax element mvp_l0_flag or mvp_l1_flag. In addition, the information on the motion information may include the above-mentioned information on the MVD and / or reference picture index information. In addition, the information on the motion information may include information indicating whether L0 prediction, L1 prediction, or Bi-prediction is applied. The residual information is information on the residual sample.The residual information may include information regarding quantized transform coefficients for the residual samples.
[0111] The output bitstream may be stored on a (digital) storage medium and transmitted to the image decoding device, or may be transmitted to the image decoding device via a network.
[0112] Meanwhile, as described above, the image coding apparatus can generate a reconstructed picture (a picture including reconstructed samples and reconstructed blocks) based on the reference samples and the residual samples. This is because the image coding apparatus derives the same prediction result as that performed by the image decoding apparatus, thereby improving coding efficiency. Therefore, the image coding apparatus can store the reconstructed picture (or reconstructed samples, reconstructed blocks) in a memory and use it as a picture for inter prediction. As described above, an in-loop filtering procedure can be further applied to the reconstructed picture.
[0113] FIG. 6 is a diagram illustrating an example configuration of an inter prediction unit that performs inter prediction decoding according to the present disclosure.
[0114] For example, the inter prediction unit illustrated in FIG. 6 may correspond to the inter prediction unit 260 of the image decoding device of FIG. 3. The inter prediction unit 260 according to the present disclosure may include a prediction mode determination unit 261, a motion information derivation unit 262, and a prediction sample derivation unit 263. The inter prediction unit 260 may receive, as input, information on the prediction mode of the current block, information on the motion information of the current block, and a reference picture used for inter prediction. The prediction mode determination unit 261 may determine a prediction mode for the current block based on the information on the prediction mode. The motion information derivation unit 262 may derive motion information (such as a motion vector and / or a reference picture index) for the current block based on the information on the motion information. The prediction sample derivation unit 263 may derive a prediction sample by performing inter prediction on the current block. The prediction sample may be expressed as a prediction block of the current block. The inter prediction unit 260 may output the derived prediction sample.
[0115] FIG. 7 is a flowchart illustrating a decoding method based on inter prediction.
[0116] For example, the decoding method of Fig. 7 may be performed by the image decoding apparatus of Fig. 3. The image decoding apparatus may perform operations corresponding to those performed by the image encoding apparatus. The image decoding apparatus may perform prediction for a current block based on received prediction information and derive predicted samples.
[0117] Specifically, steps S710 to S730 may be performed by the inter prediction unit 260, and the prediction information of step S710 and the residual information of step S740 may be obtained from a bitstream by the entropy decoding unit 210. Step S740 may be performed by a residual processing unit of the image decoding device. Specifically, the inverse quantization unit 220 of the residual processing unit may derive transform coefficients by performing inverse quantization on quantized transform coefficients derived based on the residual information, and the inverse transform unit 230 of the residual processing unit may derive residual samples for the current block by performing inverse transform on the transform coefficients. Step S750 may be performed by the adder 235 or a reconstruction unit.
[0118] In step S710, the image decoding apparatus may determine a prediction mode for the current block based on the received prediction information. 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.
[0119] For example, it may be determined whether the skip mode is applied to the current block based on the skip flag. Also, it may be determined whether the merge mode or the MVP mode is applied to the current block based on the merge flag. Or, it may select one of various inter prediction mode candidates based on the mode index. The inter prediction mode candidates may include skip mode, merge mode, and / or MVP mode, or may include various inter prediction modes described below.
[0120] In step 720, the image decoding apparatus may derive motion information of the current block based on the determined inter prediction mode. For example, when a skip mode or a merge mode is applied to the current block, the image decoding apparatus may form a merge candidate list (described later) and select one of the merge candidates included in the merge candidate list. The selection may be performed based on the candidate selection information (merge index) described above. The motion information of the current block may be derived using motion information of the selected merge candidate. For example, the motion information of the selected merge candidate may be used as motion information of the current block.
[0121] As another example, when the MVP mode is applied to the current block, the image decoding apparatus may construct an MVP candidate list, and may use a motion vector of an MVP candidate selected from among 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 information on the MVD, and the motion vector of the current block may be derived based on the MVP of the current block and the MVD. Also, the reference picture index of the current block may be derived based on the reference picture index information. A picture pointed to by the reference picture index in a reference picture list for the current block may be derived as a reference picture referenced for inter prediction of the current block.
[0122] In step S730, the image decoding apparatus may generate a prediction sample for the current block based on the motion information of the current block. In this case, the reference picture may be derived based on a reference picture index of the current block, and the prediction sample of the current block may be derived using a sample of a reference block to which the motion vector of the current block points on the reference picture. Depending on the case, a prediction sample filtering procedure may be further performed on all or some of the prediction samples of the current block.
[0123] In step S740, the image decoding apparatus may generate a residual sample for the current block based on the received residual information.
[0124] In step S750, the image decoding apparatus may generate a reconstructed sample for the current block based on the predicted sample and the residual sample, and generate a reconstructed picture based on the reconstructed sample, after which an in-loop filtering procedure may be further applied to the reconstructed picture.
[0125] The motion information derivation step according to the prediction mode will be described in more detail below.
[0126] As described above, inter prediction can be performed using motion information of a current block. The image coding apparatus can derive optimal motion information for the current block through a motion estimation procedure. The derived motion information can be signaled to the image decoding apparatus in various ways based on the inter prediction mode.
[0127] When a merge mode is applied to a current block, the motion information of the current block is not directly transmitted, but is derived using the motion information of the neighboring blocks. Thus, the motion information of the current prediction block can be indicated by transmitting 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 this disclosure, since the current block is a unit of prediction execution, the current block can be used in the same sense as the current prediction block, and the neighboring block can be used in the same sense as the neighboring prediction block.
[0128] The image encoding apparatus may search for a merge candidate block used to derive motion information of a current block to perform a merge mode. For example, the number of merge candidate blocks may be up to, but is not limited to, 5. The maximum number of merge candidate blocks may be transmitted from a slice header or a tile group header, but is not limited to this. After finding the merge candidate blocks, the image encoding apparatus may generate a merge candidate list, and may select a merge candidate block having the smallest RD cost as a final merge candidate block.
[0129] The present disclosure provides various embodiments for the merge candidate blocks constituting the 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.
[0130] FIG. 8 is a diagram illustrating neighboring blocks used as spatial merging candidates.
[0131] As shown in Fig. 8, the spatial peripheral blocks used as spatial merging candidates may include a lower left corner peripheral block A0, a left side peripheral block A1, a upper right corner peripheral block B0, an upper side peripheral block B1, and an upper left corner peripheral block B2 of the current block. However, this is merely an example, and additional peripheral blocks such as a right side peripheral block, a lower side peripheral block, and a lower right side peripheral block may be used as the spatial peripheral blocks other than the spatial peripheral blocks shown in Fig. 8.
[0132] FIG. 9 is a diagram illustrating a merge candidate list construction method according to an example of the present disclosure.
[0133] The image encoding device / image decoding device can insert the spatial merge candidates derived by searching the spatial neighboring blocks of the current block into the merge candidate list (S910). The image encoding device / image decoding device can detect available blocks by searching the spatial neighboring blocks based on priority, and derive motion information of the detected blocks as the spatial merge candidates. For example, the image encoding device / image decoding device can construct the merge candidate list by searching the five blocks shown in FIG. 8 in the order of A1, B1, B0, A0, and B2, and sequentially indexing the available candidates.
[0134] Hereinafter, a method for deriving spatial candidates in the merge mode and / or skip mode will be described in more detail. The spatial candidates may indicate the spatial merge candidates described above.
[0135] The spatial candidate may be derived based on spatial neighboring blocks. As an example, up to four spatial candidates may be derived from the candidate blocks present at the positions shown in FIG. 8. The order of deriving the spatial candidates may be A1→B1→B0→A0→B2. However, the order of deriving the spatial candidates is not limited to the above order, and may be, for example, B1→A1→B0→A0→B2. The last position in the order (position B2 in the above example) may be considered when at least one of the preceding four positions (A1, B1, B0, and A0 in the above example) is unavailable. In this case, the fact that a block at a certain position is unavailable may include a case where the corresponding block belongs to a different slice or a different tile from the current block, or the corresponding block is an intra-predicted 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 the subsequent positions. For example, if the motion information of a subsequent spatial candidate is the same as the motion information of a spatial candidate already included in the merge candidate list, the subsequent spatial candidate is not included in the merge candidate list, thereby improving coding efficiency. Redundancy checks performed on subsequent spatial candidates are not performed on all candidate pairs as much as possible, but are performed only on some candidate pairs, thereby reducing computational complexity.
[0136] For example, when spatial candidates are induced in the order of B1→A1→B0→A0→B2, a redundancy check for a spatial candidate at A1 position may be performed only for the spatial candidate at B1 position. Also, a redundancy check for a spatial candidate at B0 position may be performed only for the spatial candidate at B1 position. Also, a redundancy check for a spatial candidate at A0 position may be performed only for the spatial candidate at A1 position. Finally, a redundancy check for a spatial candidate at B2 position may be performed only for the spatial candidates at B1 and A1 positions. However, without being limited thereto, even if the order of deriving spatial candidates is changed, a redundancy check may be performed only for some candidate pairs as described above.
[0137] Referring again to FIG. 9, the image coding apparatus / image decoding apparatus may insert a temporal merge candidate derived by searching for a temporal peripheral block of the current block into the merge candidate list (S920). The temporal peripheral block may be located on a reference picture that is a picture different from the current picture in which the current block is located. The reference picture in which the temporal peripheral block is located may be called a collocated picture or a col picture. The temporal peripheral block may be searched in the order of a lower right corner peripheral block (C0 block) and a lower right center block (C1 block) of a co-located block with respect to the current block on the col picture. That is, first, it is determined whether the C0 block is available, and if the C0 block is available, a temporal candidate may be derived based on the C0 block. If the C0 block is not available, a temporal candidate may be derived based on the C1 block. For example, if the C0 block is an intra-predicted block or exists outside the current CTU row, it may be determined that the C0 block is not available. Meanwhile, when motion data compression is applied to reduce memory load, specific motion information can be stored as representative motion information for each certain storage unit for the col picture. In this case, it is not necessary to store motion information for all blocks in the certain storage unit, and thus a motion data compression effect can be obtained. In this case, the certain storage unit can be predetermined, for example, a 16×16 sample unit or an 8×8 sample unit, or size information for the certain storage unit can be signaled from the image encoding device to the image decoding device. When the motion data compression is applied, the motion information of the temporal peripheral block can be replaced with the representative motion information of the certain storage unit in which the temporal peripheral block is located.That is, in this case, from the perspective of implementation, instead of the prediction block lock located at the coordinates of the time surrounding block, based on the coordinates (upper left sample position) of the time surrounding block, after arithmetic right shift by a certain value, the motion information of the prediction block covering the position after arithmetic left shift can be used to derive the time merge candidate. For example, the certain storage unit is 2. n ×2 n When it is a sample unit, if the coordinates of the time surrounding block are (xTnb, yTnb), the motion information of the prediction block located at the corrected position ((xTnb>>n)<<n), (yTnb>>n)<<n)) can be used for the time merge candidate. Specifically, for example, when the certain storage unit is 16×16 sample units, if the coordinates of the time surrounding block are (xTnb, yTnb), the motion information of the prediction block located at the corrected position ((xTnb>>4)<<4), (yTnb>>4)<<4)) can be used for the time merge candidate. Or, for example, when the certain storage unit is 8×8 sample units, if the coordinates of the time surrounding block are (xTnb, yTnb), the motion information of the prediction block located at the corrected position ((xTnb>>3)<<3), (yTnb>>3)<<3)) can be used for the time merge candidate.
[0138] Hereinafter, in the case of the merge mode and / or skip mode, the method for inducing time candidates will be described more specifically. The time candidates can indicate the time merge candidates described above. Also, the motion vector of the time candidates can also correspond to the time candidates in the MVP mode.
[0139] Only one temporal candidate may be included in the merge candidate list. In the process of deriving the temporal candidate, the motion vector of the temporal candidate may be scaled. For example, the scaling may be performed based on a child located block (colocated CU) (hereinafter referred to as a "col block") belonging to a collocated reference picture (colPic) (hereinafter referred to as a "col picture"). More specifically, the scaling may be performed based on a distance (tb) between a reference picture of the current block and the current picture and a distance (td) between a reference picture of the col block and the col picture. The tb and td may be expressed as values corresponding to a difference in POC (Picture Order Count) between pictures. The reference picture list used to derive the col block may be explicitly signaled in the slice header.
[0140] Referring again to FIG 9, the image coding apparatus / image decoding apparatus may check whether the number of current merging candidates is smaller than the number of maximum merging candidates (S930). The number of maximum merging candidates may be predefined or may be signaled from the image coding apparatus to the image decoding apparatus. For example, the image coding apparatus may generate information regarding the number of maximum merging candidates, encode it, and transmit it to the image decoding apparatus in a bitstream format. If the number of maximum merging candidates is full, the subsequent candidate addition process (S940) may not be performed.
[0141] If it is determined in step S930 that the number of the current merge candidates is smaller than the maximum number of merge candidates, the image encoding / decoding apparatus may derive additional merge candidates based on a predetermined scheme and insert the additional merge candidates into the merge candidate list (S940). The additional merge candidates may include at least one of history based merge candidate(s), pair-wise average merge candidate(s), ATMVP, combined bi-predictive merge candidate (if the slice / tile group type of the current slice / tile group is type B), and / or zero vector merge candidate.
[0142] As a result of the check in step S930, if the number of the current merging candidates is not smaller than the maximum number of merging candidates, the image encoding device / image decoding device may end construction of the merging candidate list. In this case, the image encoding device may select an optimal merging candidate from among the merging candidates constituting the merging candidate list based on an RD cost, and may signal candidate selection information (e.g., a merge candidate index) indicating the selected merging candidate to the image decoding device. The image decoding device may select the optimal merging candidate based on the merging candidate list and the candidate selection information.
[0143] As described above, the motion information of the selected merging candidate may be used as the motion information of the current block, and a predicted sample of the current block may be derived based on the motion information of the current block. The image encoding apparatus may derive a residual sample of the current block based on the predicted sample, and may signal residual information regarding the residual sample to an image decoding apparatus. As described above, the image decoding apparatus may generate a reconstructed sample based on the residual sample derived based on the residual information and the predicted sample, and generate a reconstructed picture based on the reconstructed sample.
[0144] When a skip mode is applied to a current block, motion information of the current block can be derived in the same manner as when a merge mode is applied to the previous block. However, when the skip mode is applied, the residual signal for the block is omitted. Therefore, the predicted samples can be used immediately as reconstructed samples. The skip mode can be applied, for example, when the value of cu_skip_flag is 1.
[0145] Hereinafter, a method for deriving history-based candidates in the merge mode and / or skip mode will be described. History-based candidates can be expressed as history-based merge candidates.
[0146] History-based candidates may be added to the merge candidate list after spatial and temporal candidates are added to the merge candidate list. For example, motion information of a previously encoded / decoded block is stored in a table and can be used as a history-based candidate for a current block. The table can store a number of history-based candidates during the encoding / decoding process. The table can be initialized when a new CTU row starts. Initializing the table can mean that all history-based candidates stored in the table are deleted and the table becomes empty. Whenever there is an inter-predicted block, associated motion information can be added to the table as the last entry. In this case, the inter-predicted block may not be a block predicted based on a sub-block. The motion information added to the table can be used as a new history-based candidate.
[0147] 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 5 history-based candidates. When a new candidate is added to the table, a restricted first-in-first-out (FIFO) rule may be applied in which a redundancy check is first performed to see if the same candidate exists in the table. If the same candidate already exists in the table, the same candidate may be removed from the table and the positions of all subsequent history-based candidates may be moved forward.
[0148] The history-based candidate can be used in the process of constructing a merge candidate list. In this case, the history-based candidate most recently included in the table is checked in sequence and can be included in the merge candidate list at a position after the temporal candidate. When the history-based candidate is included in the merge candidate list, a redundancy check with the spatial candidate or the temporal candidate already included in the merge candidate list can be performed. If the history-based candidate overlaps with the spatial candidate or the temporal candidate already included in the merge candidate list, the history-based candidate can be excluded from the merge candidate list. The redundancy check can be simplified as follows to reduce the amount of calculation.
[0149] The number of history-based candidates used to generate the merge candidate list can be set to (N<=4)?M:(8-N), where N is the number of candidates already included in the merge candidate list and M is the number of available history-based candidates stored in the table. That is, if the merge candidate list includes four or fewer candidates, the number of history-based candidates used to generate the merge candidate list is M, and if the merge candidate list includes N candidates, which is greater than four, the number of history-based candidates used to generate the merge candidate list can be set to (8-N).
[0150] When the total number of available merge candidates reaches (maximum allowed number of merge candidates - 1), construction of the merge candidate list using history-based candidates can be terminated.
[0151] Hereinafter, a method for deriving pair-wise average candidates in the merge mode and / or skip mode will be described. The pair-wise average candidates can be expressed as pair-wise average merge candidates or pair-wise candidates.
[0152] Pair-wise average candidates may be generated by obtaining already-defined candidate pairs from candidates included in the merge candidate list and averaging them. The already-defined candidate pairs are {(0,1), (0,2), (1,2), (0,3), (1,3), (2,3)}, and the numbers constituting each candidate pair may be indexes of the merge candidate list. That is, the already-defined candidate pair (0,1) means a pair of index 0 candidate and index 1 candidate in the merge candidate list, and the pair-wise average candidate may be generated by averaging the index 0 candidate and the index 1 candidate. The pair-wise average candidates may be derived in the order of the already-defined candidate pairs. That is, after deriving a pair-wise average candidate for the candidate pair (0,1), a pair-wise average candidate derivation process may be performed in the order of the candidate pair (0,2) and the candidate pair (1,2). The pair-wise average candidate derivation process may be performed until the configuration of the merge candidate list is completed. For example, the pair-wise average candidate derivation process may be performed until the number of merging candidates included in the merging candidate list reaches the maximum number of merging candidates.
[0153] Pair-wise average candidates can be calculated separately for each reference picture list. If two motion vectors are available for one reference picture list (L0 list or L1 list), the average of these two motion vectors can be calculated. In this case, the average of the two motion vectors can be calculated even if the two motion vectors point to different reference pictures. If only one motion vector is available for one reference picture list, the available motion vector can be used as a pair-wise average candidate motion vector. If all two motion vectors are not available for one reference picture list, it can be determined that the reference picture list is invalid.
[0154] If the construction of the merge candidate list is not complete even after the pair-wise average candidates are included in the merge candidate list, zero vectors can be added to the merge candidate list until the maximum number of merge candidates is reached.
[0155] When the MVP mode is applied to the current block, a motion vector predictor (mvp) candidate list can be generated using the motion vector of the restored spatial surrounding block (e.g., the surrounding block shown in FIG. 8) and / or the motion vector corresponding to the temporal surrounding block (or Col block). That is, the motion vector of the restored spatial surrounding block and / or the motion vector corresponding to the temporal surrounding block can be used as a motion vector predictor candidate of the current block. When bi-prediction is applied, an mvp candidate list for deriving L0 motion information and an mvp candidate list for deriving L1 motion information can be generated and used separately. Prediction information (or prediction information) for the current block can include candidate selection information (e.g., an MVP flag or an MVP index) indicating an optimal motion vector predictor candidate selected from the motion vector predictor candidates included in the mvp candidate list. In this case, the prediction unit can select a motion vector predictor of the current block from the motion vector predictor candidates included in the mvp candidate list using the candidate selection information. The prediction unit of the image encoding device may obtain a motion vector difference (MVD) between a motion vector of a current block and a motion vector predictor, and may encode the obtained motion vector difference and output the motion vector difference in a bitstream format. That is, the MVD may 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 a motion vector difference included in information related to the prediction, and derive the motion vector of the current block by adding the motion vector difference and the motion vector predictor. The prediction unit of the image decoding device may obtain or induce a reference picture index indicating a reference picture, etc., from information related to the prediction.
[0156] FIG. 10 is a diagram illustrating a motion vector predictor candidate list construction method according to an example of the present disclosure.
[0157] First, the spatial candidate blocks of the current block can be searched and available candidate blocks can be inserted into the MVP candidate list (S1010). Then, it is determined whether the MVP candidate list contains less than two MVP candidates (S1020). If there are two, the construction of the MVP candidate list can be completed.
[0158] In step S1020, if there are less than two spatial candidate blocks available, the temporal candidate blocks of the current block may be searched for and the available candidate blocks may be inserted into the MVP candidate list (S1030). If no temporal candidate blocks are available, the construction of the MVP candidate list may be completed by inserting a zero motion vector into the MVP candidate list (S1040).
[0159] On the other hand, when the MVP mode is applied, the reference picture index may be explicitly signaled. In this case, a picture index (refidxL0) for L0 prediction and a reference picture index (refidxL1) for L1 prediction may be signaled separately. For example, when the MVP mode is applied and bi-prediction (BI prediction) is applied, information on refidxL0 and information on refidxL1 may both be signaled.
[0160] As described above, when the MVP mode is applied, information on the MVD derived from the image coding apparatus may be signaled to the image decoding apparatus. The information on the MVD may include, for example, information indicating x, y components for the MVD absolute value and the sign. In this case, information indicating whether the MVD absolute value is greater than 0 and greater than 1, and the rest of the MVD may be signaled stepwise. For example, information indicating whether the MVD absolute value is greater than 1 may be signaled only when the value of flag information indicating whether the MVD absolute value is greater than 0 is 1.
[0161] Hereinafter, the affine mode, which is an example of an inter prediction mode, will be described in detail. In a conventional video encoding / decoding system, only one motion vector is used to represent motion information of a current block, but this method has a problem in that it only represents optimal motion information in block units, and cannot represent optimal motion information in pixel units. To solve this problem, an affine mode that defines motion information of a block in pixel units has been proposed. According to the affine mode, a pixel / sub-block unit motion vector of a block can be determined using two to four motion vectors associated with the current block.
[0162] Conventionally, motion information is expressed using a translation (or displacement) of pixel values, but in the affine mode, pixel-specific motion information can be expressed using at least one of translation, scaling, rotation, and shear. Among them, the affine mode in which pixel-specific motion information is expressed using a displacement, scaling, and rotation can be defined as a similarity or simplified affine mode. In the following description, the affine mode can mean a similarity or simplified affine mode.
[0163] Motion information in affine mode can be expressed using two or more CPMVs (Control Point Motion Vectors). A motion vector for a specific pixel position of the current block can be derived using the CPMV. In this case, a set of pixel-wise and / or sub-block-wise motion vectors of the current block can be defined as an Affine Motion Vector Field (Affine MVF).
[0164] FIG. 11 is a diagram for explaining a four-parameter model of an affine mode.
[0165] FIG. 12 is a diagram for explaining a six-parameter model of an affine mode.
[0166] When an affine mode is applied to a current block, an affine MVF can be derived using one of a 4-parameter model and a 6-parameter model. In this case, the 4-parameter model can refer to a model type in which two CPMVs (v0, v1) are used, as shown in FIG 11. Also, the 6-parameter model can refer to a model type in which three CPMVs (v0, v1, v2) are used, as shown in FIG 12.
[0167] When the position of the current block is defined as (x, y), a motion vector according to a pixel position can be derived according to the following Equation 1 or 2. For example, a motion vector according to a 4-parameter model can be derived according to Equation 1, and a motion vector according to a 6-parameter model can be derived according to Equation 2.
[0168]
number
[0169]
number
[0170] In Equation 1 and Equation 2, mv0={mv_0x, mv_0y} may be a CPMV at the upper left corner of the current block, v1={mv_1x, mv_1y} may be a CPMV at the upper right corner of the current block, and mv2={mv_2} may be a CPMV at the lower left position of the current block, where W and H correspond to the width and height of the current block, respectively, and mv={mv_x, mv_y} may represent a motion vector at pixel position {x, y}.
[0171] In the encoding / decoding process, the affine MVF may be determined in pixel units and / or in predefined subblock units. When the affine MVF is determined in pixel units, a motion vector may be derived based on each pixel value. Meanwhile, when the affine MVF is determined in subblock units, a motion vector of the block may be derived based on a central pixel value of the subblock. The central pixel value may refer to a virtual pixel located at the center of the subblock, or may refer to a lower right pixel among four pixels located in the center. Also, the central pixel value may be a specific pixel within the subblock, which represents the subblock. In the present disclosure, a case will be described in which the affine MVF is determined in 4×4 subblock units. However, this is for convenience of explanation, and the size of the subblock may be variously changed.
[0172] That is, when affine prediction is available, the motion model applicable to the current block may include three, namely, a translational motion model, a 4-parameter affine motion model, and a 6-parameter affine motion model. Here, the translational motion model may indicate a model in which a conventional block-based motion vector is used, the 4-parameter affine motion model may indicate a model in which two CPMVs are used, and the 6-parameter affine motion model may indicate a model in which three CPMVs are used. The affine mode may be divided into detailed modes according to a method of encoding / decoding motion information. As an example, the affine mode may be subdivided into an affine MVP mode and an affine merge mode.
[0173] When the affine merge mode is applied to the current block, the CPMV can be derived from the neighboring blocks of the current block that are encoded / decoded in the affine mode. When at least one of the neighboring blocks of the current block is encoded / decoded in the affine mode, the affine merge mode can be applied to the current block. That is, when the affine merge mode is applied to the current block, the CPMV of the current block can be derived using the CPMV of the neighboring blocks. For example, the CPMV of the neighboring blocks can be determined as the CPMV of the current block, or the CPMV of the current block can be derived based on the CPMV of the neighboring blocks. When the CPMV of the current block is derived based on the CPMV of the neighboring blocks, at least one of the coding parameters of the current block or the neighboring blocks can be used. For example, the CPMV of the neighboring blocks can be modified based on the size of the neighboring blocks and the size of the current block, and used as the CPMV of the current block.
[0174] Meanwhile, in the case of affine merge in which MV is derived in subblock units, it may be called a subblock merging mode, which may be indicated by merge_subblock_flag having a first value (e.g., "1"). In this case, an affine merging candidate list (described later) may also be called a subblock merging candidate list. In this case, the subblock merging candidate list may further include a candidate derived by SbTMVP (described later). In this case, the candidate derived by sbTMVP may be used as a candidate for the 0th index of the subblock merging candidate list. In other words, the candidate derived by sbTMVP may be located before inherited affine candidates and constructed affine candidates (described later) in the subblock merging candidate list.
[0175] As an example, an affine mode flag can be defined to indicate whether affine mode is applicable to the current block, which can be signaled at at least one level above the current block, such as a sequence, picture, slice, tile, tile group, brick, etc. For example, the affine mode flag can be named sps_affine_enabled_flag.
[0176] When the affine merge mode is applied, an affine merge candidate list can be configured for CPMV induction of the current block. In this case, the affine merge candidate list can include at least one of an inherited affine merge candidate, a combined affine merge candidate, and a zero merge candidate. The inherited affine merge candidate can mean a candidate derived using the CPMV of a neighboring block of the current block when the neighboring block is encoded / decoded in the affine mode. The combined affine merge candidate can mean a candidate whose CPMV is derived based on the motion vector of a neighboring block of each CP (Control Point). Meanwhile, the zero merge candidate can mean a candidate consisting of a CPMV of size 0. In the following description, a CP can mean a specific position of a block used to derive a CPMV. For example, a CP can be each vertex position of a block.
[0177] FIG. 13 is a diagram for explaining a method for generating an affine merge candidate list.
[0178] 13, affine merge candidates can be added to the affine merge candidate list in the following order: inheritance affine merge candidate (S1310), combined affine merge candidate (S1320), and zero merge candidate (S1330). Zero merge candidates can be added when the number of candidates in the candidate list does not satisfy the maximum number of candidates, even though all inheritance affine merge candidates and combined affine merge candidates have been added to the affine merge candidate list. In this case, zero merge candidates can be added until the number of candidates in the affine merge candidate list satisfies the maximum number of candidates.
[0179] FIG. 14 is a diagram for explaining a method of deriving inheritance affine merge candidates from surrounding blocks.
[0180] As an example, up to two inherited affine merge candidates can be derived, and each candidate can be derived based on at least one of the left peripheral block and the upper peripheral block. The peripheral blocks for deriving the inherited affine merge candidates will be described with reference to FIG. 8. The inherited affine merge candidate derived based on the left peripheral block can be derived based on at least one of A0 and A1, and the inherited affine merge candidate derived based on the upper peripheral block can be derived based on at least one of B0, B1, and B2. In this case, the scan order of each peripheral block can be, but is not limited to, the order of A0 to A1 and the order of B0 to B1, B2. The inherited affine merge candidate can be derived based on the first peripheral block available in the scan order for each of the left and upper sides. In this case, a redundancy check may not be performed between the candidates derived from the left peripheral block and the upper peripheral block.
[0181] 14, if the left neighboring block A is encoded / decoded in an affine mode, at least one of motion vectors v2, v3, and v4 corresponding to the CP of the neighboring block A can be derived. If the neighboring block A is encoded / decoded via a 4-parameter affine model, the inherited affine merge candidate can be derived using v2 and v3. On the other hand, if the neighboring block A is encoded / decoded via a 6-parameter affine model, the inherited affine merge candidate can be derived using v2, v3, and v4.
[0182] FIG. 15 is a diagram for explaining surrounding blocks for deriving combination affine merge candidates.
[0183] The combination affine candidate may refer to a candidate for which a CPMV is derived using a combination of common motion information of neighboring blocks. The motion information for 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 refer to a motion vector representing the k-th CP. For example, referring to FIG. 15, CPMV1 may be determined as the first available motion vector among the motion vectors of B2, B3, and A2, and the scan order at this time may be B2, B3, A2. CPMV2 may be determined as the first available motion vector among the motion vectors of B1 and B0, and the scan order at this time may be B1, B0. CPMV3 may be determined as the first available motion vector among the motion vectors of A1 and A0, and the scan order at this time may be A1, A0. If TMVP is applicable to the current block, CPMV4 may be determined as the motion vector of T, which is a temporal neighboring block.
[0184] After the four motion vectors for each CP are derived, a combined affine merge candidate can be derived based on the four motion vectors. The combined affine merge candidate can be configured to include at least two motion vectors selected from the four motion vectors for each CP derived. As an example, the combined affine merge candidate can be configured to include at least one of the following orders: {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, and {CPMV1, CPMV3}. The combined affine candidate consisting of three motion vectors can be a candidate for a six-parameter affine model. In contrast, the combined affine candidate consisting of two motion vectors can be a candidate for a four-parameter affine model. In order to avoid a motion vector scaling process, if the reference picture indexes of the CPs are different, the combination of the associated CPMVs can be ignored and not used in deriving the combined affine candidate.
[0185] When the affine MVP mode is applied to the current block, the image coding apparatus may derive two or more CPMV predictors and CPMV for the current block and derive CPMV differences based on the CPMV predictors and CPMV differences. In this case, the CPMV differences may be signaled from the coding apparatus to the decoding apparatus. The image decoding apparatus may derive a CPMV predictor for the current block, restore the signaled CPMV differences, and then derive the CPMV of the current block based on the CPMV predictors and CPMV differences.
[0186] Meanwhile, the affine MVP mode can be applied to the current block only if the affine merge mode or sub-block based TMVP is not applied to the current block. Meanwhile, the affine MVP mode can also be expressed as an affine CP MVP mode.
[0187] When affine MVP is applied to the current block, an affine MVP candidate list can be constructed for guiding CPMV for the current block, where the affine MVP candidate list can include at least one of an inheritance affine MVP candidate, a combination affine MVP candidate, a translation affine MVP candidate, and a zero MVP candidate.
[0188] In this case, the inherited affine MVP candidate may refer to 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 combined affine MVP candidate may refer to a candidate derived by generating a CPMV combination based on the motion vector of a CP neighboring block. The zero MVP candidate may refer to a candidate consisting of a CPMV of value 0. The methods and features of deriving the inherited affine MVP candidate and the combined affine MVP candidate are the same as those of the inherited affine candidate and the combined affine candidate described above, and therefore will not be described.
[0189] If the maximum number of candidates in the affine MVP candidate list is 2, then a combined affine MVP candidate, a translation affine MVP candidate, and a zero MVP candidate can be added if the current number of candidates is less than 2. In particular, the translation affine MVP candidates can be derived according to the following order:
[0190] As an example, if the number of candidates included in the affine MVP candidate list is less than two and the combined affine MVP candidate CPMV0 is valid, CPMV0 can be used as the affine MVP candidate, i.e., an affine MVP candidate whose motion vectors for CP0, CP1, and CP2 are all CPMV0 can be added to the affine MVP candidate list.
[0191] Next, if the number of candidates in the affine MVP candidate list is less than two and the combined affine MVP candidate CPMV1 is valid, CPMV1 can be used as the affine MVP candidate. That is, an affine MVP candidate whose motion vectors for CP0, CP1, and CP2 are all CPMV1 can be added to the affine MVP candidate list.
[0192] Next, if the number of candidates in the affine MVP candidate list is less than two and CPMV2 of the combined affine MVP candidate is valid, CPMV2 can be used as the affine MVP candidate. That is, an affine MVP candidate whose motion vectors of CP0, CP1, and CP2 are all CPMV2 can be added to the affine MVP candidate list.
[0193] Despite the above conditions, if the number of candidates in the affine MVP candidate list is less than two, the temporal motion vector predictor (TMVP) of the current block can be added to the affine MVP candidate list.
[0194] If the number of candidates in the affine MVP candidate list is less than two despite the addition of the translation affine MVP candidate, a zero MVP candidate can be added to the affine MVP candidate list.
[0195] FIG. 16 is a diagram for explaining a method for generating an affine MVP candidate list.
[0196] 16, candidates can be added to the affine MVP candidate list in the following order: inheritance affine MVP candidate (S1610), combination affine MVP candidate (S1620), translation affine MVP candidate (S1630), and zero MVP candidate (S1640). As described above, steps S1620 to S1640 can be performed depending on whether the number of candidates included in the affine MVP candidate list at each step is less than two.
[0197] The scan order of the inherited affine MVP candidates may be the same as the scan order of the inherited affine merge candidates. However, for the inherited affine MVP candidates, only the neighboring blocks that refer to the same reference picture as the reference picture of the current block can be considered. When adding the inherited affine MVP candidates to the affine MVP candidate list, no redundancy check may be performed.
[0198] To derive a combined affine MVP candidate, only the spatially neighboring blocks shown in Figure 15 can be considered. Also, the scan order of the combined affine MVP candidate can be the same as the scan order of the combined affine merge candidate. Furthermore, to derive a combined affine MVP candidate, the reference picture indexes of the neighboring blocks are checked, and the first neighboring block in the scan order that is inter-coded and refers to the same reference picture as the reference picture of the current block can be used.
[0199] Hereinafter, a sub-block-based TMVP mode, which is an example of an inter prediction mode, will be described in detail. According to the sub-block-based TMVP mode, a motion vector field (MVF) for a current block is derived, so that a motion vector can be derived in units of sub-blocks.
[0200] Unlike the conventional TMVP mode, which is performed in units of coding units, the coding unit to which the sub-block-based TMVP mode is applied can perform coding / decoding of motion vectors in units of sub-coding units. In addition, while the conventional TMVP mode derives a temporal motion vector from a collocated block, the sub-block-based TMVP mode can derive a motion vector field from a reference block indicated by a motion vector derive from a neighboring block of the current block. Hereinafter, the motion vector derive from the neighboring block can be referred to as a motion shift or representative motion vector of the current block.
[0201] FIG. 17 is a diagram for explaining peripheral blocks in the sub-block-based TMVP mode.
[0202] When the sub-block-based TMVP mode is applied to the current block, a neighboring block for determining a motion shift can be determined. As an example, scanning of neighboring blocks for determining a motion shift can be performed in the order of A1, B1, B0, and A0 blocks in FIG. 17. As another example, the neighboring block for determining a motion shift can be limited to a specific neighboring block of the current block. For example, the neighboring block for determining a motion shift can always be determined as the A1 block. If the neighboring block has a motion vector that references a col picture, the motion vector can be determined as a motion shift. The motion vector determined as a motion shift can also be referred to as a temporal motion vector. On the other hand, if the above-mentioned motion vector cannot be derived from the neighboring block, the motion shift can be set to (0,0).
[0203] FIG. 18 is a diagram for explaining a method of deriving a motion vector field according to the sub-block-based TMVP mode.
[0204] Next, a reference block on the collocated picture indicated by the motion shift can be determined. For example, by adding the motion shift to the coordinates of the current block, subblock-based motion information (motion vector, reference picture index) can be obtained from the col picture. In the example shown in FIG. 18, it is assumed that the motion shift is the motion vector of the A1 block. By applying the motion shift to the current block, subblocks (col subblocks) in the col picture corresponding to each subblock constituting the current block can be identified. Then, motion information of each subblock of the current block can be derived using motion information of the corresponding subblock (col subblock) of the col picture. For example, motion information of the corresponding subblock can be obtained from the center position of the corresponding subblock. In this case, the center position can be the position of the lower right sample among the four samples located in the center of the corresponding subblock. If motion information of a specific subblock of the col block corresponding to the current block is not available, motion information of the central subblock of the col block can be determined as the motion information of the subblock. Once the motion information of the corresponding subblock is derived, it can be switched to the motion vector and reference picture index of the current subblock, similar to the above-mentioned TMVP process. That is, when a sub-block-based motion vector is derived, the motion vector may be scaled taking into account the POC of the reference picture of the reference block.
[0205] As described above, sub-block-based TMVP candidates for the current block can be derived using the motion vector field or motion information of the current block derived based on the sub-blocks.
[0206] Hereinafter, a merge candidate list configured in subblock units is defined as a subblock-based merge candidate list. The above-mentioned affine merge candidates and subblock-based TMVP candidates are merged to configure a subblock-based merge candidate list.
[0207] Meanwhile, a subblock-based TMVP mode flag can be defined to indicate whether the subblock-based TMVP mode can be applied to the current block. This can be signaled at at least one level of the current block's upper level, such as a sequence, a picture, a slice, a tile, a tile group, or a brick. For example, the subblock-based TMVP mode flag can be named sps_sbtmvp_enabled_flag. If the subblock-based TMVP mode is applicable to the current block, a subblock-based TMVP candidate can be added first to the subblock-based merge candidate list. Then, an affine merge candidate can be added to the subblock-based merge candidate list. Meanwhile, the maximum number of candidates that can be included in the subblock-based merge candidate list can be signaled. As an example, the maximum number of candidates that can be included in the subblock-based merge candidate list can be 5.
[0208] The size of the sub-blocks used to derive the sub-block-wise merge candidate list can be signaled or already set to M×N. For example, M×N can be 8×8. Thus, affine mode or sub-block-based TMVP mode can be applied to the current block only if the size of the current block is 8×8 or larger.
[0209] An embodiment of the prediction execution method of the present disclosure will be described below. The following prediction execution method can be performed in step S510 of FIG. 5 or step S730 of FIG.
[0210] A predicted block for the current block may be generated based on the motion information derived according to the prediction mode. The predicted block (prediction block) may include a prediction sample (prediction sample array) of the current block. If the motion vector of the current block points to a fractional sample unit, an interpolation procedure may be performed, whereby a prediction sample of the current block may be derived based on a reference sample of a fractional sample unit in a reference picture. If affine inter prediction is applied to the current block, a prediction sample may be generated based on a sample / sub-block unit MV. If bi-prediction is applied, a prediction sample derived by a weighted sum or weighted average (by phase) of a prediction sample derived based on L0 prediction (i.e., prediction using a reference picture in a reference picture list L0 and MVL0) and a prediction sample derived based on L1 prediction (i.e., prediction using a reference picture in a reference picture list L1 and MVL1) may be used as a prediction sample of the current block. When bi-prediction is applied, if the reference picture used for L0 prediction and the reference picture used for L1 prediction are located in different time directions based on the current picture (i.e., if it is bi-predictive but also bidirectional), this can be called true bi-prediction.
[0211] In the image decoding device, a reconstructed sample and a reconstructed picture can be generated based on the derived prediction sample, and then a procedure such as in-loop filtering can be performed. Also, in the image coding device, a residual sample can be derived based on the derived prediction sample, and image information including the prediction information and the residual information can be coded.
[0212] As described above, when bi-prediction is applied to the current block, a predicted sample may be derived based on a weighted average. In this case, a weight for performing the weighted average may be determined based on a weight index induced at a CU level. Conventionally, a bi-predictive signal (i.e., a bi-predictive sample) may be derived through a simple average of an L0 predicted signal (L0 predicted sample) and an L1 predicted signal (L1 predicted sample). That is, a bi-predictive sample is derived by averaging an L0 predicted sample based on an L0 reference picture and an MVL0 and an L1 predicted sample based on an L1 reference picture and an MVL1. However, according to the present disclosure, when bi-prediction is applied, a bi-predictive signal (bi-predictive sample) may be derived through a weighted average of an L0 predicted signal and an L1 predicted signal as shown in Equation 3. Such bi-prediction may be referred to as bi-prediction with CU-level weight (BCW).
[0213]
number
[0214] In the above formula 3, P bi-pred denotes the bi-predictive signal (bi-predictive block) derived by weighted averaging, P0 and P1 denote the L0 predicted sample (L0 predicted block) and the L1 predicted sample (L1 predicted block), respectively, and (8-w) and w denote the weights applied to P0 and P1, respectively.
[0215] In generating a bi-predictive signal by weighted averaging, five weights are allowed. For example, weight w can be selected from {-2, 3, 4, 5, 10}. For each bi-predicted CU, weight w can be determined in one of two ways. As the first of these two ways, if the current CU is not in merge mode (non-merge CU), a weight index can be signaled together with the motion vector differential. For example, the bitstream can include information on the weight index after information on the motion vector differential. As the second of these two ways, if the current CU is in merge mode (merge CU), the weight index can be derived from the neighboring blocks based on the merge candidate index (merge index).
[0216] The generation of a bi-predictive signal by weighted averaging may be restricted to be applied only to CUs having a size including 256 or more samples (luma component samples). That is, bi-prediction by weighted averaging may be performed only for CUs in which the product of the width and height of the current block is 256 or more. In addition, as described above, one of five weights may be used as the weight w, or one of a different number of weights may be used. For example, five weights may be used for a low-delay picture and three weights may be used for a non-low-delay picture according to the characteristics of the current image. In this case, the three weights may be {3, 4, 5}.
[0217] The image encoding apparatus can determine the weight index without significantly increasing the complexity by applying a fast search algorithm. In this case, the fast search algorithm can be summarized as follows. In the following, unequal weights may mean that the weights applied to P0 and P1 are not equal. Also, equal weights may mean that the weights applied to P0 and P1 are equal.
[0218] When the AMVR mode in which the motion vector resolution is adaptively changed is applied, if the current picture is a low-delay picture, only unequal weights can be conditionally checked for each of the 1-pel motion vector resolution and the 4-pel motion vector resolution.
[0219] - If affine modes are applied together and the affine mode is selected as the optimal mode for the current block, the image coding apparatus can perform affine motion estimation (ME) for each of the non-uniform weights.
[0220] - If the two reference pictures used for bi-prediction are identical, then only unequal weights can be conditionally checked.
[0221] The unequal weights may not be checked if a certain condition is met, which may be based on the POC distance between the current picture and the reference picture, the quantization parameter (QP), the temporal level, etc.
[0222] The weight index of the BCW can be coded using one context coding bin followed by one or more bypass coded bins. The first context coding bin indicates whether equal weights are used or not. If unequal weights are used, additional bins can be bypass coded and signaled. The additional bins can be signaled to indicate which weights are used.
[0223] Weighted prediction (WP) is a tool for efficiently coding images that include fading. With weighted prediction, weighting parameters (weight and offset) 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 weight(s) and offset(s) can be applied to the corresponding reference picture(s). Weighted prediction and BCW can be used for different types of images. To avoid interactions between weighted prediction and BCW, the BCW weight index can not be signaled for CUs that use weighted prediction. In this case, the weight can be inferred to be 4. That is, equal weighting can be applied.
[0224] For a CU with merge mode applied, the weight index can be inferred from the surrounding blocks based on the merge candidate indexes, which is applicable for both normal merge mode and inherit affine merge mode.
[0225] In the case of the combined affine merge mode, affine motion information can be configured based on the motion information of up to three blocks. In this case, the following process can be performed to derive a BCW weight index for a CU using the combined affine merge mode.
[0226] (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}. If the BCW weight indexes of all CPs are derived 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.
[0227] (2) If at least two CPs have the same BCW weight index, the same BCW weight index may be assigned as the weight index of the combined affine merge candidate. Otherwise, the weight index of the combined affine merge candidate may be set to 2.
[0228] The invention according to the present disclosure described below is related to weighted average-based bidirectional prediction, and specifically includes a method for deriving a BCW weight index when constructing a temporal candidate for a merge mode or a temporal candidate for a sub-block merge mode. In addition, according to the present disclosure, a method for deriving a BCW weight index when deriving a pair-wise (merge) candidate is provided. Hereinafter, the BCW weight index may be simply referred to as a weight index. In addition, according to the present disclosure, various embodiments for deriving a weight index for a combined affine merge candidate are provided. Each of the various embodiments included in the present disclosure may be used alone, or two or more embodiments may be used in combination.
[0229] According to one embodiment of the present disclosure, when deriving merge candidates for a sub-block-based merge mode, coding efficiency can be improved by efficiently deriving weight indices for combined affine merge candidates.
[0230] As described with reference to FIG. 15, a representative motion vector CPMVk (k is an integer from 1 to 4) for the k-th CP can be derived. That is, CPMV1 may be a motion vector representing the first CP (upper left CP, CP0), CPMV2 may be a motion vector representing the second CP (upper right CP, CP1), CPMV3 may be a motion vector representing the third CP (lower left CP, CP2), and CPMV4 may be a motion vector representing the fourth CP (lower right CP, RB or CP3). Combinations of CPs for deriving combined affine merge candidates include {CP0, CP1, CP2}, {CP0, CP1, CP3}, {CP0, CP2, CP3}, {CP1, CP2, CP3}, {CP0, CP1}, and {CP0, CP2}, and combined affine merge candidates can be derived in the order of the combinations.
[0231] According to an example of the present embodiment, the weight index for the combined affine merge candidate may be induced to the weight index of a block used to derive a predetermined CP among the CPs in the combination. For example, if the predetermined CP is the first CP or CP0, the weight index for the combined affine merge candidate may be induced to the weight index of a block used to derive CPMV1 among the candidate blocks of the first CP or CP0. For example, in FIG. 15, if the motion vector of B2 among B2, B3, and A2 is determined to be CPMV1, the weight index for the combined affine merge candidate may be induced to the weight index of B2. However, this is merely an example, and the predetermined CP may be the second or third CP in the combination, or one of CP0, CP1, CP2, and RB. For example, if the predetermined CP is CP1, the weight index for the combined affine merge candidate may be induced to the weight index of a block used to derive CPMV2. For example, in FIG. 15, if the motion vector of B0 among B1 and B0 is determined to be CPMV2, the weight index for the combined affine merge candidate may be derived to the weight index of B0.
[0232] According to another example of this embodiment, a weight index of each CP that is not a default index may be used as a weight index for the combined affine merge candidate. For example, if a combination of CPs for deriving a combined affine merge candidate is {CP0, CP1, CP2}, the weight indexes of CP0 and CP2 are default indexes, and the weight index of CP1 is not the default index, the weight index of the combined affine merge candidate may be induced to the weight index of CP1.
[0233] According to another example of the present embodiment, a weight index for a combined affine merge candidate can be determined based on the frequency of occurrence of the weight index. For example, a weight index with a high frequency of occurrence among the weight indexes of candidate blocks of a specific CP (e.g., CP0) can be utilized to derive a weight index for the combined affine merge candidate. Alternatively, a weight index with a high frequency of occurrence among the weight indexes of the CPs constituting the combined affine merge candidate can be utilized. For example, in the case of a combination of {CP0, CP2, CP3 (RB)}, when the weight indexes of CP2 and RB are the same, the weight index for the combined affine merge candidate can be induced to the weight index of CP2 and RB with the highest frequency of occurrence. At this time, the weight index of RB can be induced based on the method of deriving a weight index for a time candidate according to the present disclosure.
[0234] Hereinafter, a combination affine candidate inducing method according to another embodiment of the present disclosure will be described in detail with reference to FIGS.
[0235] The method for deriving combined affine merge candidates according to this embodiment may include a step of deriving information about each CP (CP0 to CP3) of the current block, and a step of deriving combined affine merge candidates for each combination using the induced information of each CP.
[0236] 19 is a diagram for explaining a method for deriving a combined affine merge candidate according to another embodiment of the present disclosure, the deriving method of FIG 19 includes a method for deriving a weight index for the combined affine merge candidate.
[0237] As shown in Fig. 19, the image encoding apparatus or image decoding apparatus may first derive information for each CP of the current block in order to derive a combined affine merge candidate (S1910). Each CP of the current block may include the above-mentioned CP0, CP1, CP2, and CP3 (RB). The information for CPn (n is an integer from 0 to 3) may include at least one of a reference picture index (refIdxLXCorner[n]), prediction direction information (predFlagLXCorner[n]), a motion vector (cpMvLXCorner[n]), availability of CPn (availableFlagCorn]), and a weight index of CPn (bcwIdxCorner[n]).
[0238] According to this embodiment, the weight index for the combined affine merge candidate may be derived to the weight index of the first CP in each combination. As described above, the combination for deriving the combined affine merge candidate may be any one of {CP0, CP1, CP2}, {CP0, CP1, CP3}, {CP0, CP2, CP3}, {CP1, CP2, CP3}, {CP0, CP1}, and {CP0, CP2}. As described above, the first CP in each combination is CP0 or CP1. Therefore, among the above-mentioned information for CPn, the weight index of CPn can be derived only for CP0 and CP1. That is, for CP2 and CP3, the process of deriving the weight index of CPn can be omitted. This is because even if the weight index of CP2 or CP3 is derived, these weight indexes are not used as weight indexes for the combined affine merge candidate.
[0239] When information for each CP is derived in step S1910, the image coding apparatus or image decoding apparatus can derive a combined affine merge candidate based on the information for each CP (S1920). Step S1920 can be performed for each of the combinations for deriving a combined affine merge candidate. In this case, the image coding apparatus or image decoding apparatus can perform step S1920 based on information indicating whether a 6-parameter model can be used. For example, if a 6-parameter model can be used, step S1920 can be performed for all of the combinations including the three CPs and the combinations including the two CPs. Otherwise, if the 6-parameter model cannot be used, step S1920 can be performed only for the combinations including the two CPs. This is because the 6-parameter model is a model that refers to three CPs, and therefore if the 6-parameter model cannot be used, there is no need to configure a combined affine merge candidate for a combination including three CPs. The information indicating whether the 6-parameter model can be used can be signaled via a bitstream. For example, it can be signaled by being included in a sequence parameter set that is a higher level of a block.
[0240] FIG. 20 is a flowchart illustrating a method for deriving information on a CP of a current block according to the embodiment of FIG.
[0241] The CPs of the current block may include the above-mentioned CP0, CP1, CP2, and CP3 (RB). The method of FIG. 20 may be performed for each of the CPs of the current block. The execution order may be CP0, CP1, CP2, and CP3. However, the method is not limited thereto, and may be performed in a different order, or may be performed simultaneously for some or all of the CPs.
[0242] First, in step S2010, a candidate block for a current CP can be identified. The candidate blocks for each CP are as described with reference to FIG. 15. For example, the candidate blocks for CP0 can be B2, B3, and A2, the candidate blocks for CP1 can be B1 and B0, the candidate blocks for CP2 can be A1 and A0, and the candidate block for CP3 can be T. When the method of FIG. 20 is performed for each CP, the candidate blocks can be checked according to the above-mentioned order (scanning order). Thus, when there are multiple candidate blocks, the first candidate block can be identified first. For example, B2, which is the first candidate block for CP0, can be identified first.
[0243] Once a candidate block for the current CP is identified, in step S2020, it can be checked whether the identified candidate block is available. Whether a candidate block is available can be determined based on whether the candidate block is in the current picture, whether the candidate block and the current block are in the same slice or tile, whether the prediction mode of the candidate block is the same as the prediction mode of the current block, etc. For example, if the candidate block is outside the current picture, the candidate block and the current block are in different slices or different tiles, or the prediction mode of the candidate block is different from the prediction mode of the current block, it can be determined that the candidate block is unavailable.
[0244] If the identified candidate block is not available (S2020-No), it can be determined whether a next candidate block for the current CP exists (S2030). For example, when the current CP is CP0 and the identified candidate block is B2, a next candidate block B3 exists according to the above-mentioned order, so it can be determined in step S2030 that a next candidate block exists. For example, when the current CP is CP0 and the identified candidate block is A2, a next candidate block does not exist according to the above-mentioned order, so it can be determined in step S2030 that a next candidate block does not exist.
[0245] If a next candidate block for the current CP exists (S2030-Yes), steps S2010 to S2020 may be performed for the next candidate block. If a next candidate block for the current CP does not exist (S2030-No), the availability of the current CP (availableFlagCorner) may be set to "unavailable" (S2060).
[0246] If the identified candidate block is available (S2020-Yes), information for the current CP can be derived based on information of the available candidate block (S2040). For example, the reference picture index, prediction direction information, motion vector, and weight index of the available candidate block can be used as information for the current CP. In this case, as described above, only if the current CP is CP0 or CP1, the weight index of the available candidate block can be used as the weight index of the current CP. Also, if the identified candidate block is available, the availability of the current CP (availableFlagCorner) can be set to "available" (S2050).
[0247] Once information about each CP in the current block is derived, combination affine merge candidates can be derived based on this information.
[0248] FIG. 21 is a diagram illustrating a method for deriving combined affine merge candidates based on information for each CP according to the embodiment of FIG.
[0249] The method of Figure 21 may be performed for each of the combinations {CP0,CP1,CP2}, {CP0,CP1,CP3}, {CP0,CP2,CP3}, {CP1,CP2,CP3}, {CP0,CP1}, and {CP0,CP2} to derive combined affine merge candidates, in the order listed above, for example. Furthermore, as discussed above, the method of Figure 21 may be performed for only some of the combinations, depending on the availability of a 6-parameter model.
[0250] First, in step S2110, a CP in a current combination for deriving a combined affine merge candidate may be identified. Then, in step S2120, availability of the CP in the current combination may be determined. Step S2120 may be performed based on availability information (availableFlagCorner) for each CP in the combination. For example, if the current combination is {CP0, CP1, CP2}, step S2120 may be performed based on availableFlagCorner[0], availableFlagCorner[1], and availableFlagCorner[2]. If all CPs in the current combination are available (S2120-Yes), steps S2130 to S2150 may be performed for each prediction direction (L0 direction and L1 direction). Otherwise (S2120-No), a combined affine merge candidate cannot be derived for the current combination, and the method of FIG. 21 is terminated.
[0251] If all CPs in the combination are available (S2120-Yes), availability (availableFlagL0 and availableFlagL1) for each of the L0 prediction direction and the L1 prediction direction may be derived in step S2130. For example, when the current combination is {CP0, CP1, CP2}, if prediction direction information (predFlagLXCorner[n]) of CP0, CP1, and CP2 for prediction direction LX (X is 0 or 1) is all 1, and reference picture indexes (refIdxLXCorner[n]) of CP0, CP1, and CP2 are all the same, availability for prediction direction LX may be derived to "available", otherwise, it may be derived to "unavailable".
[0252] Thereafter, in step S2140, availability of prediction direction LX is determined, and if it is "available" (S2140-Yes), the process may proceed to step S2150. In step S2150, a combination affine merge candidate may be derived for prediction direction LX based on information of CP. For example, when the input combination is {CP0, CP1, CP2}, for an available prediction direction LX (X is 0 or 1), the reference picture index (refIdxLXCorner[0]) of CP0, the motion vector (cpMvLXCorner[0]) of CP0, the motion vector (cpMvLXCorner[1]) of CP1, and the motion vector (cpMvLXCorner[2]) of CP2 may be assigned to the reference picture index (refIdxLXConst1), CPMV1, CPMV2, and CPMV3 of the combination affine merge candidate, respectively. If the availability for the prediction direction LX is "unavailable" (S2140-No), step S2150 is skipped and the process can proceed to step S2160.
[0253] Thereafter, in step S2160, a weight index of the combined affine merge candidate may be derived. Step S2160 may be performed based on availability of the prediction direction LX. For example, if both L0 and L1 are available, the weight index of the combined affine merge candidate may be derived to the weight index of the first CP in the combination. For example, if the current combination is {CP0, CP1, CP2}, the weight index of CP0 may be used as the weight index of the combined affine merge candidate. If L0 or L1 is not available, the weight index of the combined affine merge candidate may be derived to a predetermined index. The predetermined index may be a default index, for example, an index indicating equal weighting.
[0254] Thereafter, in step S2170, availability and / or a motion model, etc. for the current combination may be derived. Step S2170 may be performed based on availability for prediction direction LX and / or the number of CPs in the combination. For example, if L0 or L1 is available, availability for the current combination may be induced to be "available". In this case, if the number of CPs in the current combination is three, the motion model of the current combination may be induced to be a six-parameter affine model. If the number of CPs in the current combination is two, the motion model of the current combination may be induced to be a four-parameter affine model.
[0255] Otherwise (when neither L0 nor L1 is available), the availability of the current combination may be induced to be “unavailable.” In addition, the motion model of the current combination may be induced to be the conventional translational motion model.
[0256] FIG. 22 is a diagram illustrating an example of a method for deriving weight indices for combined affine merge candidates according to the embodiment of FIG.
[0257] As described above, the weight index of the combined affine merge candidate may be derived based on the availability of the prediction direction LX. To this end, the availability information for each prediction direction derived in step S2130 may be input (S2210).
[0258] Thereafter, in step S2220, it may be determined whether both L0 and L1 are available. If both L0 and L1 are available (S2220-Yes), the weight index of the combined affine merge candidate may be derived to the weight index of the first CP in the combination (S2230). For example, if the input combination is {CP0, CP1, CP2}, the weight index of CP0 may be used as the weight index of the combined affine merge candidate. For example, if the input combination is {CP1, CP2, CP3}, the weight index of CP1 may be used as the weight index of the combined affine merge candidate.
[0259] If L0 or L1 is not available (S2220-No), the weight index of the combined affine merge candidate can be derived to a predefined index (S2240), as described above. The predefined index can be a default index, for example, an index indicating equal weights.
[0260] According to the embodiment described with reference to Figures 19 to 22, the weight index of the first CP in the combination or the default index is set as the weight index of the combined affine merge candidate based on whether both L0 and L1 are available. According to another example of this embodiment, the weight index of the first CP in the combination can be set as the weight index of the combined affine merge candidate regardless of whether L0 and L1 are available. Alternatively, the weight index of a CP at a predetermined position in the combination can be used. This can be expected to have the effect of reducing the computational complexity and enabling quick processing, since the process of determining whether L0 and L1 are available can be omitted.
[0261] Hereinafter, with reference to FIG. 23, a method for deriving weight indexes for combined affine merge candidates according to another embodiment of the present disclosure will be described.
[0262] According to this embodiment, a weight index for the combined affine merge candidate may be derived based on the weight index and / or weight index group of each CP. A weight W may be selected from five predefined weight sets (e.g., {-2, 3, 4, 5, 10}) based on the weight index of each CP. In this case, the weight index may have a value of 0 to 4 and may be classified into three groups. For example, the weight index may be classified into three groups, {0}, {1, 2, 3}, and {4}. In this case, the weight index group indicating the group to which each weight index belongs may have a value of 0 to 2. By classifying the weight index into three groups, the weight pairs indicated by each index may also be classified into three groups. For example, the weight pairs may be classified into three groups, {(-1 / 4, 5 / 4)}, {(1 / 4, 3 / 4), (2 / 4, 2 / 4), (3 / 4, 1 / 4)}, and {(5 / 4, -1 / 4)}.
[0263] FIG. 23 is a flowchart illustrating an example method for deriving weight indices for combined affine merge candidates according to the present disclosure.
[0264] 23, bcwIdxCorner0, bcwIdxCorner1, and bcwIdxCorner2 respectively indicate the weight index of the first CP in the combination, the weight index of the second CP in the combination, and the weight index of the third CP in the combination. Also, bcwIdxGroup0, bcwIdxGroup1, and bcwIdxGroup2 respectively indicate the weight index group of the first CP in the combination, the weight index group of the second CP in the combination, and the weight index group of the third CP in the combination. Also, bcwIdxConst indicates the weight index of the combined affine merge candidate.
[0265] 23, in step S2310, it can be checked whether bcwIdxCorner0 and bcwIdxCorner1 are the same, and whether bcwIdxGroup0 and bcwIdxGroup2 are the same. If both are the same (S2310-Yes), bcwIdxConst can be steered to bcwIdxCorner0 (S2320).
[0266] If not (S2310-No), in step S2330, it can be checked whether bcwIdxCorner0 and bcwIdxCorner2 are the same, and whether bcwIdxGroup0 and bcwIdxGroup1 are the same. If both are the same (S2330-Yes), bcwIdxConst can be directed to bcwIdxCorner0 (S2320).
[0267] If not (S2330-No), in step S2340, it can be checked whether bcwIdxCorner1 and bcwIdxCorner2 are the same, and whether bcwIdxGroup1 and bcwIdxGroup0 are the same. If both are the same (S2340-Yes), bcwIdxConst can be steered to bcwIdxCorner2 (S2350).
[0268] Otherwise (S2340-No), bcwIdxConst may be derived to a default index (S2360). The default index may be, for example, an index that indicates equal weights.
[0269] According to the example shown in FIG. 23, when three CPs are used, a weight index for the combined affine merge candidates can be derived by up to six comparison operations.
[0270] The method shown in Figure 23 can be simplified as follows: As described above, the weight index for the time candidate is induced to the default index, and the time candidate is included as the last CP of each combination. Therefore, in the method shown in Figure 23, the comparison against bcwIdxCorner2 can be omitted.
[0271] In this case, step S2330 may be performed by checking whether bcwIdxGroup0 and bcwIdxGroup1 are the same, and step S2340 may be performed by checking whether bcwIdxGroup0 and bcwIdxGroup1 are the same. In this case, steps S2330 and S2340 can be merged into one step since they essentially check the same condition.
[0272] FIG. 24 is a flow chart illustrating a method for omitting the comparison against bcwIdxCorner2 according to the present disclosure.
[0273] 24, in step S2410, it can be checked whether bcwIdxCorner0 and bcwIdxCorner1 are the same, and whether bcwIdxGroup0 and bcwIdxGroup2 are the same. If both are the same (S2410-Yes), bcwIdxConst can be steered to bcwIdxCorner0 (S2420).
[0274] If not (S2410-No), it can be checked whether bcwIdxGroup0 and bcwIdxGroup1 are the same (S2430). If they are the same (S2430-Yes), bcwIdxConst can be directed to bcwIdxCorner0 (S2420).
[0275] Otherwise (S2430-No), bcwIdxConst can be derived to a default index (S2440).
[0276] The method shown in FIG. 23 can be simplified as follows. For example, three weights are used like a non-low-delay picture, and the three weights can belong to one group. In this case, the comparison for the weight index group can be omitted in the method shown in FIG. 23.
[0277] FIG. 25 is a flow chart illustrating a method for omitting comparison for weight index groups according to the present disclosure.
[0278] 25, in step S2510, it can be checked whether bcwIdxCorner0 and bcwIdxCorner1 are the same. If they are the same (S2510-Yes), bcwIdxConst can be directed to bcwIdxCorner0 (S2520).
[0279] If not (S2510-No), it can be checked whether bcwIdxCorner0 and bcwIdxCorner2 are the same (S2530). If they are the same (S2530-Yes), bcwIdxConst can be steered to bcwIdxCorner0 (S2520).
[0280] If not (S2530-No), it can be checked whether bcwIdxCorner1 and bcwIdxCorner2 are the same (S2540). If they are the same (S2540-Yes), bcwIdxConst can be steered to bcwIdxCorner2 (S2550).
[0281] Otherwise (S2540-No), bcwIdxConst may be derived to a default index (S2560).
[0282] The method shown in Figure 23 can be further simplified as follows: For example, in the method shown in Figure 23, the comparison against bcwIdxCorner2 and the comparison against the weight index group can all be omitted.
[0283] FIG. 26 is a flowchart illustrating a method according to the present disclosure in which the comparison for bcwIdxCorner2 and the comparison for the weight index group are omitted.
[0284] 26, in step S2610, it is checked whether bcwIdxCorner0 and bcwIdxCorner1 are the same, and if they are the same (S2610-Yes), bcwIdxConst can be directed to bcwIdxCorner0 (S2620). If not (S2610-No), bcwIdxConst can be directed to the default index (S2630).
[0285] According to another example of this embodiment, bcwIdxConst can be derived to bcwIdxCorner0 without any comparison.
[0286] According to another embodiment of the present disclosure, a method for deriving a weight index when a representative predictor vector candidate uses bidirectional prediction when a motion vector candidate for a subblock-based merge mode is configured can be provided. As described with reference to FIG. 18, subblock-based TMVP can derive a col block corresponding to a current block based on a motion shift. At this time, as shown in FIG. 18, a motion shift can be induced from a left block A1 spatially adjacent to the current block. That is, there is a high probability that the weight index of the left block can be trusted. Therefore, taking this into consideration, the weight index of the left block can be used as the weight index of the current block. That is, when a candidate induced by ATMVP uses bidirectional prediction, the weight index of the left block can be used as the weight index for the subblock merge mode. Alternatively, when a motion shift is induced from another peripheral block other than the A1 block, the weight index of the peripheral block can be used as the weight index of the current block. According to this embodiment, when a motion vector candidate for a subblock-based merge mode is configured, a weight index for a representative predictor vector candidate can be efficiently configured, thereby improving coding efficiency without increasing complexity.
[0287] According to another embodiment of the present disclosure, when a temporal merge candidate uses bi-directional prediction in deriving a merge candidate for a merge mode, coding efficiency can be improved by deriving a weight index for the temporal candidate.
[0288] According to an example of this embodiment, the weight index of a temporal merge candidate may always be guided to a default index (e.g., 0). In this disclosure, the default index may be an index that indicates that the weights for each prediction direction (i.e., the L0 prediction direction and the L1 prediction direction in bi-prediction) are the same (equal weights).
[0289] According to another example of this embodiment, the weight index of the temporal merge candidate can be derived to the weight index of the collocated block.
[0290] According to another embodiment of the present disclosure, when deriving merge candidates for a sub-block-based merge mode, when the temporal candidates use bidirectional prediction, the coding efficiency can be improved by efficiently deriving weight indices for the temporal candidates.
[0291] According to an example of this embodiment, the weight index of a temporal candidate may always be induced to a default index (e.g., 0). In this case, when a temporal candidate is selected from the sub-block merging candidate list based on the merging index, the weight index of the current block may also be set to the default index.
[0292] According to another example of this embodiment, the weight index of the temporal candidate may be derived to the weight index of a center block. The center block may be a block in a col picture including coordinates corresponding to a center position of the current block. The coordinates corresponding to the center position may be derived based on the upper left coordinates (x, y) of the current block and the width and height of the current block. For example, the coordinates corresponding to the center position may be (x+width / 2, y+height / 2).
[0293] According to another example of this embodiment, the weight index of the temporal candidate may be derived to the weight index of the col sub-block corresponding to the current sub-block. If the col sub-block is not available or the weight index of the col sub-block is not available, the weight index of the temporal candidate of the current sub-block may be derived to the weight index of the center block.
[0294] According to another embodiment of the present disclosure, when deriving merge candidates for a merge mode, weight indexes for pair-wise candidates can be efficiently derived, thereby improving coding efficiency. As described above, pair-wise candidates can be derived based on predefined candidate pairs selected from candidates included in a merge candidate list. In this case, the candidate pairs for deriving pair-wise candidates can be represented as cand0 and cand1.
[0295] According to an example of this embodiment, when a pairwise candidate uses bidirectional prediction, the weight index of the pairwise candidate may be induced to the weight index of cand0. Alternatively, the weight index of the pair-wise candidate may be induced to the weight index of cand0, or may be induced to a weight index other than the default index (index indicating 1:1 weight) among the weight index of cand0 and the weight index of cand1.
[0296] According to another example of this embodiment, the weight index of the pairwise candidates can be derived by at least one of the following four methods.
[0297] -cand0 weight index
[0298] - Weight index of the bidirectionally predicted candidate between cand0 and cand1
[0299] -If cand0 and cand1 have the same weight index, it can be set to that weight index, otherwise it can be set to a default index.
[0300] -If cand0 and cand1 have the same weight index, it is set to that weight index; otherwise, it can be set to the weight index of cand0 or the weight index of cand1 that is not the default index.
[0301] According to another example of the present embodiment, the consistency with the induction method for the combined affine candidates can be considered. This is because the pairwise candidates and the combined affine candidates have similar characteristics in that they are generated by combining multiple candidates. That is, when the weight index of cand0 is bcwIdx0 and the weight index of cand1 is bcwIdx1, at least one of the following two methods can be applied to derive the weight index of the pairwise candidates.
[0302] -The weight index can be set based on whether bcwIdx0 and bcwIdx1 are the same. First, it can be determined whether bcwIdx0 and bcwIdx1 are the same. If they are the same, the weight index of the pairwise candidate can be induced to bcwIdx0. If they are not the same, the weight index of the pairwise candidate can be induced to a default index.
[0303] Simply, the weight index of the pairwise candidate can be set to the weight index of the first candidate (eg, bcwIdx0).
[0304] Although the exemplary method of the present disclosure is expressed as a series of operations for clarity of explanation, this is not intended to limit the order in which the steps are performed, and each step may be performed simultaneously or in a different order, if necessary. To realize the method according to the present disclosure, the steps illustrated may include other steps, some steps may be omitted and the remaining steps may be omitted, or some steps may be omitted and additional steps may be included.
[0305] In the present disclosure, an image encoding device or an image decoding device that performs a predetermined operation (step) can perform the operation (step) to check the execution conditions or circumstances of the operation (step). For example, if it is described that a predetermined operation is performed when a predetermined condition is satisfied, the image encoding device or the image decoding device can perform the predetermined operation after performing an operation to check whether the predetermined condition is satisfied or not.
[0306] The various embodiments of the present disclosure are not intended to enumerate all possible combinations, but are intended to describe representative aspects of the present disclosure, and the matters described in the various embodiments may be applied independently or in combination of two or more.
[0307] Additionally, various embodiments of the present disclosure may be implemented using hardware, firmware, software, or a combination thereof, etc. In the case of a hardware implementation, the implementation may be implemented using one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general processors, controllers, microcontrollers, microprocessors, etc.
[0308] In addition, the image decoding device and the image encoding device to which the embodiments of the present disclosure are applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video conversation device, a real-time communication device such as a video communication, a mobile streaming device, a storage medium, a camcorder, a custom video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, an image telephone video device, and a medical video device, and may be used to process a video signal or a data signal. For example, the over-the-top video (OTT) device may include a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), and the like.
[0309] FIG. 27 is a diagram illustrating a content streaming system to which an embodiment of the present disclosure can be applied.
[0310] As shown in FIG. 27, a content streaming system to which an embodiment of the present disclosure is applied may broadly include an encoding server, a streaming server, a Web server, a media storage, a user device, and a multimedia input device.
[0311] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, video camera, etc. directly generates a bitstream, the encoding server can be omitted.
[0312] The bitstream may be generated by an image encoding method and / or image encoding device to which an embodiment of the present disclosure is applied, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.
[0313] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server can act as a medium to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server can transmit the multimedia data to the user. At this time, the content streaming system can include a separate control server, and in this case, the control server can control commands / responses between devices in the content streaming system.
[0314] The streaming server may receive the content from a media storage and / or an encoding server. For example, when receiving the content from the encoding server, the content may be received in real time. In this case, the streaming server may store the bitstream for a certain period of time in order to provide a smooth streaming service.
[0315] Examples of the user devices include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices such as smartwatches, smart glass, head mounted displays (HMDs), digital TVs, desktop computers, and digital signage.
[0316] Each server in the content streaming system can be operated as a distributed server, in which case data received from each server can be processed in a distributed manner.
[0317] The scope of the present disclosure includes software or machine-executable commands (e.g., operating systems, applications, firmware, programs, etc.) that cause operations according to the methods of the various embodiments to be performed on a device or computer, and non-transitory computer-readable medium on which such software or commands can be stored and executed on a device or computer. [Industrial Applicability]
[0318] The embodiments according to the present disclosure can be used to encode / decode images.
Claims
1. An image decoding method performed by an image decoding device, comprising: The image decoding method includes: constructing a sub-block merging candidate list for a current block based on an inter prediction mode of the current block being a sub-block merging mode; selecting a sub-block merging candidate from the sub-block merging candidate list; deriving motion information of the current block based on motion information of the selected sub-block merging candidate; generating a prediction block for the current block based on motion information of the current block; inducing a residual block of the current block; reconstructing the current block based on a residual block of the current block and a predicted block of the current block; The step of constructing the sub-block merging candidate list includes the step of deriving combined sub-block merging candidates, and the step of deriving the combined sub-block merging candidates includes the step of deriving weight indexes for bidirectional prediction of the combined sub-block merging candidates; The step of deriving the combined sub-block merging candidate is performed based on motion information of each candidate CP included in a combination of predefined candidate CPs among a plurality of candidate CPs (Control Points) for the current block; The image decoding method, wherein the weight index of the combined sub-block merging candidate is derived as a weight index for both directions of a first candidate CP among the candidate CPs included in the combination, without performing a comparison between the weight indexes of the candidate CPs.
2. The motion information of the candidate CP is derived based on motion information of a candidate block relative to the candidate CP; The image decoding method according to claim 1 , wherein the candidate block is an available candidate block among at least one candidate block for the candidate CP.
3. The image decoding method of claim 1 , wherein the motion information of the candidate CP includes a weight index for bidirectional prediction, and the weight index for the candidate CP is derived based on whether the candidate CP is a top-left candidate CP or a top-right candidate CP for the current block.
4. 2. The image decoding method of claim 1, wherein the motion information of the candidate CP includes a weight index for bidirectional prediction, and the weight index of the candidate CP is not derived based on the candidate CP being a bottom-left candidate CP or a bottom-right candidate CP for the current block.
5. The image decoding method according to claim 2 , wherein the candidate CP is determined to be unavailable based on the absence of an available candidate block among at least one candidate block for the candidate CP.
6. The step of deriving combined sub-block merging candidates comprises: The image decoding method according to claim 5 , which is performed on the basis that all candidate CPs included in the predefined set of candidate CPs are available.
7. a weight index for the combined sub-block merging candidate is derived based on the availability of a prediction direction for the combination; The image decoding method according to claim 1 , wherein availability of the prediction direction for the combination is determined based on motion information of the candidate CPs included in the combination.
8. 7. The image decoding method of claim 6, wherein a weight index of the combined sub-block merging candidate is derived as the first candidate CP among the candidate CPs included in the combination based on the prediction direction for the combination being available for both L0 direction and L1 direction.
9. 9. The image decoding method of claim 8, wherein the weight index of the combined sub-block merging candidate is derived as a predetermined weight index based on the prediction direction for the combination being unavailable for at least one of an L0 direction and an L1 direction.
10. An image coding method performed by an image coding device, comprising: generating a prediction block for the current block based on motion information of the current block; deriving a residual block of the current block based on the predicted block; reconstructing the current block based on the predicted block of the current block and a residual block of the current block; encoding the current block based on the predicted block; encoding motion information of the current block; The step of encoding the motion information of the current block includes: constructing a sub-block merging candidate list for a current block based on an inter prediction mode of the current block being a sub-block merging mode; encoding motion information of the current block based on the sub-block merging candidate list; constructing the subblock merging candidate list includes deriving combined subblock merging candidates, and deriving the combined subblock merging candidates includes deriving weight indices for bi-prediction of the combined subblock merging candidates; The step of deriving the combined sub-block merging candidate is performed based on motion information of each candidate CP included in a combination of predefined candidate CPs among a plurality of candidate CPs (Control Points) for the current block; The weight index of the combined sub-block merging candidate is derived as a weight index for both directions of a first candidate CP among the candidate CPs included in the comparison, without performing a comparison between the weight indexes of the candidate CPs.
11. A method for transmitting a bitstream generated by an image coding method, comprising the steps of: generating a prediction block for the current block based on motion information of the current block; deriving a residual block of the current block based on the predicted block; encoding the current block based on the predicted block; encoding motion information of the current block; The step of encoding the motion information of the current block includes: constructing a sub-block merging candidate list for the current block based on the inter prediction mode of the current block being a sub-block merging mode; encoding motion information of the current block based on the sub-block merging candidate list; The step of constructing the sub-block merging candidate list includes the step of deriving combined sub-block merging candidates, and the step of deriving the combined sub-block merging candidates includes the step of deriving weight indexes for bidirectional prediction of the combined sub-block merging candidates; The step of deriving the combined sub-block merging candidate is performed based on motion information of each candidate CP included in a combination of predefined candidate CPs among a plurality of candidate CPs (Control Points) for the current block; A method for transmitting a bitstream, wherein the weight index of the combined sub-block merging candidate is derived as a weight index for both directions of a first candidate CP among the candidate CPs included in the comparison, without performing a comparison between the weight indexes of the candidate CPs.
