Image encoding / decoding method and apparatus for deriving weight index for bidirectional prediction of merge candidates, and bitstream transmission method
The image encoding/decoding method enhances efficiency by deriving weight indices for bidirectional prediction of merge candidates, addressing the increased costs associated with high-resolution images through improved compression techniques.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2026-03-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 and apparatus that derive weight indices for bidirectional prediction of merge candidates, specifically through constructing an affine merge candidate list and deriving a combined affine merge candidate with a weight index, using motion information from predefined control points.
Improves encoding/decoding efficiency and enables effective transmission and storage of high-resolution, high-quality images by optimizing the image compression process.
Smart Images

Figure 0007825355000004 
Figure 0007825355000005 
Figure 0007825355000006
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 weight indices for bidirectional prediction of merge candidates. [Background technology]
[0002] Recently, demand for high-resolution, high-quality images, such as HD (High Definition) images and UHD (Ultra High Definition) images, has been increasing in various fields. As image data becomes higher in resolution and quality, the amount of information or bits to be transmitted increases relatively compared to conventional image data. The increase in the amount of information or bits to be transmitted results in an increase in transmission costs and storage costs.
[0003] This requires highly efficient image compression techniques 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 an 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 mentioned above will be clearly understood by a person having ordinary skill in the technical field 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 reconstructing the current block based on the predicted block of the current block, wherein the step of constructing the affine merge candidate list includes the step of deriving a combined affine merge candidate, and the step of deriving the combined affine merge candidate may include the 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 of a plurality of CPs (Control Points) of the current block that are included in a combination of already defined CPs.
[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 if the CP is the bottom-left CP or 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 can 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 can be performed when all CPs included in the combination of the predefined 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 the prediction direction for the combination is available, and whether the prediction direction for the combination is available can be derived based on motion information for the CP included in the combination.
[0019] In the image decoding method according to the present disclosure, if 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 combined affine merge candidate can be derived to the weight index of a specified CP within the combination.
[0020] In the image decoding method according to the present disclosure, the predetermined CP in the combination used to derive the weight index of the combined affine merge candidate may be the first CP among the CPs in the combination.
[0021] In the image decoding method according to the present disclosure, if 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 combined 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 the inter prediction mode of the current block is an affine merge mode, the at least one processor constructs 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 constructing 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 the steps of generating a predictive block of a current block based on motion information of the current block, encoding the current block based on the predictive block, and encoding the motion information of the current block, wherein the step of encoding the motion information of the current block includes the steps 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 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 the step of deriving combined affine merge candidates, and the step of deriving the combined affine merge candidates may include the step of deriving weight indices for bidirectional prediction of the combined affine merge candidates.
[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 this brief summary of the present disclosure are merely exemplary aspects of the detailed description of the present disclosure that follows and are not intended to limit the scope of the present disclosure. [Effects 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] Furthermore, the present disclosure can provide an image encoding / decoding method and apparatus for deriving weight indices for bidirectional prediction of merge candidates.
[0028] The present disclosure also provides a method for transmitting a bitstream generated by the image encoding method or apparatus according to the present disclosure.
[0029] Furthermore, 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 that stores 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 explanation of the drawings]
[0032] [Figure 1] 1 is a diagram illustrating a video coding system to which embodiments of the present disclosure can be applied; [Figure 2] 1 is a diagram schematically illustrating an image encoding device to which an embodiment of the present disclosure can be applied. [Figure 3] FIG. 1 is a diagram schematically illustrating an image decoding device to which an embodiment of the present disclosure can be applied. [Figure 4] FIG. 10 is a diagram illustrating an example configuration of an inter prediction unit that performs inter prediction coding according to the present disclosure. [Figure 5] 1 is a flowchart illustrating an encoding method based on inter prediction. [Figure 6] 10 is a diagram illustrating an example configuration of an inter prediction unit that performs inter prediction decoding according to the present disclosure. FIG. [Figure 7] 10 is a flowchart illustrating a decoding method based on inter prediction. [Figure 8] FIG. 10 is a diagram illustrating peripheral blocks used as spatial merging candidates. [Figure 9] FIG. 1 is a 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. 10 is a diagram illustrating a method for generating an affine merge candidate list. [Figure 14] FIG. 10 is a diagram for explaining CPMV induced from surrounding blocks. [Figure 15] FIG. 10 is a diagram illustrating neighboring blocks for deriving combined affine merge candidates. [Figure 16] FIG. 10 is a diagram illustrating a method for generating an affine MVP candidate list. [Figure 17] FIG. 10 is a diagram for explaining peripheral blocks in sub-block-based TMVP mode. [Figure 18] A diagram for explaining a method of deriving a motion vector field according to a sub-block-based TMVP mode. [Figure 19] FIG. 10 is a diagram illustrating 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] 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 indices for combined affine merge candidates according to the embodiment of FIG. 21. FIG. [Figure 23] FIG. 10 illustrates a method for deriving combined affine merge candidates based on information for each CP according to another embodiment of the present disclosure. [Figure 24] 10 is a flowchart illustrating a method for omitting a comparison for bcwIdxCorner2 according to the present disclosure. [Figure 25] 10 is a flowchart illustrating a method for omitting comparisons for weight index groups according to the present disclosure. [Figure 26] 10 is a flowchart illustrating a method according to the present disclosure in which a comparison for bcwIdxCorner2 and a comparison for a weight index group are omitted. [Figure 27] FIG. 1 illustrates a content streaming system to which an embodiment of the present disclosure can be applied. DETAILED DESCRIPTION OF THE INVENTION
[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 detailed description of a known configuration or function may obscure the gist of the present disclosure, the detailed description thereof will be omitted. In addition, in the drawings, parts that are not related to the description of the present disclosure will be omitted, and similar parts will be designated by similar reference numerals.
[0035] In this disclosure, when a component is referred to as being "coupled," "coupled," or "connected" to another component, this includes not only a direct connection, but also an indirect connection where another component exists between them. Furthermore, when a component is referred to as "including" or "having" another component, this does not mean that the other component is excluded, but that the component can further include the other component, unless otherwise specified.
[0036] In this disclosure, terms such as "first" and "second" are used only to distinguish 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 referred to as a second component in another embodiment, and similarly, a second component in one embodiment may be referred to as a first component in another embodiment.
[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 into a single hardware or software unit, or a single component may be distributed into multiple hardware or software units. Therefore, even if not otherwise specified, such integrated or distributed embodiments are also included within the scope of this disclosure.
[0038] In this disclosure, the components described in 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 within the scope of this disclosure. Furthermore, an embodiment including other components in addition to the components described in various embodiments is also within the scope of this disclosure.
[0039] The present disclosure relates to image encoding and decoding, and terms used in this disclosure may have their ordinary meaning 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 refers to a unit representing any one image in a specific time period, and 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. Furthermore, a slice / tile may include one or more coding tree units (CTUs).
[0041] In this disclosure, "pixel" or "pel" may refer to the smallest unit constituting one picture (or image). Also, "sample" may be used as a term corresponding to pixel. 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, the term "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 that region. The term "unit" may be used interchangeably with terms such as "sample array," "block," or "area," depending on the situation. In general, 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." When prediction is performed, a "current block" may refer to a "current predicted block" or a "block to be predicted." When transformation (inverse transformation) / quantization (inverse quantization) is performed, a "current block" may refer to a "current transformed block" or a "block to be transformed." When 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." Alternatively, 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 one 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] An encoding device 10 according to an embodiment may include a video source generation unit 11, an encoding unit 12, and a transmission unit 13. A decoding device 20 according to an embodiment may include a reception 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 transmission unit 13 may be included in the encoding unit 12. The reception 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 generation unit 11 can acquire video / images through a video / image capture, synthesis, or generation process. The video source generation 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 video / images, etc. The video / image generation device can include, for example, a computer, a tablet, a smartphone, etc., and can (electronically) generate video / images. For example, virtual video / images can be generated via a computer, etc., in which case the video / image capture process can be replaced with 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, and quantization for compression and coding efficiency. The encoder 12 may output the encoded data (encoded video / image information) in a bitstream format.
[0052] The transmitter 13 may transmit the encoded video / image information or data output in a bitstream format to the receiver 21 of the decoding device 20 in a file or streaming format via a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, and SSD. The transmitter 13 may include elements for generating a media file in a predetermined file format and elements for transmitting via a broadcasting / communication network. The receiver 21 may extract / receive the bitstream from the storage medium or network and transmit it to the decoder 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, and the rendered video / images can be displayed via the display unit.
[0055] Overview of the image encoding device
[0056] FIG. 2 is a diagram schematically illustrating an image encoding device to which an embodiment of the present disclosure can be applied.
[0057] 2, the image encoding device 100 may include an image division unit 110, a subtraction unit 115, a transform unit 120, a quantization unit 130, an inverse quantization unit 140, an inverse transform 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 encoding unit 190. The inter prediction unit 180 and the intra prediction unit 185 may be collectively referred to as a "prediction unit." The transform unit 120, the quantization unit 130, the inverse quantization unit 140, and the inverse transform unit 150 may be included in a residual processing unit. The residual processing unit may further include a subtraction unit 115.
[0058] Depending on the embodiment, 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). 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) using a QT / BT / TT (quad-tree / binary-tree / ternary-tree) structure. For example, one coding unit may be divided into multiple coding units at deeper depths based on a quad-tree structure, a binary-tree structure, and / or a ternary-tree structure. To divide the coding units, the quad-tree structure may be applied first, and then the binary-tree structure and / or the ternary-tree structure may be applied later. The coding procedure according to the present disclosure may be performed based on the final coding unit that is not further divided. The maximum coding unit may be used as the final coding unit, or 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 reconstruction, 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 current block (current block) to generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block or CU. The prediction unit may generate various information related to prediction of the current block and transmit it to the entropy coding unit 190. The prediction information may be coded by the entropy coding 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 far away from the current block according to the intra prediction mode and / or intra prediction technique. The intra prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the granularity of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the settings. The intra prediction unit 185 may also determine the prediction mode to be applied to the current block using the 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. To reduce the amount of motion information transmitted in inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation between the motion information of 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 information on the inter prediction direction (e.g., L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be 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 predictor 180 may construct a motion information candidate list based on neighboring blocks and generate information indicating which candidate is used to derive a motion vector and / or a reference picture index for the current block. Inter prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter predictor 180 may use motion information of neighboring blocks as motion information for the current block. In the case of skip mode, unlike in merge mode, a residual signal may not be transmitted.In the case of a motion vector prediction (MVP) mode, the motion vector of a neighboring block is used as a motion vector predictor, and the motion vector of the current block can be signaled by encoding a motion vector difference and an indicator for the motion vector predictor. The motion vector difference may mean the difference between the motion vector of the current block and the motion vector predictor.
[0063] The predictor may generate a prediction signal based on various prediction methods and / or prediction techniques, which will be described later. For example, the predictor may apply intra prediction or inter prediction to predict the current block, or may simultaneously apply intra prediction and inter prediction. A prediction method that simultaneously applies intra prediction and inter prediction to predict the current block may be called combined inter and intra prediction (CIIP). The predictor may also perform intra block copy (IBC) to predict the current block. Intra block copy can be used for content image / video coding, such as games, such as screen content coding (SCC). IBC is a method of predicting a current block using an already reconstructed 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, predicted sample array) output from the prediction unit from the input image signal (original block, original sample array) to generate a residual signal (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 representing inter-pixel relationship information. 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 to non-square blocks of variable size.
[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 encode the quantized signal (information about the quantized transform coefficients) and output the encoded signal in a bitstream format. The information about 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 about 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 necessary for video / image restoration (e.g., values of syntax elements) together with or separately from the quantized transform coefficients. The coded information (e.g., coded video / image information) may be transmitted or stored in a bitstream format in network abstraction layer (NAL) units. 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 also include general constraint information. The signaling information, transmitted information and / or syntax elements mentioned in this disclosure may be encoded through the above-described encoding procedure and included in the bitstream.
[0068] The bitstream may be transmitted via a network or 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) that transmits and / or a storing unit (not shown) that stores the signal output from the entropy encoding unit 190 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 residual signal (residual block or residual sample) can be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantization unit 140 and the inverse transform unit 150.
[0070] The adder 155 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the 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, the predicted block may be used as the 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 will be described later.
[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 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, etc. The filtering unit 160 may generate various information related to filtering and transmit it to the entropy coding unit 190, as will be described later in connection with each filtering method. The filtering information 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 can be used as a reference picture in the inter prediction unit 180. When inter prediction is applied through this, the image encoding device 100 can avoid a prediction mismatch between the image encoding device 100 and the image decoding device, and can also improve encoding efficiency.
[0074] The DPB in the memory 170 may store modified reconstructed pictures for use as reference pictures in the inter predictor 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 predictor 180 to be used as motion information of spatially surrounding blocks or temporally surrounding blocks. The memory 170 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 185.
[0075] Overview of the image decoding device
[0076] FIG. 3 is a diagram schematically illustrating an image decoding device to which an embodiment of the present disclosure can be applied.
[0077] 3, the image decoding apparatus 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] Depending on the embodiment, all or at least some of the components constituting the image decoding device 200 may be realized by a single hardware component (e.g., a decoder or a processor). 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 performing 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. Therefore, the decoding processing unit can be, for example, a coding unit. The coding unit can be obtained by dividing a coding tree unit or a maximum coding unit. The reconstructed image signal decoded and output by the image decoding device 200 can be reproduced by a reproduction device (not shown).
[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 an entropy decoding unit 210. For example, the entropy decoding unit 210 may parse the bitstream to derive information (e.g., video / image information) necessary for image reconstruction (or picture reconstruction). 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 also include general constraint information. The image decoding apparatus may further use the information on the parameter sets 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 residuals. More specifically, the CABAC entropy decoding method receives bins corresponding to each syntax element from the bitstream, determines a context model using information on the syntax element to be decoded and decoded information on neighboring blocks and the block to be decoded, or information on symbols / bins decoded in a previous step, predicts the occurrence probability of the bins based on the determined context model, and performs arithmetic decoding of the bins to generate symbols corresponding to the values of each syntax element. After determining the context model, the CABAC entropy decoding method may update the context model using information on the decoded symbol / bin for the context model of the next symbol / bin.Among the information decoded by the entropy decoding unit 210, information related to prediction is provided to the prediction units (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 apparatus according to the present disclosure may be referred to as a video / image / picture decoding apparatus. The image decoding apparatus 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 and output the 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 the coefficient scanning 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 prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on information about the prediction 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 described in the description of the prediction unit of the image encoding device 100.
[0086] The intra predictor 265 may predict the current block by referring to samples in the current picture. The description of the intra predictor 185 may also be applied to the intra predictor 265.
[0087] The inter prediction unit 260 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. To reduce the amount of motion information transmitted in inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on correlations between motion information of 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 information on an inter prediction direction (e.g., L0 prediction, L1 prediction, Bi prediction, etc.). 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 construct 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 received candidate selection information. Inter prediction may be performed based on various prediction modes (techniques), and the prediction information may include information indicating the inter prediction mode (technique) 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 predicted 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 also be applied to the adder 235.
[0089] Meanwhile, as will be described later, LMCS (luma mapping with chroma scaling) 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 a 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 can be used as a reference picture in the inter predictor 260. The memory 250 can 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 can be transmitted to the inter predictor 260 to be used as motion information of a spatially surrounding block or a temporally surrounding block. The memory 250 can store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 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] Inter-prediction encoding and inter-prediction decoding will be described below with reference to FIGS.
[0094] An 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 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] In this case, to reduce the amount of motion information transmitted in the inter prediction mode, motion information of the current block may be derived based on correlations between motion information of neighboring blocks and the current block, and the motion information may be derived in units of blocks, sub-blocks, or samples. In this case, 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 represent 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, neighboring blocks of the current block may include spatial neighboring blocks present in the current picture and temporal neighboring blocks 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 blocks may be the same or different. The temporal neighboring blocks may be called collocated reference blocks, collocated coding units (colCUs), etc. A reference picture including the temporal neighboring blocks may be called a collocated picture (colPic).
[0097] On the other hand, a motion information candidate list can be constructed based on the surrounding blocks of the current block, and in this case, flag or index information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block can be signaled.
[0098] The motion information may include L0 motion information and / or L1 motion information based on the inter prediction type. A motion vector in the L0 direction may be defined as an L0 motion vector or MVL0, and a motion vector in the L1 direction may be defined as an L1 motion vector or MVL1. Prediction based on the L0 motion vector may be defined as L0 prediction, prediction based on the L1 motion vector may be defined as L1 prediction, and prediction based on both the L0 motion vector and the L1 motion vector may be defined as bi-prediction. Here, the L0 motion vector may refer to a motion vector associated with the reference picture list L0, and the L1 motion vector may refer to a motion vector associated with the reference picture list L1.
[0099] The reference picture list L0 may include, as reference pictures, pictures that are earlier in output order than the current picture, and the reference picture list L1 may include pictures that are later in 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 that are later in 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 that are earlier in 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, as input, an original picture to be coded and a reference picture used for inter prediction. 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 prediction samples by performing inter prediction on the current block. The prediction samples may be expressed as a prediction block of the current block. The inter prediction unit 180 may output information related to the prediction mode, information related to the motion information, and prediction samples.
[0102] For example, the inter prediction unit 180 of the image encoding device may search for blocks 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 the 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 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 by 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 as at least one of merge mode, skip mode, MVP mode (Motion Vector Prediction mode), SMVD mode (Symmetric Motion Vector Difference), affine mode, subblock-based merge mode, AMVR mode (Adaptive Motion Vector Resolution mode), HMVP mode (History-based Motion Vector Predictor mode), bi-predictive merge mode (Pair-wise average merge mode), MMVD mode (Merge mode with Motion Vector Differences mode), DMVR mode (Decoder side Motion Vector Refinement mode), CIIP mode (Combined Inter and Intra Prediction mode), and GPM (Geometric Partitioning mode).
[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 derived merge candidates. Furthermore, the image encoding apparatus may 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 the 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 construct an MVP candidate list using the induced MVP candidates. The image encoding apparatus may also use a motion vector of an MVP candidate selected from the MVP candidates included in the MVP candidate list as the MVP of the current block. In this case, for example, a motion vector pointing to a reference block derived by the above-described motion estimation may be used as the motion vector of the current block, and an MVP candidate having a motion vector with the smallest difference from the motion vector of the current block may be the selected MVP candidate. A motion vector difference (MVD), 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. When the MVP mode is applied, the 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 apparatus 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. In this case, 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 about 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 apparatus, and the transform coefficients may be derived as quantized transform coefficients through the quantization unit 130. Information about the quantized transform coefficients may be coded by 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 predicted samples for the current block. Here, the steps of determining the inter prediction mode, deriving the motion information, and generating predicted samples may be performed simultaneously, or one step may be performed before the other steps.
[0109] In step S520, the image encoding apparatus may derive residual samples based on the predicted samples. The image encoding apparatus may derive the residual samples based on the original samples of the current block and the predicted samples. For example, the residual samples may be derived by subtracting corresponding predicted samples from original samples.
[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 be information related to the prediction procedure and may include prediction mode information (e.g., a skip flag, a merge flag, or a mode index) and information about motion information. Among the prediction mode information, the skip flag 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 both 0, it may be determined that the MVP mode is applied to the current block. The information about the motion information may include candidate selection information (e.g., a merge index, an MVP flag, or an MVP index) that is information for deriving a motion vector. Among the candidate selection information, the merge index may be signaled when the merge mode is applied to the current block, and may be information for selecting one of 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 related to the motion information may include the above-mentioned information related to MVD and / or reference picture index information. In addition, the information related to the motion information may include information indicating whether L0 prediction, L1 prediction, or bi-prediction is applied. The residual information is information related to the residual sample.The residual information may include information about quantized transform coefficients for the residual samples.
[0111] The output bitstream can be stored in a (digital) storage medium and transmitted to the image decoding device, or can 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 in 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 apparatus 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 the 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 prediction samples by performing inter prediction on the current block. The prediction samples may be represented by a prediction block of the current block. The inter prediction unit 260 may output the derived prediction samples.
[0115] FIG. 7 is a flowchart illustrating a decoding method based on inter prediction.
[0116] For example, the decoding method of Fig. 7 can be performed by the image decoding apparatus of Fig. 3. The image decoding apparatus can perform operations corresponding to those performed by the image encoding apparatus. The image decoding apparatus can 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 apparatus. 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 determine whether the skip mode is applied to the current block based on the skip flag. Also, it may determine 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 construct a merge candidate list (described below) and select one of the merge candidates included in the merge candidate list. The selection may be made based on the candidate selection information (merge index) described above. Motion information of the selected merge candidate may be used to derive motion information of the current block. For example, the motion information of the selected merge candidate may be used as the 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 use a motion vector of an MVP candidate selected from the MVP candidates included in the MVP candidate list as the MVP of the current block. The selection may be made based on the candidate selection information (MVP flag or MVP index). In this case, the MVD of the current block may be derived based on information about the MVD, and the motion vector of the current block may be derived based on the MVP of the current block and the MVD. Furthermore, the image decoding apparatus may derive a reference picture index of the current block based on the reference picture index information. A picture pointed to by the reference picture index in the 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 predictive samples for the current block based on 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 predictive samples of the current block may be derived using samples of a reference block pointed to in the reference picture by the motion vector of the current block. Depending on the case, a predictive sample filtering procedure may further be performed on all or some of the predictive samples of the current block.
[0123] In step S740, the image decoding apparatus may generate residual samples for the current block based on the received residual information.
[0124] In step S750, the image decoding apparatus generates reconstructed samples for the current block based on the predicted samples and the residual samples, and generates a reconstructed picture based on the reconstructed samples. Thereafter, 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 depending 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 neighboring blocks. Therefore, the motion information of the current predicted block can be indicated by transmitting flag information indicating that the merge mode is used and candidate selection information (e.g., a merge index) indicating which neighboring blocks are used as merge candidates. In this disclosure, since the current block is a unit of prediction execution, the current block may be used in the same sense as a current predicted block, and the neighboring blocks may be used in the same sense as neighboring predicted blocks.
[0128] The image encoding apparatus may search for merge candidate blocks to be used to derive motion information of the current block to perform the merge mode. For example, but not limited to, up to five merge candidate blocks may be used. 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 select the merge candidate block with the smallest RD cost as the final merge candidate block.
[0129] The present disclosure provides various embodiments for the merge candidate blocks that make up the merge candidate list. The merge candidate list can use, for example, five merge candidate blocks. For example, four spatial merge candidates and one temporal merge candidate can be used.
[0130] FIG. 8 is a diagram illustrating neighboring blocks used as spatial merge candidates.
[0131] As shown in Fig. 8, spatial peripheral blocks used as spatial merge candidates may include a lower left corner peripheral block A0, a left side peripheral block A1, a right upper 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 also be used as the spatial peripheral blocks.
[0132] FIG. 9 is a diagram illustrating a method for constructing a merge candidate list according to an example of the present disclosure.
[0133] The image encoding device / image decoding device may search spatially neighboring blocks of the current block and insert the derived spatial merge candidates into a merge candidate list (S910). The image encoding device / image decoding device may search the spatial neighboring blocks based on priority to detect available blocks and derive motion information of the detected blocks as the spatial merge candidates. For example, the image encoding device / image decoding device may search the five blocks shown in FIG. 8 in the order A1, B1, B0, A0, and B2 and sequentially index the available candidates to construct a merge candidate list.
[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] Derivation of spatial candidates may be performed based on spatially neighboring blocks. As an example, up to four spatial candidates may be derived from candidate blocks located at positions shown in FIG. 8. The order in which spatial candidates are derived may be A1 → B1 → B0 → A0 → B2. However, the order in which spatial candidates are derived 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 unavailability of a block at a predetermined position may include a case in which the corresponding block belongs to a different slice or a different tile from the current block, or a case in which 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 spatial candidates at subsequent positions. For example, if the motion information of a subsequent spatial candidate is identical to 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 for subsequent spatial candidates are performed for only some candidate pairs, rather than for all candidate pairs, as much as possible, 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 the A1 position may be performed only on the spatial candidate at the B1 position. Also, a redundancy check for a spatial candidate at the B0 position may be performed only on the spatial candidate at the B1 position. Also, a redundancy check for a spatial candidate at the A0 position may be performed only on the spatial candidate at the A1 position. Finally, a redundancy check for a spatial candidate at the B2 position may be performed only on the spatial candidates at the B1 and A1 positions. However, the present invention is not limited to this, and even if the order in which spatial candidates are induced is changed, a redundancy check may be performed only on some candidate pairs as described above.
[0137] Referring back to FIG. 9, the image encoding / decoding apparatus may search for temporal peripheral blocks of the current block and insert derived temporal merge candidates into the merge candidate list (S920). The temporal peripheral blocks may be located on a reference picture that is a different picture from the current picture in which the current block is located. The reference picture in which the temporal peripheral blocks are located may be called a collocated picture or col picture. The temporal peripheral blocks may be searched in the order of the lower right corner peripheral block (C0 block) and the lower right center block (C1 block) of the 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. If the C0 block is available, temporal candidates may be derived based on the C0 block. If the C0 block is not available, temporal candidates may be derived based on the C1 block. For example, if the C0 block is an intra-predicted block or is located outside the current CTU row, it may be determined that the C0 block is unavailable. 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 within the certain storage unit, thereby achieving the effect of motion data compression. In this case, the certain storage unit can be predetermined, for example, in 16x16 sample units or 8x8 sample units, 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 realization, 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 shifting by a certain value, the motion information of the prediction block covering the position after arithmetic left shifting 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 the skip mode, the method for inducing the time candidate will be described more specifically. The time candidate can indicate the time merge candidate described above. Also, the motion vector of the time candidate can also correspond to the time candidate in the MVP mode.
[0139] Only one temporal candidate can be included in the merge candidate list. In the process of deriving a temporal candidate, the motion vector of the temporal candidate can be scaled. For example, the scaling can 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 can be performed based on the distance (tb) between the reference picture of the current block and the current picture and the distance (td) between the reference picture of the col block and the col picture. The tb and td can be expressed as values corresponding to the difference in Picture Order Count (POC) between pictures. The reference picture list used to derive the col block can be explicitly signaled in the slice header.
[0140] 9 again, the image encoding device / image decoding device may check whether the number of current merging candidates is smaller than the maximum number of merging candidates (S930). The maximum number of merging candidates may be predefined or may be signaled from the image encoding device to the image decoding device. For example, the image encoding device may generate information about the maximum number of merging candidates, encode it, and transmit it to the image decoding device in a bitstream format. If the maximum number of 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 current merge candidates is less than the maximum number of merge candidates, the image encoding / decoding apparatus may derive additional merge candidates based on a predetermined scheme and insert them into the merge candidate list (S940). The additional merge candidates may include, for example, 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] If, as a result of the check in step S930, the number of current merge candidates is not less than the maximum number of merge candidates, the image encoding device / image decoding device may terminate construction of the merge candidate list. In this case, the image encoding device may select an optimal merge candidate from among the merge candidates constituting the merge candidate list based on the RD cost, and may signal candidate selection information (e.g., a merge candidate index) indicating the selected merge candidate to the image decoding device. The image decoding device may select the optimal merge candidate based on the merge 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 the predicted sample of the current block may be derived based on the motion information of the current block. The image encoding apparatus may derive residual samples of the current block based on the predicted sample and signal residual information regarding the residual sample to the image decoding apparatus. As described above, the image decoding apparatus may generate reconstructed samples based on the residual samples derived based on the residual information and the predicted sample, and generate a reconstructed picture based on the reconstructed samples.
[0144] When the skip mode is applied to the current block, the motion information of the current block can be derived in the same manner as when the merge mode is applied to the previous block. However, when the skip mode is applied, the residual signal for the current block is omitted. Therefore, the predicted samples can be used directly 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 the current block. The table may store multiple history-based candidates during the encoding / decoding process. The table may be initialized when a new CTU row begins. Initializing the table may mean that all history-based candidates stored in the table are deleted and the table becomes empty. For each inter-predicted block, associated motion information may 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 may be used as a new history-based candidate.
[0147] The history-based candidate table can have a predetermined size. For example, the size can be 5. In this case, the table can store up to five history-based candidates. When a new candidate is added to the table, a limited first-in-first-out (FIFO) rule can be applied, in which a redundancy check is first performed to determine whether the same candidate already exists in the table. If the same candidate already exists in the table, the same candidate is deleted from the table, and the positions of all subsequent history-based candidates can be moved forward.
[0148] History-based candidates can be used in the process of constructing a merge candidate list. In this case, the history-based candidates most recently included in the table are checked sequentially and can be included in the merge candidate list at a position after the temporal candidate. When a history-based candidate is included in the merge candidate list, a redundancy check with spatial or temporal candidates already included in the merge candidate list can be performed. If a history-based candidate overlaps with a spatial or 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 represents the number of candidates already included in the merge candidate list and M represents the number of available history-based candidates stored in the table. That is, if the merge candidate list contains four or fewer candidates, the number of history-based candidates used to generate the merge candidate list is M. If the merge candidate list contains N candidates (more 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 can be generated by obtaining predefined candidate pairs from candidates included in the merge candidate list and averaging them. The predefined candidate pairs are {(0,1), (0,2), (1,2), (0,3), (1,3), (2,3)}, and the numbers constituting each candidate pair may be indices in the merge candidate list. That is, the predefined candidate pair (0,1) refers to a pair of candidate index 0 and candidate index 1 in the merge candidate list, and the pair-wise average candidate can be generated by averaging candidate index 0 and candidate index 1. Pair-wise average candidates can be derived in the order of the predefined candidate pairs. That is, after deriving a pair-wise average candidate for candidate pair (0,1), a pair-wise average candidate derivation process can be performed in the order of candidate pair (0,2) and candidate pair (1,2). The pair-wise average candidate derivation process can be performed until the construction of the merge candidate list is completed. For example, the pair-wise average candidate derivation process may be performed until the number of merge candidates included in the merge candidate list reaches the maximum number of merge 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 the motion vector for the pair-wise average candidate. If not all two motion vectors are available for one reference picture list, the reference picture list can be determined to be invalid.
[0154] If the construction of the merge candidate list is not complete even after the pair-wise average candidate is 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 vectors of reconstructed spatial surrounding blocks (e.g., surrounding blocks shown in FIG. 8) and / or motion vectors corresponding to temporal surrounding blocks (or Col blocks). That is, the motion vectors of reconstructed spatial surrounding blocks and / or motion vectors corresponding to temporal surrounding blocks can be used as motion vector predictor candidates for 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 may 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 for the current block from the motion vector predictor candidates included in the MVP candidate list using the candidate selection information. A prediction unit of an image encoding device can obtain a motion vector differential (MVD) between a motion vector of a current block and a motion vector predictor, encode the obtained MVD, and output the MVD in a bitstream format. That is, the MVD can be obtained by subtracting the motion vector predictor from the motion vector of the current block. A prediction unit of an image decoding device can obtain a motion vector differential included in information related to the prediction, and derive the motion vector of the current block by adding the motion vector differential and the motion vector predictor. The prediction unit of an image decoding device can obtain or derive a reference picture index, etc., indicating a reference picture, 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, spatial candidate blocks for the current block are searched for and available candidate blocks are 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 can be searched for and the available candidate blocks can be inserted into the MVP candidate list (S1030). If no temporal candidate blocks are available, the construction of the MVP candidate list can 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 separately signaled. For example, when the MVP mode is applied and bi-prediction (BI prediction) is applied, information about refidxL0 and information about refidxL1 may both be signaled.
[0160] As described above, when the MVP mode is applied, information about the MVD derived from the image coding apparatus can be signaled to the image decoding apparatus. The information about the MVD can include, for example, information indicating x and y components of the MVD absolute value and sign. In this case, information indicating whether the MVD absolute value is greater than 0, whether it is greater than 1, and the rest of the MVD can be signaled in stages. For example, information indicating whether the MVD absolute value is greater than 1 can be signaled only when the value of flag information indicating whether the MVD absolute value is greater than 0 is 1.
[0161] Affine mode, an example of an inter prediction mode, will now be described in detail. Conventional video encoding / decoding systems use only one motion vector to represent motion information of a current block. However, this method only represents optimal motion information in block units, and is unable to represent optimal motion information in pixel units. To address this issue, affine mode has been proposed, which defines motion information of a block in pixel units. According to the affine mode, a motion vector for each pixel / sub-block of a block can be determined using two to four motion vectors associated with the current block.
[0162] While conventional motion information is expressed using the translation (or displacement) of pixel values, the affine mode can express pixel-specific motion information using at least one of translation, scaling, rotation, and shear. Among these, an affine mode in which pixel-specific motion information is expressed using displacement, scaling, or rotation can be defined as a similarity or simplified affine mode. In the following description, the affine mode can refer to the similarity or simplified affine mode.
[0163] Motion information in affine mode can be expressed using two or more Control Point Motion Vectors (CPMVs). 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-specific and / or sub-block-specific 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 Figure 11. Also, the 6-parameter model can refer to a model type in which three CPMVs (v0, v1, v2) are used, as shown in Figure 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 corner 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] During the encoding / decoding process, the affine MVF may be determined in pixel units and / or in predefined sub-block units. When the affine MVF is determined in pixel units, a motion vector may be derived based on each pixel value. On the other hand, when the affine MVF is determined in sub-block units, a motion vector for the sub-block may be derived based on the central pixel value of the sub-block. The central pixel value may refer to a virtual pixel located at the center of the sub-block, or the pixel located at the bottom right of the four central pixels. Alternatively, the central pixel value may be a specific pixel within the sub-block that represents the sub-block. In this disclosure, the affine MVF will be described as being determined in 4x4 sub-block units. However, this is for convenience of explanation, and the size of the sub-block may be variously changed.
[0172] That is, when affine prediction is available, motion models applicable to the current block can include three: a translational motion model, a 4-parameter affine motion model, and a 6-parameter affine motion model. Here, the translational motion model can refer to a model in which a conventional block-based motion vector is used, the 4-parameter affine motion model can refer to a model in which two CPMVs are used, and the 6-parameter affine motion model can refer to a model in which three CPMVs are used. The affine mode can be divided into detailed modes depending on the method of encoding / decoding motion information. For example, the affine mode can be further 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 then used as the CPMV of the current block.
[0174] Meanwhile, in the case of affine merge in which MVs are derived on a subblock basis, this may be referred to as 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 referred to as a subblock merging candidate list. In this case, the subblock merging candidate list may further include candidates derived by SbTMVP (described later). In this case, the candidate derived by sbTMVP may be used as the candidate with the zeroth index in the subblock merging candidate list. In other words, the candidate derived by sbTMVP may be positioned 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 constructed for CPMV derivation of the current block. The affine merge candidate list can include at least one of inherited affine merge candidates, combined affine merge candidates, and zero merge candidates. The inherited affine merge candidate can refer to a candidate derived using the CPMV of a neighboring block of the current block when the neighboring block is encoded / decoded in affine mode. The combined affine merge candidate can refer to a candidate whose CPMV is derived based on the motion vector of the neighboring block of each control point (CP). Meanwhile, the zero merge candidate can refer to a candidate whose CPMV is zero-sized. In the following description, a CP can refer to a specific position of a block used to derive a CPMV. For example, a CP can be the position of each vertex of a block.
[0177] FIG. 13 is a diagram for explaining a method for generating an affine merge candidate list.
[0178] Referring to the flowchart in Figure 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 reach the maximum number of candidates, even after 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 reaches the maximum number of candidates.
[0179] FIG. 14 is a diagram for explaining a method for 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 neighboring block and the upper neighboring block. Neighboring blocks for deriving inherited affine merge candidates will be described with reference to FIG. 8. The inherited affine merge candidate derived based on the left neighboring block can be derived based on at least one of A0 and A1, and the inherited affine merge candidate derived based on the upper neighboring block can be derived based on at least one of B0, B1, and B2. In this case, the scan order of each neighboring block can be, but is not limited to, A0 to A1 and B0 to B1 to B2. The inherited affine merge candidate can be derived based on the first neighboring block available in the scan order for the left and upper sides, respectively. In this case, redundancy checking may not be performed between the candidates derived from the left neighboring block and the upper neighboring block.
[0181] For example, as shown in FIG. 14, if the left neighboring block A is coded / decoded in the affine mode, at least one of motion vectors v2, v3, and v4 corresponding to the CP of neighboring block A can be derived. If neighboring block A is coded / decoded using a 4-parameter affine model, the inherited affine merge candidate can be derived using v2 and v3. On the other hand, if neighboring block A is coded / decoded using 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 combined affine merge candidates.
[0183] A combined affine candidate may refer to a candidate whose CPMV is derived using a combination of general motion information of neighboring blocks. Motion information for each CP may be derived using spatial or temporal neighboring blocks of the current block. In the following description, CPMVk may refer to the motion vector representing the kth CP. For example, referring to FIG. 15, CPMV1 may be determined as the first available motion vector among the motion vectors B2, B3, and A2, and the scan order may be B2, B3, and A2. CPMV2 may be determined as the first available motion vector among the motion vectors B1 and B0, and the scan order may be B1, B0. CPMV3 may be determined as the first available motion vector among the motion vectors A1 and A0, and the scan order may be A1, A0. If TMVP is applicable to the current block, CPMV4 may be determined as the motion vector of T, a temporal neighboring block.
[0184] After 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 include at least two motion vectors selected from the four derived motion vectors for each CP. For example, the combined affine merge candidate can be configured in the following order: {CPMV1, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV4}, {CPMV1, CPMV3, CPMV4}, {CPMV2, CPMV3, CPMV4}, {CPMV1, CPMV2}, and {CPMV1, CPMV3}. A combined affine candidate consisting of three motion vectors can be a candidate for a six-parameter affine model. In contrast, a combined affine candidate consisting of two motion vectors can be a candidate for a four-parameter affine model. To avoid a motion vector scaling process, if the reference picture indexes of the CPs are different, the associated CPMV combinations 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 can 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 can be signaled from the coding apparatus to the decoding apparatus. The image decoding apparatus can derive CPMV predictors for the current block, restore the signaled CPMV differences, and then derive CPMV for 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 mode is not applied to the current block. Meanwhile, the affine MVP mode can also be expressed as the 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 inheritance affine MVP candidates, combination affine MVP candidates, translation affine MVP candidates, and zero MVP candidates.
[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 the CP neighboring block. The zero MVP candidate may refer to a candidate consisting of a CPMV value of 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 here.
[0189] If the maximum number of candidates in the affine MVP candidate list is 2, combined affine MVP candidates, translation affine MVP candidates, and zero MVP candidates can be added if the current number of candidates is less than 2. In particular, 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. That is, 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 the combined affine MVP candidate CPMV2 is valid, CPMV2 can be used as the affine MVP candidate. That is, an affine MVP candidate whose motion vectors 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 TMVP (temporal motion vector predictor) 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 inherited affine MVP candidates may be the same as the scan order of inherited affine merge candidates. However, for inherited affine MVP candidates, only neighboring blocks that reference the same reference picture as the current block's reference picture can be considered. When adding an inherited affine MVP candidate to the affine MVP candidate list, redundancy checks may not 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 references 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. In 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 on a coding unit basis, a coding unit to which the sub-block-based TMVP mode is applied can encode / decode motion vectors on a sub-coding unit basis. Furthermore, while the conventional TMVP mode derives temporal motion vectors from collocated blocks, the sub-block-based TMVP mode derives motion vector fields from reference blocks indicated by motion vectors derived from neighboring blocks of the current block. Hereinafter, the motion vector derived from the neighboring blocks may be referred to as the 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, neighboring blocks for determining the motion shift can be determined. As an example, scanning of neighboring blocks for determining the motion shift can be performed in the order of A1, B1, B0, and A0 blocks in FIG. 17. As another example, neighboring blocks for determining the motion shift can be limited to specific neighboring blocks of the current block. For example, the neighboring block for determining the motion shift can always be determined as block A1. If a neighboring block has a motion vector that references a col picture, the motion vector can be determined as the motion shift. The motion vector determined as the motion shift can also be referred to as a temporal motion vector. On the other hand, if the above motion vector cannot be derived from a neighboring block, the motion shift can be set to (0,0).
[0203] FIG. 18 is a diagram for explaining a method for deriving a motion vector field according to the sub-block-based TMVP mode.
[0204] Next, a reference block in the co-located picture indicated by the motion shift can be determined. For example, by adding the motion shift to the coordinates of the current block, sub-block-based motion information (motion vector, reference picture index) can be obtained from the col picture. In the example shown in FIG. 18, the motion shift is assumed to be the motion vector of block A1. By applying the motion shift to the current block, sub-blocks (col sub-blocks) in the col picture corresponding to each sub-block constituting the current block can be identified. Then, motion information for each sub-block of the current block can be derived using motion information of the corresponding sub-block (col sub-block) in the col picture. For example, motion information for the corresponding sub-block can be obtained from the center position of the corresponding sub-block. In this case, the center position may be the position of the bottom right sample among the four samples located in the center of the corresponding sub-block. If motion information for a specific sub-block of the col block corresponding to the current block is not available, motion information for the central sub-block of the col block can be determined as the motion information for that sub-block. Once the motion information for the corresponding sub-block is derived, the motion vector and reference picture index for the current sub-block can be switched, similar to the TMVP process described above. That is, when a sub-block-based motion vector is derived, the motion vector can 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 can be merged to form a subblock-based merge candidate list.
[0207] Meanwhile, a sub-block-based TMVP mode flag can be defined to indicate whether sub-block-based TMVP mode is applicable to the current block. This can be signaled at at least one level above the current block, such as sequence, picture, slice, tile, tile group, or brick. For example, the sub-block-based TMVP mode flag can be named sps_sbtmvp_enabled_flag. If sub-block-based TMVP mode is applicable to the current block, sub-block-based TMVP candidates can be added first to the sub-block-based merge candidate list. Then, affine merge candidates can be added to the sub-block-based merge candidate list. Meanwhile, the maximum number of candidates that can be included in the sub-block-based merge candidate list can be signaled. For example, the maximum number of candidates that can be included in the sub-block-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 can be pre-set to M×N. For example, M×N can be 8×8. Therefore, 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 example of a predictive execution method according to the present disclosure will be described below. The predictive execution method described below 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 motion information derived according to a prediction mode. The predicted block (prediction block) may include prediction samples (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, thereby deriving prediction samples of the current block based on reference samples in fractional sample units within a reference picture. If affine inter-prediction is applied to the current block, prediction samples may be generated based on sample / sub-block unit MVs. If bi-prediction is applied, prediction samples derived by a weighted sum or weighted average (by phase) of prediction samples derived based on L0 prediction (i.e., prediction using a reference picture in reference picture list L0 and MVL0) and prediction samples derived based on L1 prediction (i.e., prediction using a reference picture in reference picture list L1 and MVL1) may be used as prediction samples 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 relative to the current picture (i.e., if it is bi-predictive but also corresponds to bidirectional prediction), this can be called true bi-prediction.
[0211] In the image decoding device, reconstructed samples and reconstructed pictures can be generated based on the derived predicted samples, and then procedures such as in-loop filtering can be performed. Also, in the image coding device, residual samples can be derived based on the derived predicted samples, and image information including prediction information and 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, weights for performing the weighted average may be determined based on a weight index derived at the CU level. Conventionally, a bi-predictive signal (i.e., a bi-predictive sample) can 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 MVL0 and an L1 predicted sample based on an L1 reference picture and 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 the L0 predicted signal and the 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 using weighted averaging, five weights are allowed. For example, the weight w can be selected from {-2, 3, 4, 5, 10}. For each bi-predicted CU, the weight w can be determined in one of two ways. In the first of these two ways, if the current CU is not in merge mode (non-merge CU), a weight index can be signaled along with the motion vector differential. For example, the bitstream can include information about the weight index after information about the motion vector differential. In the second of these two ways, if the current CU is in merge mode (merge CU), the weight index can be derived from neighboring blocks based on merge candidate indexes (merge indexes).
[0216] Generation of a bi-predictive signal using weighted averaging may be limited to be applied only to CUs having a size including 256 or more samples (luma component samples). That is, weighted averaging bi-prediction may be performed only on CUs whose current block width and height product is 256 or more. Furthermore, the weight w may be one of the five weights described above, or one of a different number of weights. For example, five weights may be used for a low-delay picture and three weights may be used for a non-low-delay picture depending on the characteristics of the current picture. In this case, the three weights may be {3, 4, 5}.
[0217] The image encoding apparatus can determine the weight indexes without significantly increasing complexity by applying a fast search algorithm. In this case, the fast search algorithm can be summarized as follows: Hereinafter, unequal weights may mean that weights applied to P0 and P1 are not equal. Also, equal weights may mean that weights applied to P0 and P1 are equal.
[0218] -When the AMVR mode, in which the motion vector resolution is adaptively changed, is applied together, 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 an 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 unequal weights.
[0220] If the two reference pictures used for bi-prediction are identical, only unequal weights can be conditionally checked.
[0221] The unequal weights may not be checked if a predetermined 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. 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. According to 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 a CU that uses weighted prediction. In this case, the weight can be inferred to be 4, i.e., equal weighting can be applied.
[0224] For a CU with merge mode applied, the weight index can be inferred from neighboring blocks based on the merge candidate index, which is applicable for both normal merge mode and inherited affine merge mode.
[0225] In 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 can be assigned as the weight index of the combined affine merge candidate. Otherwise, the weight index of the combined affine merge candidate can be set to 2.
[0228] The invention according to the present disclosure described below relates to weighted average-based bidirectional prediction, and specifically includes a method for deriving BCW weight indexes when constructing temporal candidates for merge mode or temporal candidates for sub-block merging mode. The present disclosure also provides a method for deriving BCW weight indexes when deriving pair-wise (merge) candidates. Hereinafter, the BCW weight index may be simply referred to as a weight index. The present disclosure also provides various embodiments for deriving weight indexes for combined affine merge candidates. 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 kth CP can be derived. That is, CPMV1 may be the motion vector representing the first CP (upper-left CP, CP0), CPMV2 may be the motion vector representing the second CP (upper-right CP, CP1), CPMV3 may be the motion vector representing the third CP (lower-left CP, CP2), and CPMV4 may be the motion vector representing the fourth CP (lower-right CP, RB or CP3). CP combinations 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 this order.
[0231] According to an example of this embodiment, the weight index for the combined affine merge candidate may be derived from the weight index of the 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 derived from the weight index of the 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 derived from 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 derived from the weight index of the 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 can 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 can be used as a weight index for the combined affine merge candidate. For example, if the combination of CPs for deriving the 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 can be derived to the weight index of CP1.
[0233] According to another example of this embodiment, a weight index for a combined affine merge candidate may 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) may be used 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 may be used. For example, in the case of a combination of {CP0, CP2, CP3(RB)}, if the weight indexes for CP2 and RB are the same, the weight index for the combined affine merge candidate may be derived to the weight index of CP2 and RB with the highest frequency of occurrence. In this case, the weight index for RB may be derived based on a method for deriving a weight index for a temporal candidate according to the present disclosure.
[0234] Hereinafter, a combined affine candidate inducing method according to another embodiment of the present disclosure will be described in detail with reference to FIGS.
[0235] The combined affine merge candidate deriving method according to this embodiment can be composed of 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 about each CP.
[0236] 19 is a diagram illustrating a method for deriving combined affine merge candidates according to another embodiment of the present disclosure, which includes deriving weight indices for the combined affine merge candidates.
[0237] 19, the image encoding apparatus or the image decoding apparatus may first derive information for each CP of the current block to derive combined affine merge candidates (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 for CPn (bcwIdxCorner[n]).
[0238] According to this embodiment, the weight index for the combined affine merge candidate can be derived from the weight index of the first CP in each combination. As described above, the combination for deriving the combined affine merge candidate can 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 information about CPn described above, the weight index for CPn can be derived only for CP0 and CP1. That is, the process of deriving the weight index for CPn can be omitted for CP2 and CP3. This is because even if the weight index for CP2 or CP3 is derived, these weight indexes are not used as weight indexes for the combined affine merge candidate.
[0239] Once information for each CP is derived in step S1910, the image encoding or decoding apparatus can derive combined affine merge candidates based on the information for each CP (S1920). Step S1920 can be performed for each of the combinations for deriving combined affine merge candidates. In this case, the image encoding or 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 is available, step S1920 can be performed for all of the combinations including the three CPs and the two CPs. Otherwise, if a 6-parameter model is not available, step S1920 can be performed only for the combinations including the two CPs. This is because a 6-parameter model is a model that references three CPs, and therefore, if a 6-parameter model is not available, there is no need to construct combined affine merge candidates for combinations including three CPs. The information indicating whether a 6-parameter model can be used can be signaled via the bitstream. For example, it can be signaled by being included in a sequence parameter set, which is a higher level of the 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 Figure 20 may be performed for each of the CPs of the current block. The execution order may be CP0, CP1, CP2, and CP3. However, this is not limiting, and the execution order may be different, or the execution order may be different for some or all of the CPs simultaneously.
[0242] First, in step S2010, candidate blocks for the current CP are identified. The candidate blocks for each CP are as described with reference to FIG. 15. For example, the candidate blocks for CP0 may be B2, B3, and A2, the candidate blocks for CP1 may be B1 and B0, the candidate blocks for CP2 may be A1 and A0, and the candidate block for CP3 may be T. When the method of FIG. 20 is performed for each CP, the candidate blocks may be checked in the order (scan order) described above. Therefore, if there are multiple candidate blocks, the first candidate block may be identified first. For example, B2, the first candidate block for CP0, may 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 present in the current picture, whether the candidate block and the current block are present 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 present outside the current picture, if the candidate block and the current block are present in different slices or different tiles, or if 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 is 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 can 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) can 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 about 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 about the current CP. In this case, as described above, the weight index of the available candidate block can be used as the weight index of the current CP only if the current CP is CP0 or CP1. 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, a combination affine merge candidate 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 can 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. The order of execution can be, for example, the order listed above. Furthermore, as noted above, the method of Figure 21 can be performed for only some of the combinations depending on the availability of a six-parameter model.
[0250] First, in step S2110, CPs in the current combination for deriving a combined affine merge candidate are identified. Then, in step S2120, availability of the CPs in the current combination is 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 determined in step S2130. For example, if the current combination is {CP0, CP1, CP2}, and for a prediction direction LX (X is 0 or 1), if prediction direction information (predFlagLXCorner[n]) of CP0, CP1, and CP2 is all 1 and the reference picture indexes (refIdxLXCorner[n]) of CP0, CP1, and CP2 are all the same, the availability for the prediction direction LX may be determined to be "available"; otherwise, it may be determined to be "unavailable."
[0252] Then, in step S2140, it is determined whether the prediction direction LX is available. If it is available (S2140-Yes), the process can proceed to step S2150. In step S2150, a combined affine merge candidate can be derived for the prediction direction LX based on the CP information. For example, if 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 CP1, the motion vector (cpMvLXCorner[1]) of CP1, and the motion vector (cpMvLXCorner[2]) of CP2 can be assigned to the reference picture index (refIdxLXConst1), CPMV1, CPMV2, and CPMV3 of the combined 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 for the combined affine merge candidate may be derived. Step S2160 may be performed based on the availability of the prediction direction LX. For example, if both L0 and L1 are available, the weight index for 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 for CP0 may be used as the weight index for the combined affine merge candidate. If L0 or L1 is not available, the weight index for 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 for the current combination may be derived. Step S2170 may be performed based on availability for the 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 derived to "available." In this case, if the number of CPs in the current combination is three, the motion model of the current combination may be derived to 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 derived to a four-parameter affine model.
[0255] Otherwise (if neither L0 nor L1 is available), the availability of the current combination may be induced to "unavailable." Also, the motion model of the current combination may be induced to 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 L. To this end, the availability information for each prediction direction derived in step S2130 may be input (S2210).
[0258] Then, 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 from 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 predetermined index (S2240), as described above. The predetermined 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 omit the process of determining whether L0 and L1 are available, thereby reducing computational complexity and enabling faster processing.
[0261] Hereinafter, with reference to FIG. 23, a method for deriving weight indices for combining affine merge candidates according to another embodiment of the present disclosure will be described.
[0262] According to this embodiment, weight indices for combined affine merge candidates 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 indices may have values from 0 to 4 and may be classified into three groups. For example, the weight indices 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 from 0 to 2. By classifying the weight indices 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 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, respectively. bcwIdxGroup0, bcwIdxGroup1, and bcwIdxGroup2 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, respectively. 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), step S2330 checks whether bcwIdxCorner0 and bcwIdxCorner2 are the same, and whether bcwIdxGroup0 and bcwIdxGroup1 are the same. If they are the same (S2330-Yes), bcwIdxConst can be steered to bcwIdxCorner0 (S2320).
[0267] If not (S2330-No), step S2340 checks whether bcwIdxCorner1 and bcwIdxCorner2 are the same, and whether bcwIdxGroup1 and bcwIdxGroup0 are the same. If they are the same (S2340-Yes), bcwIdxConst can be steered to bcwIdxCorner2 (S2350).
[0268] Otherwise (S2340-No), bcwIdxConst may be set to a default index (S2360). The default index may be, for example, an index indicating equal weight.
[0269] According to the example shown in FIG. 23, when three CPs are used, a weight index for the combined affine merge candidate 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 set to the default index, and the time candidate is included as the last CP in each combination. Therefore, in the method shown in Figure 23, the comparison for bcwIdxCorner2 can be omitted.
[0271] In this case, step S2330 can be performed by checking whether bcwIdxGroup0 and bcwIdxGroup1 are the same, and step S2340 can be performed by checking whether bcwIdxGroup0 and bcwIdxGroup1 are the same. In this case, steps S2330 and S2340 can be combined into one step because they check essentially the same condition.
[0272] FIG. 24 is a flowchart illustrating a method for omitting the comparison for 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 set to the default index (S2440).
[0276] The method shown in Figure 23 can be simplified as follows. For example, three weights are used as in 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 Figure 23.
[0277] FIG. 25 is a flowchart illustrating a method for omitting comparisons 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 steered 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 can be set to the 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 constructing motion vector candidates for a sub-block-based merge mode may be provided. As described with reference to FIG. 18, sub-block-based TMVP may derive a col block corresponding to a current block based on a motion shift. Here, as shown in FIG. 18, the motion shift may be derived from a left block A1 that is 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 may be used as the weight index of the current block. That is, when a candidate derived in ATMVP uses bidirectional prediction, the weight index of the left block may be used as the weight index for the sub-block merge mode. Alternatively, when the motion shift is derived from a neighboring block other than the A1 block, the weight index of the neighboring block may be used as the weight index of the current block. According to this embodiment, when constructing motion vector candidates for a sub-block-based merge mode, weight indices for representative predictor vector candidates may be efficiently constructed, thereby improving coding efficiency without increasing complexity.
[0287] According to another embodiment of the present disclosure, when a temporal merge candidate uses bidirectional prediction in deriving merge candidates 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 set to a default index (e.g., 0). In this disclosure, the default index may be an index indicating 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 a temporal merge candidate can be derived from the weight index of a col-block (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, 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 set to a default index (e.g., 0). In this case, if a temporal candidate is selected from the sub-block merge candidate list based on the merge 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 a temporal candidate may be derived from the weight index of a center block. The center block may be a block in a col picture including coordinates corresponding to the center position of the current block. The coordinates corresponding to the center position may be derived based on the upper left coordinate (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 a temporal candidate may be derived from the weight index of a 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 a temporal candidate of the current sub-block may be derived from the weight index of the center block.
[0294] According to another embodiment of the present disclosure, when deriving merge candidates for a merge mode, coding efficiency can be improved by efficiently deriving weight indices for pair-wise candidates. 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 pair 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 pairwise 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) between 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 bidirectionally predicted candidate between cand0 and cand1
[0299] If cand0 and cand1 have the same weight index, it is set to that weight index; otherwise, it can be set to the 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 this embodiment, consistency with the induction method for combined affine candidates can be considered. This is because pairwise candidates and 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 candidate.
[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 (e.g., 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 the steps may be performed simultaneously or in a different order if necessary. To achieve the method according to the present disclosure, the steps illustrated may include other steps, or some steps may be omitted and the remaining steps may be included, or some steps may be omitted and additional other 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 and 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.
[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 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, an image decoding apparatus and an image encoding apparatus to which an embodiment of the present disclosure is applied may be included in a multimedia broadcast transmitting / receiving apparatus, a mobile communication terminal, a home cinema video apparatus, a digital cinema video apparatus, a surveillance camera, a video conversation apparatus, a real-time communication apparatus such as video communication, a mobile streaming apparatus, a storage medium, a camcorder, a video on demand (VoD) service providing apparatus, an over-the-top (OTT) video apparatus, an internet streaming service providing apparatus, a three-dimensional (3D) video apparatus, an image telephone video apparatus, a medical video apparatus, etc., and may be used to process a video signal or a data signal. For example, an over-the-top (OTT) video apparatus 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), etc.
[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 can 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, or camcorder 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, or video camera directly generates a bitstream, the encoding server can be omitted.
[0312] The bitstream can 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 can temporarily store the bitstream during 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 serves as an intermediary for informing 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, which then transmits the multimedia data to the user. In this case, the content streaming system may include a separate control server, which may control commands and responses between devices in the content streaming system.
[0314] The streaming server may receive content from a media storage and / or an encoding server. For example, when receiving 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 to provide a smooth streaming service.
[0315] Examples of the user device include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a personal digital assistant (PDA), a portable multimedia player (PMP), a navigation system, a slate PC, a tablet PC, an ultrabook, a wearable device such as a smartwatch, smart glass, a head mounted display (HMD), a digital TV, a desktop computer, 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 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] 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: determining whether an inter prediction mode of the current block is a sub-block merging mode based on a first flag; constructing a sub-block merging candidate list for the current block based on the inter prediction mode of the current block being the 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 of the current block based on the motion information of the current block; deriving a residual block of the current block; reconstructing the current block based on the predicted block of the current block and the residual block of the current block; the constructing the sub-block merging candidate list includes deriving combined sub-block merging candidates, and the deriving the combined sub-block merging candidates includes deriving weight indices for bi-prediction of the combined sub-block merging candidates; and the step of deriving the combined sub-block merging candidate is performed based on motion information of each candidate control point (CP) included in a predefined combination of candidate control points among a plurality of candidate control points for the current block; The weight index of the combined sub-block merging candidate is derived as a weight index for bi-prediction of a first candidate CP among the candidate CPs included in the combination without performing a comparison between weight indexes of the candidate CPs; The first candidate CP among the candidate CPs included in the combination is an upper left candidate CP or an upper right candidate CP with respect to the current block, 10. The image decoding method, wherein available inherited affine candidates derived from neighboring blocks of the current block are added to the sub-block merging candidate list before the combined sub-block merging candidate.
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 motion information of the candidate CP includes a weight index for bi-prediction; The image decoding method according to claim 1 , wherein the weight index of the candidate CP is derived based on whether the candidate CP is the top-left candidate CP or the top-right candidate CP for the current block.
4. the motion information of the candidate CP includes a weight index for bi-prediction; The image decoding method of claim 1 , wherein the weight index of the candidate CP is not derived based on whether the candidate CP is 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 image decoding method of claim 4 , wherein the step of deriving the combined sub-block merging candidates is performed based on the availability of all candidate CPs included in the combination of the pre-defined candidate CPs.
7. the weight index of the combined sub-block merging candidate is derived based on whether a prediction direction for the combination is available; The image decoding method according to claim 1 , wherein whether the prediction direction for the combination is available is determined based on motion information of the candidate CPs included in the combination.
8. 8. The image decoding method of claim 7, wherein the 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 whether the prediction direction for the combination is available for both an L0 direction and an L1 direction.
9. 8. The image decoding method of claim 7, wherein the weight index of the combined sub-block merging candidate is derived as a predetermined weight index based on whether the prediction direction for the combination is unavailable for at least one of an L0 direction or 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 the residual block of the current block; encoding a first flag indicating whether an inter prediction mode of the current block is a sub-block merge mode; 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 comprises: constructing a sub-block merging candidate list for the current block based on the inter prediction mode of the current block being the sub-block merging mode; encoding the motion information of the current block based on the sub-block merging candidate list; the constructing the sub-block merging candidate list includes deriving combined sub-block merging candidates, and the deriving the combined sub-block merging candidates includes deriving weight indices for bi-prediction of the combined sub-block merging candidates; and the step of deriving the combined sub-block merging candidate is performed based on motion information of each candidate control point (CP) included in a predefined combination of candidate control points among a plurality of candidate control points for the current block; The weight index of the combined sub-block merging candidate is derived as a weight index for bi-prediction of a first candidate CP among the candidate CPs included in the combination without performing a comparison between weight indexes of the candidate CPs; The first candidate CP among the candidate CPs included in the combination is an upper left candidate CP or an upper right candidate CP with respect to the current block, 10. A method for encoding an image, wherein available inherited affine candidates derived from neighboring blocks of the current block are added to the sub-block merging candidate list before the combined sub-block merging candidate.
11. 1. A method for transmitting a bitstream generated by an image coding method, the image coding method 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; encoding a first flag indicating whether an inter prediction mode of the current block is a sub-block merge mode; 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 comprises: constructing a sub-block merging candidate list for the current block based on the inter prediction mode of the current block being the sub-block merging mode; encoding the motion information of the current block based on the sub-block merging candidate list; the constructing the sub-block merging candidate list includes deriving combined sub-block merging candidates, and the deriving the combined sub-block merging candidates includes deriving weight indices for bi-prediction of the combined sub-block merging candidates; and the step of deriving the combined sub-block merging candidate is performed based on motion information of each candidate control point (CP) included in a predefined combination of candidate control points among a plurality of candidate control points for the current block; The weight index of the combined sub-block merging candidate is derived as a weight index for bi-prediction of a first candidate CP among the candidate CPs included in the combination without performing a comparison between weight indexes of the candidate CPs; The first candidate CP among the candidate CPs included in the combination is an upper left candidate CP or an upper right candidate CP with respect to the current block, The method of claim 1, wherein available inherited affine candidates derived from neighboring blocks of the current block are added to the sub-block merging candidate list before the combined sub-block merging candidate.