Video decoding method and device for deriving weight index information for generation of prediction sample

By generating weighted index information of the predicted samples, the problem of low encoding efficiency of high-resolution videos is solved, and the video encoding efficiency and Immersive Media are improved. In particular, the control point motion vector (CPMV) is used to improve the encoding efficiency when generating predicted samples.

JP2025019130AActive Publication Date: 2025-02-06LG ELECTRONICS INC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2024202107
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-06-14
Filing Date
2024-11-20
Publication Date
2025-02-06
Estimated Expiration
2040-06-10

AI Technical Summary

Technical Problem

Existing video encoding technologies are difficult to efficiently compress and transmit high-resolution, high-quality video data, especially with challenges in transmission and storage costs, while encoding Immersive Media such as virtual reality and augmented reality content is less efficient.

Method used

By generating weighted index information of the prediction sample, the method and device for generating prediction samples using the weighted index information includes receiving video information, generating a merged candidate list, derive motion information, generating L0 and L1 prediction samples, and generating prediction samples of the current block based on the weighted value index information, especially by controlling point motion vectors (CPMVs) to improve coding efficiency.

Benefits of technology

It improves the overall efficiency of video encoding, improves the construction efficiency of motion vector candidates, and can efficiently perform weighted value benchmarks for bidirectional prediction, and improves the encoding efficiency of Immersive Media.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025019130000001_ABST
    Figure 2025019130000001_ABST
Patent Text Reader

Abstract

To provide a video decoding method to be executed by a decoding device.SOLUTION: A method includes: generating, based on inter-prediction mode information, a merge candidate list for a current block; deriving motion information on the current block based on a candidate selected from the merge candidate list; generating L0 prediction samples and L1 prediction samples of the current block based on the motion information; and generating prediction samples of the current block based on the L0 prediction samples, the L1 prediction samples, and a weight index for the current block. The candidates include a constructed affine merge candidate. A weight index for the constructed affine merge candidate is set to be equal to a weight index for CP 1, based on a configuration where the constructed affine merge candidate is constructed based on CPMV1 for CP1, CPMV2 for CP2 and CPMV3 for CP3.SELECTED DRAWING: Figure 14
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present technology relates to a video decoding method and apparatus for deriving weighted index information for generating predicted samples. [Background technology]

[0002] In recent years, the demand for high-resolution, high-quality images / videos such as 4K or 8K or higher UHD (Ultra High Definition) images / videos is increasing in various fields. As the image / video data has higher resolution and quality, the amount of information or bits to be transmitted increases relatively compared to existing image / video data, so that when image data is transmitted using a medium such as an existing wired or wireless broadband line or image / video data is stored using an existing storage medium, the transmission cost and storage cost increase.

[0003] In addition, in recent years, interest in and demand for immersive media such as virtual reality (VR), artificial reality (AR) content, and holograms has been increasing, and the broadcast of images / videos having different image characteristics from real images, such as game images, has been increasing.

[0004] Therefore, there is a demand for highly efficient image / video compression technology to effectively compress and transmit, store, and play back high-resolution, high-quality image / video information having the various characteristics described above. Summary of the Invention [Problem to be solved by the invention]

[0005] The technical problem of this document is to provide a method and apparatus for improving the efficiency of video coding.

[0006] Another technical problem of this document is to provide a method and apparatus for deriving weight index information for generating prediction samples in inter prediction.

[0007] Yet another technical problem of this document is to provide a method and apparatus for deriving weight index information for candidates in an affine merge candidate list during bi-prediction. [Means for solving the problem]

[0008] According to an embodiment of the present document, there is provided a video decoding method performed by a decoding device, the method including the steps of: receiving video information including inter prediction mode information through a bitstream; generating a merge candidate list for a current block based on the inter prediction mode information; deriving motion information of the current block based on a candidate selected from the merge candidate list; generating an L0 prediction sample and an L1 prediction sample for the current block based on the motion information; generating a prediction sample for the current block based on the L0 prediction sample, the L1 prediction sample and weight information, the weight information being derived based on weight index information for the selected candidate, the candidates including affine merge candidates, the affine merge candidates including a Control Point Motion Vector (CPMV), the affine merge candidates being located at a top left corner of the current block, and If the affine merge candidate includes CPMV0 for CP0 located in the upper left side of the current block, weight index information for the affine merge candidate is derived based on the 0th weight index information for the CP0, and if the affine merge candidate does not include CPMV0 for CP0 located in the upper left side of the current block, weight index information for the affine merge candidate is derived based on the 1st weight index information for CP1 (Control Point 1) located in the upper right side of the current block.

[0009] According to another embodiment of the present document, there is provided a video encoding method performed by an encoding apparatus, the method including the steps of: determining an inter prediction mode of a current block and generating inter prediction mode information indicating the inter prediction mode, generating a merge candidate list for the current block based on the inter prediction mode, generating selection information indicating one of the candidates included in the merge candidate list, and encoding image information including the inter prediction mode information and the selection information, the candidates including an affine merge candidate, the affine merge candidate including a control point motion vector (CPMV), and if the affine merge candidate includes a CPMV0 for a control point 0 (CP0) located at an upper left side of the current block, weighted value index information for the affine merge candidate is indicated based on a 0th weighted value index information for the CP0, and if the affine merge candidate does not include a CPMV0 for a control point 0 (CP0) located at an upper left side of the current block, weighted value index information for the affine merge candidate is indicated based on a first weighted value index information for a control point 1 (CP1) located at an upper right side of the current block.

[0010] According to yet another embodiment of the present document, there is provided a computer-readable digital storage medium having stored thereon a bitstream including video information for causing a decoding device to perform a video decoding method, the video decoding method including the steps of: obtaining video information including inter prediction mode information through a bitstream; generating a merge candidate list for a current block based on the inter prediction mode information; selecting one of the candidates included in the merge candidate list; deriving motion information of the current block based on the selected candidate; generating an L0 prediction sample and an L1 prediction sample for the current block based on the motion information; generating a prediction sample for the current block based on the L0 prediction sample, the L1 prediction sample and weight information, the weight information being derived based on weight index information for the selected candidate, the candidates including affine merge candidates, the affine merge candidates including a Control Point Motion Vector (CPMV), the affine merge candidates being located at a top left corner of the current block, ... If the affine merge candidate includes CPMV0 for CP0 located in the upper left side of the current block, weight index information for the affine merge candidate is derived based on the 0th weight index information for the CP0, and if the affine merge candidate does not include CPMV0 for CP0 located in the upper left side of the current block, weight index information for the affine merge candidate is derived based on the 1st weight index information for CP1 (Control Point 1) located in the upper right side of the current block. Effect of the Invention

[0011] According to this document, the overall image / video compression efficiency can be improved.

[0012] According to this document, motion vector candidates can be efficiently constructed during inter prediction.

[0013] According to this document, weighted value-based bi-prediction can be performed efficiently. [Brief description of the drawings]

[0014] [Figure 1] 1 illustrates generally an example of a video / image coding system in which embodiments of the present document may be applied; [Diagram 2] FIG. 1 is a diagram illustrating the configuration of a video / image encoding device to which the embodiments of this document can be applied. [Diagram 3] FIG. 1 is a diagram illustrating the configuration of a video / image decoding device to which an embodiment of the present document can be applied. [Figure 4] 1 illustrates an exemplary procedure for inter prediction. [Diagram 5] 13 is a diagram illustrating a merge mode in inter prediction. [Figure 6] 10 illustrates an exemplary motion representation via an affine motion model. [Figure 7a] 1 illustrates an exemplary CPMV for affine motion prediction. [Figure 7b] 1 illustrates an exemplary CPMV for affine motion prediction. [Figure 8] A case where the affine MVF is determined in units of sub-blocks will be illustrated as an example. [Figure 9] 13 is a diagram illustrating an affine merge mode in inter prediction. [Figure 10] 11 is a diagram for explaining the positions of candidates in an affine merge mode. [Figure 11] 1 is a diagram for explaining SbTMVP in inter prediction. [Figure 12] 1 illustrates a schematic diagram of an example video / image encoding method and associated components according to embodiments of the present document. [Figure 13] 1 illustrates a schematic diagram of an example video / image encoding method and associated components according to embodiments of the present document. [Figure 14]1 illustrates a schematic diagram of an example of a picture / video decoding method and related components according to an embodiment of the present document. [Figure 15] 1 illustrates a schematic diagram of an example of a picture / video decoding method and related components according to an embodiment of the present document. [Figure 16] 1 illustrates an example of a content streaming system to which the embodiments disclosed herein may be applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0015] The present disclosure may have various modifications and various embodiments, and a specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit the present disclosure to a specific embodiment. Terms commonly used in this document are used merely to describe a specific embodiment, and are not intended to limit the technical idea of ​​the present disclosure. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this specification, the terms "include" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the specification, and should be understood not to preclude the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0016] Meanwhile, each configuration in the drawings described in this disclosure is illustrated independently for the convenience of describing different characteristic functions, and does not mean that each configuration is realized by separate hardware or software. For example, two or more of each configuration may be combined to form one configuration, and one configuration may be divided into multiple configurations. An embodiment in which each configuration is integrated and / or separated is also included in the scope of the present disclosure as long as it does not deviate from the essence of this document.

[0017] As used herein, "A or B" can mean "A only," "B only," or "both A and B." In other words, as used herein, "A or B" can be interpreted as "A and / or B." For example, as used herein, "A, B or C" can mean "A only," "B only," "C only," or "any combination of A, B and C."

[0018] As used herein, a slash ( / ) or a comma can mean "and / or." For example, "A / B" can mean "A and / or B." Thus, "A / B" can mean "A only," "B only," or "both A and B." For example, "A, B, C" can mean "A, B, or C."

[0019] In this specification, "at least one of A and B" can mean "A only," "B only," or "both A and B." In addition, in this specification, the expressions "at least one of A or B" and "at least one of A and / or B" can be interpreted similarly to "at least one of A and B."

[0020] In addition, in this specification, "at least one of A, B and C" can mean "A only," "B only," "C only," or "any combination of A, B and C." Furthermore, "at least one of A, B or C" and "at least one of A, B and / or C" can mean "at least one of A, B and C."

[0021] Furthermore, parentheses used in this specification may mean "for example." Specifically, when "prediction (intra prediction)" is displayed, "intra prediction" is proposed as an example of "prediction." In other words, "prediction" in this specification is not limited to "intra prediction," and "intra prediction" is proposed as an example of "prediction." Furthermore, when "prediction (i.e., intra prediction)" is displayed, "intra prediction" is proposed as an example of "prediction."

[0022] Technical features described individually in one drawing in this specification can be realized individually or simultaneously.

[0023] Hereinafter, preferred embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Hereinafter, the same reference numerals are used for the same components in the drawings, and duplicated descriptions of the same components may be omitted.

[0024] FIG. 1 illustrates generally an example of a video / image coding system to which the present disclosure may be applied.

[0025] As shown in Figure 1, the video / image coding system may include a first device (source device) and a second device (receiving device). The source device may transmit encoded video / image information or data to the receiving device in a file or streaming form via a digital storage medium or a network.

[0026] The source device may include a video source, an encoding device, and a sending unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may also include a display unit, which may be a separate device or an external component.

[0027] A video source may acquire video / images through a video / image capture, synthesis, or generation process, etc. A video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated through a computer, etc., in which case the video / image capture process may be replaced by a process in which related data is generated.

[0028] An encoding device can encode an input video / image. The encoding device can perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

[0029] The transmitting unit can transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit of a receiving device via a digital storage medium or a network in the form of a file or streaming. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit can include elements for generating a media file through a predetermined file format and can include elements for transmission via a broadcasting / communication network. The receiving unit can receive / extract the bitstream and transmit it to a decoding device.

[0030] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, prediction, etc., which correspond to the operations of the encoding device.

[0031] The renderer can render the decoded video / images. The rendered video / images can be displayed via a display unit.

[0032] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document can be applied to methods disclosed in the versatile video coding (VVC) standard, the essential video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the 2nd generation of audio video coding standard (AVS2), or the next generation video / image coding standard (ex. H.267 or H.268, etc.).

[0033] In this document, various embodiments relating to video / image coding are presented, which, unless otherwise stated, may also be implemented in combination with each other.

[0034] In this document, video can mean a collection of a series of images over time. A picture generally means a unit that shows one image at a specific time, and a slice / tile is a unit that constitutes a part of a picture in coding. A slice / tile can include one or more coding tree units (CTUs). One picture can be composed of one or more slices / tiles.

[0035] A tile is a rectangular region of CTUs within a particular tile column and a particular tile row in a picture. The tile column is a rectangular region of CTUs having a height equal to the height of the picture and a width specified by syntax elements in the picture parameter set. The tile row is a rectangular region of CTUs having a height specified by syntax elements in the picture parameter set and a width equal to the width of the picture.A tile scan can represent a specific sequential ordering of CTUs partitioning a picture in which the CTUs are ordered consecutively in CTU raster scan in a tile whereas tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture. A slice can include multiple complete tiles or multiple consecutive CTU rows in one tile of a picture that can be included in one NAL unit. Tile group and slice can be used interchangeably in this document. For example, tile group / tile group header can be referred to as slice / slice header in this document.

[0036] On the other hand, a picture can be partitioned into two or more sub-pictures, where a sub-picture can be a rectangular region of one or more slices within a picture.

[0037] A pixel or a pel may refer to the smallest unit that constitutes one picture (or image). A term corresponding to a pixel may also be used as a "sample." A sample may generally refer to a pixel or a pixel value, may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. Alternatively, a sample may refer to a pixel value in the spatial domain, or may refer to a transform coefficient in the frequency domain when such a pixel value is transformed into the frequency domain.

[0038] A unit may indicate a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. One unit may include one luma block and two chroma (e.g., cb, cr) blocks. A unit may be used in combination with terms such as block or area, depending on the case. In a general case, an M×N block may include a sample (or sample array) consisting of M columns and N rows, or a set (or array) of transform coefficients.

[0039] 2 is a diagram for explaining the schematic configuration of a video / image encoding device to which the present disclosure can be applied. Hereinafter, the video encoding device may include an image encoding device.

[0040] As shown in FIG. 2, the encoding device 200 may be configured to include an image partitioner 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter prediction unit 221 and an intra prediction unit 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. The image division unit 210, the prediction unit 220, the residual processing unit 230, the entropy encoding unit 240, the addition unit 250, and the filtering unit 260 may be configured by one or more hardware components (e.g., an encoder chip set or a processor) according to an embodiment. In addition, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware components may further include the memory 270 as an internal / external component.

[0041] The image division unit 210 may divide an input image (or picture, frame) input to the encoding device 200 into one or more processing units. As an example, the processing units may be called coding units (CUs). In this case, the coding units may be recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad-tree binary-tree ternary-tree (QTBTTT) structure. For example, one coding unit may be divided into a plurality of coding units of a deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quad-tree structure may be applied first, and then the binary tree structure and / or the ternary structure may be applied. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present disclosure may be performed based on a final coding unit that is not further divided. In this case, the maximum coding unit may be used as the final coding unit based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and a coding unit of an optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU: Prediction Unit) or a transform unit (TU: Transform Unit). In this case, the prediction unit and the transform unit may each be divided or partitioned from the final coding unit described above.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.

[0042] The unit may be used interchangeably with terms such as block or area. In general, an M×N block may refer to a collection of samples or transform coefficients consisting of M columns and N rows. A sample may generally refer to a pixel or pixel value, may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. A sample may be used as a term that corresponds to a pixel or pel of one picture (or image).

[0043] The encoding device 200 may generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 221 or the intra prediction unit 222 from an input image signal (original block, original sample array), and the generated residual signal is transmitted to the conversion unit 232. In this case, as illustrated, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input image signal (original block, original sample array) in the encoding device 200 may be called a subtraction unit 231. The prediction unit may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including a prediction sample for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied in units of a current block or a CU. The prediction unit may generate various information related to prediction, such as prediction mode information, and transmit the information to the entropy encoding unit 240, as will be described later in the description of each prediction mode. The prediction information can be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0044] The intra prediction unit 222 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on the prediction mode. In the intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The non-directional mode may include, for example, a DC mode and a planar mode. The directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the setting. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block using the prediction modes applied to the neighboring blocks.

[0045] The inter prediction unit 221 may derive a predicted block for a current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between a neighboring block and a current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring block may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (col CU), etc., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 221 may generate information indicating which candidate is used to construct a motion information candidate list based on neighboring blocks and derive a motion vector and / or a reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode and a merge mode, the inter prediction unit 221 may use motion information of neighboring blocks as motion information of the current block. In the case of the skip mode, unlike the merge mode, a residual signal may not be transmitted.In the case of motion vector prediction (MVP) mode, the motion vector of the current block can be indicated by using the motion vector of a neighboring block as a motion vector predictor and signaling the motion vector difference.

[0046] The prediction unit 220 may generate a prediction signal based on various prediction methods described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, as well as intra prediction and inter prediction simultaneously. This may be called combined inter and intra prediction (CIIP). The prediction unit may also be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described in this document. The palette mode may be considered as an example of intra coding or intra prediction. When the palette mode is applied, a sample value within a picture may be signaled based on information regarding a palette table and a palette index.

[0047] The prediction signal generated by the prediction unit (including the inter prediction unit 221 and / or the intra prediction unit 222) may be used to generate a restored signal or may be used to generate a residual signal. The transform unit 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. The CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same size of a regular square, and may also be applied to blocks of variable sizes that are not regular squares.

[0048] The quantizer 233 quantizes the transform coefficients and transmits the quantized transform coefficients to the entropy encoder 240, which may encode the quantized signal (information on the quantized transform coefficients) and output the quantized signal to a bitstream. The information on the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoder 240 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoder 240 may encode information required for video / image restoration (e.g., values ​​of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in units of 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 further include general constraint information. Information and / or syntax elements transmitted / signaled from an encoding device to a decoding device in this document may be included in the video / image information. The video / image information may be encoded through the above-mentioned encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or may be stored in a digital storage medium, where the network may include a broadcast 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 transmitter (not shown) for transmitting the signal output from the entropy encoding unit 240 and / or a storage unit (not shown) for storing the signal may be configured as an internal / external element of the encoding device 200, or the transmitter may be included in the entropy encoding unit 240.

[0049] The quantized transform coefficients output from the quantizer 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be restored by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 234 and the inverse transformer 235. 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 221 or the intra prediction unit 222. When there is no residual for the current block, such as when a skip mode is applied, a predicted block may be used as a reconstructed block. The adder 250 may be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, and may also be used for inter prediction of the next picture after filtering, as described below.

[0050] Meanwhile, luma mapping with chrominance scaling (LMCS) may be applied during picture encoding and / or restoration.

[0051] The filtering unit 260 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 260 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and store the modified reconstructed picture in the memory 270, specifically, in the DPB of the memory 270. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc. The filtering unit 260 may generate various information related to filtering and transmit it to the entropy encoding unit 240, as will be described later in the description of each filtering method. The filtering information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.

[0052] The modified reconstructed picture transmitted to the memory 270 can be used as a reference picture in the inter prediction unit 221. When inter prediction is applied through this, the encoding device can avoid prediction mismatch between the encoding device 200 and the decoding device, and can also improve encoding efficiency.

[0053] The DPB of the memory 270 may store a modified reconstructed picture for use as a reference picture in the inter prediction unit 221. The memory 270 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 221 to be used as motion information of a spatially neighboring block or motion information of a temporally neighboring block. The memory 270 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 222.

[0054] Meanwhile, in this document, at least one of the quantization / dequantization and / or the transform / inverse transform may be omitted. If the quantization / dequantization is omitted, the quantized transform coefficients may be referred to as transform coefficients. If the transform / inverse transform is omitted, the transform coefficients may be referred to as coefficients or residual coefficients, or may still be referred to as transform coefficients for uniformity of expression.

[0055] Also, in this document, the quantized transform coefficients and the transform coefficients may be referred to as transform coefficients and scaled transform coefficients, respectively. In this case, the residual information may include information on the transform coefficient(s), and the information on the transform coefficient(s) may be signaled via a residual coding syntax. A transform coefficient may be derived based on the residual information (or information on the transform coefficient(s)), and a scaled transform coefficient may be derived through an inverse transform (scaling) on ​​the transform coefficient. A residual sample may be derived based on an inverse transform (transform) on the scaled transform coefficient. This may be similarly applied / expressed in other parts of this document.

[0056] FIG. 3 is a diagram illustrating a schematic configuration of a video / image decoding device to which the present disclosure can be applied.

[0057] As shown in FIG. 3, the decoding device 300 may be configured to include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an intra predictor 331 and an inter predictor 332. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322. The entropy decoder 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be configured as one hardware component (e.g., a decoder chipset or processor) according to an embodiment. Also, the memory 360 may include a decoded picture buffer (DPB) and may be configured as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.

[0058] If a bitstream including video / image information is input, the decoding device 300 can restore an image corresponding to a process in which the video / image information is processed by the encoding device of FIG. 2. For example, the decoding device 300 can derive a unit / block based on block division related information obtained from the bitstream. The decoding device 300 can perform decoding using a processing unit applied in the encoding device. Thus, the processing unit for decoding can be, for example, a coding unit, and the coding unit can be divided from a coding tree unit or a maximum coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units can be derived from the coding unit. Then, the restored image signal decoded and output by the decoding device 300 can be reproduced by a reproduction device.

[0059] The decoding device 300 may receive a signal output from the encoding device of FIG. 3 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 310. For example, the entropy decoding unit 310 may derive information (ex. video / image information) required for image restoration (or picture restoration) by parsing the bitstream. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. The decoding device may further decode a picture based on information on the parameter set and / or the general constraint information. Signaling / received information and / or syntax elements described later in this document may be decoded via the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit 310 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 may receive bins corresponding to each syntax element in the bitstream, determine a context model using syntax element information to be decoded and decode information of neighboring and to-be-decoded blocks, or information of symbols / bins decoded in a previous step, predict the occurrence probability of bins according to the determined context model, and perform arithmetic decoding of the bins to generate symbols corresponding to the values ​​of each syntax element. In this case, the CABAC entropy decoding method may update the context model using information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model.Among the information decoded by the entropy decoding unit 310, information related to prediction is provided to a prediction unit (inter prediction unit 332 and intra prediction unit 331), and residual values ​​entropy decoded by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, may be input to the residual processing unit 320. The residual processing unit 320 may derive a residual signal (residual block, residual sample, residual sample array). Also, among the information decoded by the entropy decoding unit 310, information related to filtering may be provided to the filtering unit 350. Meanwhile, a receiving unit (not shown) for receiving a signal output from the encoding device may be further configured as an internal / external element of the decoding device 300, or the receiving unit may be a component of the entropy decoding unit 310. Meanwhile, the decoding device according to this document may be called a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 310, and the sample decoder may include at least one of the inverse quantization unit 321, the inverse transform unit 322, the addition unit 340, the filtering unit 350, the memory 360, the inter prediction unit 332, and the intra prediction unit 331.

[0060] The inverse quantization unit 321 may inverse quantize the quantized transform coefficients to output transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in a two-dimensional block form. In this case, the rearrangement may be performed based on a coefficient scan order performed in the encoding device. The inverse quantization unit 321 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.

[0061] The inverse transform unit 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0062] 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 on the prediction output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.

[0063] The prediction unit 330 may generate a prediction signal based on various prediction methods described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). In addition, the prediction unit may be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / video coding such as games, for example, screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in that a reference block is derived within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described in this document. The palette mode may be considered as an example of intra coding or intra prediction. When the palette mode is applied, information regarding a palette table and a palette index may be included in the video / image information and signaled.

[0064] The intra prediction unit 331 may predict a current block by referring to samples in a current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on a prediction mode. In intra prediction, the prediction mode may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 may also determine a prediction mode to be applied to the current block by using prediction modes applied to neighboring blocks.

[0065] The inter prediction unit 332 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 332 may configure a motion information candidate list based on the neighboring blocks and derive a motion vector and / or a reference picture index for the current block based on the received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information regarding the prediction may include information indicating a mode of inter prediction for the current block.

[0066] The adder 340 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted sample array) output from a prediction unit (including an inter prediction unit 332 and / or an intra prediction unit 331). When there is no residual for a current block, such as when a skip mode is applied, the predicted block may be used as a reconstructed block.

[0067] The adder 340 may be referred to as a reconstruction unit or a reconstruction block generator. The generated reconstruction signal may be used for intra prediction of a next block to be processed in a current picture, may be output after filtering as described below, or may be used for inter prediction of a next picture.

[0068] Meanwhile, LMCS (luma mapping with chroma scaling) can be applied during the picture decoding process.

[0069] The filtering unit 350 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 350 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may transmit the modified reconstructed picture to the memory 360, specifically, to the DPB of the memory 360. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.

[0070] The (modified) reconstructed picture stored in the DPB of the memory 360 may be used as a reference picture in the inter prediction unit 332. The memory 360 may store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 332 to be used as motion information of a spatially neighboring block or motion information of a temporally neighboring block. The memory 360 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 331.

[0071] In this specification, the embodiments described for the filtering unit 260, inter prediction unit 221, and intra prediction unit 222 of the encoding device 200 can also be applied identically or correspondingly to the filtering unit 350, inter prediction unit 332, and intra prediction unit 331 of the decoding device 300, respectively.

[0072] Meanwhile, as described above, prediction is performed to improve compression efficiency when performing video coding. As a result, a predicted block including predicted samples for a current block, which is a block to be coded, can be generated. Here, the predicted block includes predicted samples in a spatial domain (or a pixel domain). The predicted block is derived in the same way in an encoding device and a decoding device, and the encoding device can improve image coding efficiency by signaling information (residual information) about the residual between the original block and the predicted block, which is not an original sample value of the original block, to the decoding device. The decoding device can derive a residual block including residual samples based on the residual information, and can generate a reconstructed block including reconstructed samples by adding the residual block and the predicted block, and can generate a reconstructed picture including the reconstructed block.

[0073] The residual information may be generated through a transform and quantization procedure. For example, the encoding apparatus may derive a residual block between the original block and the predicted block, perform a transform procedure on the residual samples (residual sample array) included in the residual block to derive transform coefficients, and perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, and then signal the related residual information (through a bitstream) to the decoding apparatus. Here, the residual information may include information such as value information, position information, transform technique, transform kernel, and quantization parameter of the quantized transform coefficients. The decoding apparatus may derive a residual sample (or a residual block) by performing an inverse quantization / inverse transform procedure based on the residual information. The decoding apparatus may generate a reconstructed picture based on the predicted block and the residual block. Also, the encoding apparatus may derive a residual block by inverse quantizing / inverse transforming the quantized transform coefficients for reference for inter-prediction of a future picture, and generate a reconstructed picture based on the residual block.

[0074] FIG. 4 illustrates an exemplary procedure for inter prediction.

[0075] Referring to Fig. 4, the inter prediction procedure may include an inter prediction mode determination step, a motion information derivation step according to the determined prediction mode, and a prediction execution step (generation of a prediction sample) based on the derived motion information. The inter prediction procedure may be performed by an encoding device and a decoding device as described above. In this document, the coding device may include an encoding device and / or a decoding device.

[0076] Referring to FIG. 4, the coding apparatus determines an inter prediction mode for a current block (S400). Various inter prediction modes can be used for predicting a current block in a picture. For example, various modes such as merge mode, skip mode, motion vector prediction mode (MVP), affine mode, sub-block merge mode, merge with MVD mode (MMVD), etc. can be used. Decoder side motion vector refinement mode (DMVR), adaptive motion vector resolution mode (AMVR), Bi-prediction with CU-level weight (BCW), Bi-directional optical flow (BDOF), etc. can be used in addition to or instead as additional modes. The affine mode may be referred to as an affine motion prediction mode. The MVP mode may be referred to as an advanced motion vector prediction mode (AMVP). In this document, a candidate for motion information derived by some modes and / or some modes may be included in one of candidates for motion information of other modes. For example, an HMVP candidate may be added to the merge candidate of the merge / skip mode, or may be added to the mvp candidate of the MVP mode. When the HMVP candidate is used as a motion information candidate of the merge mode or skip mode, the HMVP candidate may also be called an HMVP merge candidate.

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

[0078] The coding apparatus derives motion information for the current block (S410). The motion information may be derived based on the inter prediction mode.

[0079] The coding apparatus may perform inter prediction using motion information of the current block. The encoding apparatus may derive optimal motion information for the current block through a motion estimation procedure. For example, the encoding apparatus may search for a similar reference block with high correlation in a fractional pixel unit within a determined search range in the reference picture using an original block in an original picture for the current block, and may derive motion information through this. The similarity of the block may be derived based on a difference in phase-based sample values. For example, the similarity of the block may be calculated based on the SAD between the current block (or the template of the current block) and the reference block (or the template of the reference block). In this case, the motion information may be derived based on the reference block with the smallest SAD in the search area. The derived motion information may be signaled to the decoding apparatus by various methods based on the inter prediction mode.

[0080] The coding apparatus performs inter prediction based on motion information for the current block (S420). The coding apparatus may derive predictive samples for the current block based on the motion information. The current block including the predictive samples may be referred to as a predicted block.

[0081] FIG. 5 is a diagram illustrating a merge mode in inter prediction.

[0082] When a merge mode is applied, motion information of a current prediction block is not directly transmitted, but is derived using motion information of neighboring prediction blocks. Therefore, the motion information of the current prediction block can be indicated by transmitting flag information indicating that the merge mode is used and a merge index indicating which neighboring prediction block is used. The merge mode may be called a regular merge mode. For example, the merge mode may be applied when a value of a regular_merge_flag syntax element is 1.

[0083] To perform the merge mode, the encoding apparatus must search for merge candidate blocks to be used to derive motion information of the current prediction block. For example, up to five merge candidate blocks may be used, but the embodiment (etc.) of this document is not limited thereto. The maximum number of merge candidate blocks may be transmitted in a slice header or a tile group header, but the embodiment (etc.) of this document is not limited thereto. After searching for the merge candidate blocks, the encoding apparatus may generate a merge candidate list and may select a merge candidate block having the smallest cost among them as a final merge candidate block.

[0084] This document may provide various embodiments for the merge candidate blocks that make up the merge candidate list.

[0085] For example, the merge candidate list may use five merge candidate blocks. For example, four spatial merge candidates and one temporal merge candidate may be used. As a specific example, in the case of spatial merge candidates, the blocks shown in FIG. 4 may be used as spatial merge candidates. Hereinafter, the spatial merge candidates or spatial MVP candidates described later may be referred to as SMVPs, and the temporal merge candidates or temporal MVP candidates described later may be referred to as TMVPs.

[0086] The merge candidate list for the current block may be constructed, for example, according to the following procedure.

[0087] A coding apparatus (encoding apparatus / decoding apparatus) may search for spatial neighboring blocks of a current block and insert derived spatial merge candidates into a merge candidate list. For example, the spatial neighboring blocks may include a neighboring block at the lower left corner, a neighboring block at the left side, a neighboring block at the upper right corner, a neighboring block at the upper left corner, and a neighboring block at the upper left corner of the current block. However, this is merely an example, and additional neighboring blocks such as a neighboring block at the right side, a neighboring block at the lower side, and a neighboring block at the lower right corner may be used as the spatial neighboring blocks in addition to the spatial neighboring blocks. The coding apparatus may search the spatial neighboring blocks based on a priority order to detect available blocks, and derive motion information of the detected blocks as the spatial merge candidates. For example, the encoding apparatus or the decoding apparatus may search the five blocks shown in FIG. 5 in the order of A1->B1->B0->A0->B2, sequentially index available candidates, and configure the merge candidate list.

[0088] The coding apparatus may search for temporal neighboring blocks of the current block and insert derived temporal merge candidates into the merge candidate list. The temporal neighboring 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 neighboring blocks are located may be called a collocated picture or a col picture. The temporal neighboring blocks may be searched for in the order of a lower right corner neighboring block and a lower right center block of a co-located block with respect to the current block on the col picture. Meanwhile, when motion data compression is applied, specific motion information may be stored as representative motion information for each certain storage unit in the col picture. In this case, it is not necessary to store motion information for all blocks in the certain storage unit, and thus a motion data compression effect can be obtained. In this case, the fixed storage unit may be predetermined, for example, in 16x16 sample units or 8x8 sample units, or size information for the fixed storage unit may be signaled from the encoding device to the decoding device. When the motion data compression is applied, the motion information of the temporal neighboring block may be replaced with representative motion information of the fixed storage unit in which the temporal neighboring block is located. That is, in this case, from the perspective of implementation, the temporal merge candidate may be derived based on motion information of a predictive block that is not a predictive block located at the coordinates of the temporal neighboring block, but is arithmetically shifted right by a certain value based on the coordinates (upper left sample position) of the temporal neighboring block and then arithmetically shifted left.For example, when the fixed storage unit is a 2n×2n sample unit, if the coordinates of the temporal neighboring 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 temporal merge candidate. Specifically, for example, when the fixed storage unit is a 16×16 sample unit, if the coordinates of the temporal neighboring 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 temporal merge candidate. Or, for example, when the fixed storage unit is an 8×8 sample unit, if the coordinates of the temporal neighboring 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 temporal merge candidate.

[0089] The coding device can check whether the number of current merge candidates is smaller than the number of maximum merge candidates. The number of the maximum merge candidates can be predefined or signaled from the encoding device to the decoding device. For example, the encoding device can generate information regarding the number of the maximum merge candidates, encode it, and transmit it to the decoder in the form of a bitstream. If all the numbers of the maximum merge candidates are satisfied, the subsequent candidate addition process cannot proceed.

[0090] If the number of the current merge candidates is less than the maximum number of merge candidates, the coding apparatus may insert an additional merge candidate into the merge candidate list. For example, the additional merge candidate may include at least one of a history based merge candidate(s), a pair-wise average merge candidate(s), an ATMVP, a combined bi-predictive merge candidate (when the slice / tile group type of the current slice / tile group is type B), and / or a zero vector merge candidate, which will be described later.

[0091] If the check result indicates that the number of the current merge candidates is not less than the maximum number of merge candidates, the coding apparatus may terminate construction of the merge candidate list. In this case, the encoding apparatus may select an optimal merge candidate from among the merge candidates constituting the merge candidate list based on a rate-distortion (RD) cost, and may signal selection information (e.g., merge index) indicating the selected merge candidate to the decoding apparatus. The decoding apparatus may select the optimal merge candidate based on the merge candidate list and the selection information.

[0092] As described above, the motion information of the selected merging candidate may be used as the motion information of the current block, and a prediction sample of the current block may be derived based on the motion information of the current block. The encoding device may derive a residual sample of the current block based on the prediction sample, and may signal residual information regarding the residual sample to a decoding device. As described above, the decoding device may generate a reconstructed sample based on the residual sample derived based on the residual information and the prediction sample, and may generate a reconstructed picture based on the reconstructed sample.

[0093] When a skip mode is applied, the motion information of the current block can be derived in the same manner as when the merge mode is applied. However, when the skip mode is applied, the residual signal for the block is omitted, and thus the predicted samples can be used directly as reconstructed samples. The skip mode can be applied, for example, when the value of the cu_skip_flag syntax element is 1.

[0094] Meanwhile, the pair-wise average merge candidate may be referred to as a pair-wise average candidate. A pair-wise average candidate (etc.) may be generated by averaging pairs of predefined candidates in an existing merge candidate list. Also, the predefined pairs may be defined as {(0,1), (0,2), (1,2), (0,3), (1,3), (2,3)}. Here, the numbers may represent merge indexes for the merge candidate list. An averaged motion vector may be calculated separately for each reference list. For example, if two motion vectors are available in one list, the two motion vectors may be averaged even if they point to different reference pictures. For example, if only one motion vector is available, one may be used directly. For example, if no motion vector is available, the list may be kept in an inactive state.

[0095] For example, if the merge candidate list is not full even after the pairwise average merge candidate is added, i.e., if the number of current merge candidates in the merge candidate list is less than the maximum number of merge candidates, a zero vector (zero MVP) can be inserted at the end until the maximum merge candidate number appears, i.e., the number of current merge candidates in the merge candidate list can be inserted until it reaches the maximum number of merge candidates.

[0096] Meanwhile, in the past, only one motion vector could be used to represent the motion of a coding block. That is, a translation motion model could be used. However, while this method may represent the optimal motion on a block-by-block basis, coding efficiency can be improved if an optimal motion vector can be determined on a sample-by-sample basis, rather than the optimal motion of each sample. For this reason, an affine motion model can be used. The affine motion prediction method, which uses an affine motion model for coding, can efficiently represent four motions, as described below.

[0097] FIG. 6 shows an example of motion represented via an affine motion model.

[0098] Referring to Fig. 6, the motions that can be expressed through the affine motion model include translation motion, scale motion, rotation motion, and shear motion. That is, not only the translation motion in which an image (part of it) moves on a plane according to the flow of time shown in Fig. 6, but also the scale motion in which an image (part of it) is scaled according to the flow of time, the rotation motion in which an image (part of it) is rotated according to the flow of time, and the shear motion in which an image (part of it) is transformed into a parallelogram according to the flow of time can be efficiently expressed through the affine motion prediction.

[0099] The encoding / decoding apparatus can predict the distortion type of an image based on a motion vector at a control point (CP) of the current block through the affine motion prediction, thereby improving the accuracy of prediction and thereby improving image compression performance. Also, a motion vector for at least one control point of the current block can be derived using the motion vectors of neighboring blocks of the current block, reducing the burden of data volume for added additional information and significantly improving the efficiency of inter prediction.

[0100] An affine motion model that expresses three of the possible motions that an affine motion model can express (translation, scale, and rotate) may be called a similarity (or simplified) affine motion model, but is not limited to the aforementioned motion models.

[0101] Affine motion prediction methods can use two, three or four motion vectors to represent the motion vectors for each sample of a block.

[0102] 7a and 7b exemplarily show CPMV for affine motion prediction.

[0103] Affine motion estimation can use two or more Control Point Motion Vectors (CPMVs) to determine the motion vectors for the sample positions contained in a block. The collection of motion vectors can then be denoted as an affine motion vector field (MVF).

[0104] For example, FIG. 7a may show a case where two CPMVs are used, which may be called a four-parameter affine model. In this case, the motion vector at a sample position of (x, y) may be determined, for example, as shown in Equation 1.

[0105]

number

[0106] For example, FIG. 7b may show a case where three CPMVs are used, which may be called a six-parameter affine model. In this case, the motion vector at the (x, y) sample position may be determined, for example, as shown in Equation 2.

[0107]

number

[0108] In Formula 1 and Formula 2, {v x ,v y} can represent the motion vector at the (x,y) position. 0x ,v 0y} may indicate the CPMV of the control point (CP) at the upper left corner of the coding block, and {v 1x ,v 1y} can denote the CPMV of the CP at the upper right corner, and {v 2x ,v 2y} may indicate the CPMV of the CP at the lower left corner position, W may indicate the width of the current block, and H may indicate the height of the current block.

[0109] FIG. 8 exemplarily illustrates a case where the affine MVF is determined in units of sub-blocks.

[0110] In the encoding / decoding process, the affine MVF can be determined in sample units or in units of sub-blocks that have already been defined. For example, when it is determined in sample units, a motion vector is obtained based on each sample value. Alternatively, when it is determined in sub-block units, a motion vector of the corresponding block is obtained based on the sample value at the center of the sub-block (lower right side of the center, i.e., the lower right sample of the central four samples). That is, in affine motion prediction, the motion vector of the current block can be derived in sample units or sub-block units.

[0111] In the case of FIG. 8, the affine MVF is determined in units of 4x4 sub-blocks, but the size of the sub-blocks can be varied in various ways.

[0112] That is, when affine prediction is available, there are three motion models applicable to the current block: a translational motion model, a 4-parameter affine motion model, and a 6-parameter affine motion model. Here, the translational motion model may represent a model in which an existing block-based motion vector is used, the 4-parameter affine motion model may represent a model in which two CPMVs are used, and the 6-parameter affine motion model may represent a model in which three CPMVs are used.

[0113] On the other hand, affine motion prediction can include affine MVP (or affine inter) mode or affine merge mode.

[0114] FIG. 9 is a diagram illustrating the affine merge mode in inter prediction.

[0115] For example, in the affine merge mode, the CPMV may be determined according to the affine motion model of the neighboring blocks coded with affine motion prediction. For example, neighboring blocks coded with affine motion prediction in the search order may be used for the affine merge mode. That is, if at least one of the neighboring blocks is coded with affine motion prediction, the current block may be coded in the affine merge mode. Here, the affine merge mode may be referred to as AF_MERGE.

[0116] When the affine merge mode is applied, the CPMV of the current block may be derived using the CPMV of the neighboring blocks. In this case, the CPMV of the neighboring blocks may be used as the CPMV of the current block as is, or the CPMV of the neighboring blocks may 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.

[0117] Meanwhile, in the case of an affine merge mode in which a motion vector (MV) is derived in subblock units, it may be called a subblock merge mode, which may be indicated based on a subblock merge flag (or a merge_subblock_flag syntax element). Alternatively, when the value of the merge_subblock_flag syntax element is 1, it may be indicated that the subblock merge mode is applied. In this case, an affine merge candidate list described later may also be called a subblock merge candidate list. In this case, the subblock merge candidate list may further include a candidate derived by SbTMVP described later. In this case, the candidate derived by SbTMVP may be used as a candidate of the 0th index of the subblock merge candidate list. In other words, the candidate derived by SbTMVP may be located before an inherited affine candidate or a constructed affine candidate described later in the subblock merge candidate list.

[0118] When an affine merge mode is applied, an affine merge candidate list may be constructed for CPMV derivation for a current block. For example, the affine merge candidate list may include at least one of the following candidates: 1) inherited affine merge candidate; 2) constructed affine merge candidate; and 3) zero motion vector candidate (or zero vector). Here, the inherited affine merge candidate is a candidate derived based on the CPMVs of neighboring blocks when the neighboring blocks are coded in affine mode, and the constructed affine merge candidate is a candidate derived by constructing CPMVs based on the MVs of neighboring blocks of the corresponding CP in each CPMV unit, and the zero motion vector candidate may represent a candidate constructed with a CPMV whose value is 0.

[0119] The affine merge candidate list can be constructed, for example, as follows:

[0120] There may be up to two inherited affine candidates, and the inherited affine candidates may be derived from the affine motion models of the surrounding blocks. The surrounding blocks may include one left surrounding block and one above surrounding block. The candidate blocks may be located as shown in FIG. 4. The scan order for the left predictor may be A1→A0, and the scan order for the above predictor may be B1→B0→B2. Only one inherited candidate from each of the left and above may be selected. There may be no pruning check between two inherited candidates.

[0121] When a neighboring affine block is identified, the control point motion vector of the identified block can be used to derive a CPMVP candidate in the affine merge list of the current block. Here, the neighboring affine block may indicate a block coded in an affine prediction mode among neighboring blocks of the current block. For example, referring to FIG. 8, when the bottom-left neighboring block A is coded in an affine prediction mode, motion vectors v2, v3, and v4 of the top-left corner, top-right corner, and bottom-left corner of the neighboring block A can be obtained. When the neighboring block A is coded in a 4-parameter affine motion model, two CPMVs of the current block can be calculated by v2 and v3. When the neighboring block A is coded in a 6-parameter affine motion model, three CPMVs of the current block can be calculated by v2, v3, and v4.

[0122] FIG. 10 is a diagram for explaining the positions of candidates in the affine merge mode.

[0123] A constructed affine candidate may refer to a candidate constructed by combining translational motion information around each control point. The motion information of a control point may be derived from the identified spatial and temporal surroundings. CPMVk (k=0,1,2,3) may indicate the kth control point.

[0124] Referring to Figure 10, for CPMV0, blocks can be checked in the order B2->B3->A2 and the motion vector of the first available block can be used. For CPMV1, blocks can be checked in the order B1->B0 and for CPMV2, blocks can be checked in the order A1->A0. A temporal motion vector predictor (TMVP) can be used for CPMV3 if available.

[0125] After the motion vectors of the four control points are obtained, affine merge candidates can be generated based on the obtained motion information. The combination of control point motion vectors can be any one of {CPMV0, CPMV1, CPMV2}, {CPMV0, CPMV1, CPMV3}, {CPMV0, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV3}, {CPMV0, CPMV1}, and {CPMV0, CPMV2}.

[0126] A combination of three CPMVs can constitute a 6-parameter affine merge candidate, and a combination of two CPMVs can constitute a 4-parameter affine merge candidate. To avoid the motion scaling process, related combinations of control point motion vectors can be discarded if the reference indexes of the control points are different from each other.

[0127] FIG. 11 is a diagram for explaining SbTMVP in inter prediction.

[0128] Meanwhile, a subblock-based temporal motion vector prediction (SbTMVP) method may also be used. For example, SbTMVP may be referred to as advanced temporal motion vector prediction (ATMVP). SbTMVP may utilize motion fields in a collocated picture to improve motion vector prediction and merge mode for a CU in a current picture. Here, the collocated picture may also be referred to as a col picture.

[0129] For example, SbTMVP can predict motion at a sub-block (or sub-CU) level, and can apply a motion shift before fetching temporal motion information from the colpicture, where the motion shift can be obtained from the motion vector of one of the spatially neighboring blocks of the current block.

[0130] SbTMVP can predict the motion vectors of sub-blocks (or sub-CUs) in a current block (or CU) through two steps.

[0131] In a first step, the spatially neighboring blocks may be examined in the order of A1, B1, B0, and A0 in FIG. 4. The first spatially neighboring block having a motion vector that uses the col picture as its reference picture may be identified, and the motion vector may be selected with a motion shift to be applied. If no such motion is identified from the spatially neighboring blocks, the motion shift may be set to (0,0).

[0132] In a second step, the motion shift identified in the first step can be applied to obtain sub-block level motion information (motion vectors and reference indexes) from the col picture. For example, the motion shift can be added to the coordinates of the current block. For example, the motion shift can be set as the motion of A1 in FIG. 4. In this case, for each sub-block, the motion information of the corresponding block in the col picture can be used to derive the motion information of the sub-block. Temporal motion scaling can be applied to align the reference picture of the temporal motion vector with the reference picture of the current block.

[0133] The combined sub-block based merge list including all SbTVMP candidates and affine merge candidates can be used to signal the affine merge mode. Here, the affine merge mode can be referred to as a sub-block based merge mode. The SbTVMP mode can be enabled or disabled by a flag included in the sequence parameter set (SPS). If the SbTMVP mode is enabled, the SbTMVP predictor can be added as the first entry in the list of sub-block based merge candidates, followed by the affine merge candidates. The maximum allowed size of the affine merge candidate list can be 5.

[0134] The size of the sub-CU (or sub-block) used in SbTMVP may be fixed at 8x8, and like the affine merge mode, the SbTMVP mode may only be applied to blocks whose width and height are both 8 or more. The encoding logic of the additional SbTMVP merge candidate may be the same as other merge candidates. That is, for each CU in a P or B slice, an RD check using an additional RD cost may be performed to determine whether to use an SbTMVP candidate.

[0135] Meanwhile, a predicted block for the current block may be derived based on motion information derived according to the prediction mode. The predicted block may include a prediction sample (prediction sample array) of the current block. If the motion vector of the current block points to a fractional sample unit, an interpolation procedure may be performed, through which a prediction sample of the current block may be derived based on a reference sample of a fractional sample unit in a reference picture. If affine inter prediction (affine prediction mode) is applied to the current block, a prediction sample may be generated based on a sample / subblock unit MV. If bi (Bi) prediction is applied, a prediction sample derived through a weighted sum or weighted average (by phase) of a prediction sample derived based on L0 prediction (i.e., prediction using a reference picture in a reference picture list L0 and MVL0) and a prediction sample derived based on L1 prediction (i.e., prediction using a reference picture in a reference picture list L1 and MVL1) may be used as a prediction sample of the current block. Here, the motion vector in the L0 direction may be referred to as an L0 motion vector or MVL0, and the motion vector in the L1 direction may be referred to as an L1 motion vector or MVL1. When bi-prediction is applied, if a reference picture used in L0 prediction and a reference picture used in L1 prediction are located in different temporal directions with respect to a current picture (i.e., bi-prediction is applicable to both directions), this may be referred to as true bi-prediction.

[0136] Also, as described above, reconstructed samples and reconstructed pictures may be generated based on the derived predicted samples, and then procedures such as in-loop filtering may be performed.

[0137] On the other hand, when bi-prediction is applied to the current block, a prediction sample can be derived based on a weighted average. For example, bi-prediction using a weighted average can be called BCW (Bi-prediction with CU-level Weight), BWA (Bi-prediction with Weighted Average), or weighted averaging bi-prediction.

[0138] Conventionally, a bi-predictive signal (i.e., a bi-predictive sample) could be derived by 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 was derived by an average of 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, when bi-prediction is applied, a bi-predictive signal (bi-predictive sample) can also be derived by a weighted average of an L0 predicted signal and an L1 predicted signal as follows. For example, a bi-predictive signal (bi-predictive sample) can be derived as shown in Equation 3.

[0139]

number

[0140] In Equation 3, Pbi-pred may represent a value of a bi-predictive signal, i.e., a predicted sample value derived by applying bi-prediction, and w may represent a weighting value. In addition, P0 may represent a value of an L0 predicted signal, i.e., a predicted sample value derived by applying L0 prediction, and P1 may represent a value of an L1 predicted signal, i.e., a predicted sample value derived by applying L1 prediction.

[0141] For example, five weights may be allowed in weighted average bi-prediction. For example, the five weights (w) may include -2, 3, 4, 5, or 10. That is, the weight (w) may be determined to be one of the weight candidates including -2, 3, 4, 5, or 10. The weight w for each CU to which bi-prediction is applied may be determined in one of two ways. In the first way, a weight index for a non-merged CU may be signaled after a motion vector difference. In the second way, a weight index for a merged CU may be inferred from a neighboring block based on a merge candidate index.

[0142] For example, weighted average bi-prediction may be applied to a CU having 256 or more luma samples. That is, weighted average bi-prediction may be applied when the product of the width and height of a CU is equal to or greater than 256. For low-delay pictures, five weights may be used, and for non-low-delay pictures, three weights may be used. For example, the three weights may include 3, 4, or 5.

[0143] For example, in an encoding device, a fast search algorithm can be applied to find the weight index without significantly increasing the complexity of the encoding device. Such an algorithm can be summarized as follows. For example, when combined with adaptive motion vector resolution (AMVR) (when AMVR is used as an inter prediction mode), if the current picture is a low-latency picture, non-identical weights can be conditionally checked for 1-pel and 4-pel motion vector precision. For example, when combined with affine (when affine prediction mode is used as an inter prediction mode), if the affine prediction mode is currently selected as the best mode, affine motion estimation (ME) can be performed for non-identical weights. For example, if two reference pictures of bi-prediction are identical, non-identical weights can be conditionally checked. For example, non-identical weighting values ​​may not be searched if certain conditions are met depending on the POC distance between the current picture and the reference picture, the coding quantization parameter (QP), and the temporal level.

[0144] For example, a BCW weight index (or weight index) may be coded using one context coded bin and a subsequent bypass coded bin. The first context coded bin may indicate whether or not the same weights are used. If non-identical weights are used based on the first context coded bin, additional bins may be signaled using bypass coding to indicate the non-identical weights used.

[0145] Meanwhile, when bi-prediction is applied, weighting information used to generate a predicted sample can be derived based on weighting index information for a selected candidate among the candidates included in the merge candidate list.

[0146] According to an embodiment of this document, when configuring a motion vector candidate for a merge mode, weight index information for a temporal motion vector candidate may be derived as follows. For example, when a temporal motion vector candidate uses bi-prediction, weight index information for a weighted average may be derived. That is, when an inter prediction type is bi-prediction, weight index information for a temporal merge candidate (or a temporal motion vector candidate) in a merge candidate list may be derived.

[0147] For example, weight index information for weighted averaging of temporal motion vector candidates may always be derived to 0. Here, weight index information being 0 may mean that the weights of each reference direction (i.e., the L0 prediction direction and the L1 prediction direction in bi-prediction) are the same. For example, a procedure for deriving a motion vector of a luma component for a merge mode may be as shown in Table 1 below.

[0148] [Table 1-1]

[0149] [Table 1-2]

[0150] [Table 1-3]

[0151] [Table 1-4]

[0152] [Table 1-5]

[0153] Referring to Table 1, gbiIdx may represent a bi-prediction weight index, and gbiIdxCol may represent a bi-prediction weight index for a temporal merge candidate (e.g., a temporal motion vector candidate in a merge candidate list). In a procedure for deriving a motion vector of a luma component for the merge mode (Table of Contents 3 of 8.4.2.2), gbiIdxCol may be derived to 0. That is, a weight index of a temporal motion vector candidate may be derived to 0.

[0154] Alternatively, a weight index for weighted averaging of temporal motion vector candidates may be derived based on weight index information of a collocated block. Here, a collocated block may be referred to as a col block, a co-located block, or a co-located reference block, and a col block may represent a block at the same position as a current block on a reference picture. For example, a procedure for deriving a motion vector of a luma component for a merge mode may be as shown in Table 2 below.

[0155] [Table 2-1]

[0156] [Table 2-2]

[0157] [Table 2-3]

[0158] [Table 2-4]

[0159] [Table 2-5]

[0160] Referring to Table 2, gbiIdx may represent a bi-prediction weight index, and gbiIdxCol may represent a bi-prediction weight index for a temporal merge candidate (e.g., a temporal motion vector candidate in a merge candidate list). In a procedure for deriving a motion vector of a luma component for the merge mode, if the type of slice or the type of tile group is B (Table of Contents 4 of 8.4.2.2), the gbiIdxCol may be derived from gbiIdxCol. That is, a weight index of a temporal motion vector candidate may be derived from a weight index of a col block.

[0161] Meanwhile, according to another embodiment of the present document, when constructing a motion vector candidate for a subblock-based merge mode, a weight index for weighted averaging for a temporal motion vector candidate can be derived. Here, the subblock-based merge mode can be referred to as an affine merge mode (subblock-based). The temporal motion vector candidate can represent a subblock-based temporal motion vector candidate and can also be referred to as an SbTMVP (or ATMVP) candidate. That is, when the inter prediction type is bi-prediction, weight index information can be derived for an SbTMVP candidate (or a subblock-based temporal motion vector candidate) in an affine merge candidate list or a subblock merge candidate list.

[0162] For example, weight index information for weighted averaging of sub-block-based temporal motion vector candidates may always be derived to 0. Here, weight index information being 0 may mean that the weights of each reference direction (i.e., L0 prediction direction and L1 prediction direction in bi-prediction) are the same. For example, a procedure for deriving motion vectors and reference indexes in a sub-block merging mode and a procedure for deriving sub-block-based temporal merging candidates may be as shown in Tables 3 and 4, respectively.

[0163] [Table 3-1]

[0164] [Table 3-2]

[0165] [Table 3-3]

[0166] [Table 3-4]

[0167] [Table 3-5]

[0168] [Table 3-6]

[0169] [Table 3-7]

[0170] [Table 3-8]

[0171] [Table 4]

[0172] Referring to Tables 3 and 4, gbiIdx may represent a bi-prediction weight index, and gbiIdxSbCol may represent a bi-prediction weight index for a sub-block based temporal merge candidate (e.g., a temporal motion vector candidate in a sub-block based merge candidate list), and in the procedure (8.4.4.3) of deriving the sub-block based temporal merge candidate, gbiIdxSbCol may be derived to 0. That is, the weight index of the sub-block based temporal motion vector candidate may be derived to 0.

[0173] Alternatively, weight index information for weighted averaging of sub-block-based temporal motion vector candidates may be derived based on weight index information of a temporal center block. For example, the temporal center block may represent a col block or a sub-block or sample located at the center of the col block, and more specifically, may represent a sub-block or sample located at the lower right side of the four sub-blocks or samples in the center of the col block. For example, in this case, a procedure for deriving motion vectors and reference indexes in a sub-block merging mode, a procedure for deriving sub-block-based temporal merging candidates, and a procedure for deriving base motion information for sub-block-based temporal merging may be as shown in Tables 5, 6, and 7, respectively.

[0174] [Table 5-1]

[0175] [Table 5-2]

[0176]

Table 5-3

[0177]

Table 5-4

[0178]

Table 5-5

[0179]

Table 5-6

[0180]

Table 5-7

[0181]

Table 5-8

[0182]

Table 6-1

[0183]

Table 6-2

[0184]

Table 6-3

[0185]

Table 6-4

[0186] [Table 7-1]

[0187] [Table 7-2]

[0188] [Table 7-3]

[0189] [Table 7-4]

[0190] Referring to Tables 5, 6, and 7, gbiIdx may represent a bi-prediction weight index, and gbiIdxSbCol may represent a bi-prediction weight index for a sub-block-based temporal merge candidate (e.g., a temporal motion vector candidate in a sub-block-based merge candidate list). In a procedure (8.4.4.4) of deriving base motion information for sub-block-based temporal merge, gbiIdxSbCol may be derived from gbiIdxcolCb. That is, a weight index of a sub-block-based temporal motion vector candidate may be derived from a weight index of a temporal center block. For example, the temporal center block may represent a col block or a sub-block or sample located at the center of the col block, and more specifically, may represent a sub-block or sample located at the lower right side of the four central sub-blocks or samples of the col block.

[0191] Alternatively, weight index information for weighted averaging of subblock-based temporal motion vector candidates may be derived based on weight index information of each subblock, and if a subblock is not available, it may be derived based on weight index information of a temporal center block. For example, the temporal center block may represent a col block or a subblock or sample located at the center of the col block, and more specifically, a subblock or sample located at the lower right side of the four central subblocks or samples of the col block. For example, in this case, a procedure for deriving motion vectors and reference indexes in a subblock merging mode, a procedure for deriving subblock-based temporal merging candidates, and a procedure for deriving base motion information for subblock-based temporal merging may be as shown in Tables 8, 9, and 10 below.

[0192] [Table 8-1]

[0193] [Table 8-2]

[0194] [Table 8-3]

[0195] [Table 8-4]

[0196] [Table 8-5]

[0197] [Table 8-6]

[0198]

Table 8-7

[0199]

Table 8-8

[0200]

Table 9-1

[0201]

Table 9-2

[0202]

Table 9-3

[0203]

Table 9-4

[0204]

Table 9-5

[0205]

Table 10-1

[0206]

Table 10-2

[0207]

Table 10-3

[0208] [Table 10-4]

[0209] Referring to Tables 8, 9, and 10, gbiIdx may represent a bi-prediction weight index, and gbiIdxSbCol may represent a bi-prediction weight index for a sub-block-based temporal merge candidate (e.g., a temporal motion vector candidate in a sub-block-based merge candidate list). In the procedure (8.4.4.3) of deriving base motion information for sub-block-based temporal merging, gbiIdxSbCol may be derived from gbiIdxcolCb. Alternatively, in a procedure (8.4.4.3) of deriving base motion information for sub-block based temporal merging according to a condition (e.g., when availableFlagL0SbCol and availableFlagL1SbCol are both 0), the gbiIdxSbCol may be derived from ctrgbiIdx, and in a procedure (8.4.4.4) of deriving base motion information for sub-block based temporal merging, the ctrgbiIdx may be derived from gbiIdxSbCol. That is, the weight index of the sub-block based temporal motion vector candidate may be derived from the weight index of each sub-block unit, and if the sub-block is not available, it may be derived from the weight index of the temporal center block. For example, the temporal center block may represent a col block or a sub-block or sample located at the center of the col block, and more specifically, may represent a sub-block or sample located at the lower right side of the four central sub-blocks or samples of the col block.

[0210] Meanwhile, according to another embodiment of the present document, when constructing a motion vector candidate for a merge mode, weight index information for pair-wise candidates may be derived. For example, pair-wise candidates may be included in a merge candidate list, and weight index information for a weighted average of the pair-wise candidates may be derived. The pair-wise candidates may be derived based on other merge candidates in the merge candidate list, and if the pair-wise candidates use bi-prediction, weight index information for a weighted average may be derived. That is, if an inter prediction type is bi-prediction, weight index information for a pair-wise candidate in the merge candidate list may be derived.

[0211] The pairwise candidate may be derived based on two other merging candidates (eg, cand0 and cand1) among the candidates included in the merging candidate list.

[0212] For example, the weight index information for the pairwise candidate may be derived based on weight index information of one of the two merge candidates (e.g., merge candidate cand0 or merge candidate cand1). For example, the weight index information for the pairwise candidate may be derived based on weight index information of a candidate using bi-prediction among the two merge candidates.

[0213] Alternatively, if the weight index information of each of the other two merging candidates is the same as the first weight index information, the weight index information for the pairwise candidate may be derived based on the first weight index information. On the other hand, if the weight index information of each of the other two merging candidates is not the same as each other, the weight index information for the pairwise candidate may be derived based on default weight index information. The default weight index information may correspond to weight index information that assigns the same weight to each of the L0 prediction sample and the L1 prediction sample.

[0214] Alternatively, if the weight index information of each of the other two merging candidates is the same as the first weight index information, the weight index information for the pairwise candidate may be derived based on the first weight index information. On the other hand, if the weight index information of each of the other two merging candidates is not the same as each other, the weight index information for the pairwise candidate may be derived based on weight index information that is not default weight index information among the weight index information of each of the other two candidates. The default weight index information may correspond to weight index information that assigns the same weight to each of the L0 prediction sample and the L1 prediction sample.

[0215] Meanwhile, according to another embodiment of the present document, when constructing a motion vector candidate for a sub-block-based merge mode, weight index information for weighted averaging for a temporal motion vector candidate can be derived. Here, the sub-block-based merge mode can be referred to as an affine merge mode (sub-block-based). The temporal motion vector candidate can represent a sub-block-based temporal motion vector candidate and can also be referred to as an SbTMVP (or ATMVP) candidate. The weight index information for the SbTMVP candidate can be derived based on weight index information of a left peripheral block of the current block. That is, when a candidate derived by SbTMVP uses bi-prediction, the weight index of the left peripheral block of the current block can be derived as a weight index for a sub-block-based merge mode.

[0216] For example, since the SbTMVP candidate can derive a col block based on a spatially adjacent left block (or a left peripheral block) of the current block, the weight index of the left peripheral block can be considered to be reliable. Thus, the weight index for the SbTMVP candidate can be derived from the weight index of the left peripheral block.

[0217] Meanwhile, according to another embodiment of the present document, when constructing a motion vector candidate for an affine merge mode, if the affine merge candidate uses bi-prediction, weight index information for weighted averaging can be derived. That is, if the inter prediction type is bi-prediction, weight index information for candidates in an affine merge candidate list or a sub-block merge candidate list can be derived.

[0218] For example, among the affine merge candidates, the constructed affine merge candidate may represent a candidate for deriving MVF in an affine model by deriving a CP0, CP1, CP2, or CP3 candidate based on motion information of a spatially adjacent block (or a spatially neighboring block) or a temporally adjacent block (or a temporally neighboring block) of the current block. For example, CP0 may represent a control point located at the upper left sample position of the current block, CP1 may represent a control point located at the upper right sample position of the current block, and CP2 may represent a control point located at the lower left sample position of the current block. Also, CP3 may represent a control point located at the lower right sample position of the current block.

[0219] For example, among the affine merge candidates, constructed affine merge candidates may be generated based on a combination of each control point of the current block, such as {CP0,CP1,CP2}, {CP0,CP1,CP3}, {CP0,CP2,CP3}, {CP1,CP2,CP3}, {CP0,CP1}, and {CP0,CP2}. For example, the affine merge candidates may include at least one of {CPMV0,CPMV1,CPMV2}, {CPMV0,CPMV1,CPMV3}, {CPMV0,CPMV2,CPMV3}, {CPMV1,CPMV2,CPMV3}, {CPMV0,CPMV1}, and {CPMV0,CPMV2}. CPMV0, CPMV1, CPMV2, and CPMV3 may correspond to motion vectors for CP0, CP1, CP2, and CP3, respectively.

[0220] In an embodiment, when the affine merge candidates include CPMV0 for Control Point 0 (CP0) located at the upper left side of the current block, weight index information for the affine merge candidates may be derived based on 0th weight index information for the CP0. The 0th weight index information may correspond to weight index information of a block used for deriving the CPMV0 among the neighboring blocks of the CP0. In this case, the neighboring blocks of the CP0 may include a neighboring block at the upper left corner of the current block, a left neighboring block adjacent to the lower side of the neighboring block at the upper left corner, and an upper neighboring block adjacent to the right side of the neighboring block at the upper left corner.

[0221] Meanwhile, if the affine merge candidates do not include CPMV0 for CP0 located at the upper left side of the current block, weight index information for the affine merge candidates may be derived based on first weight index information for Control Point 1 (CP1) located at the upper right side of the current block. The first weight index information may correspond to weight index information of blocks used for deriving the CPMV1 among the neighboring blocks of CP1. In this case, the neighboring blocks of CP1 may include a neighboring block at the upper right corner of the current block and an upper neighboring block adjacent to the left of the neighboring block at the upper right corner.

[0222] According to the above method, weight index information for the affine merge candidates can be derived based on weight index information of blocks used for deriving the first CPMV for each of {CPMV0,CPMV1,CPMV2}, {CPMV0,CPMV1,CPMV3}, {CPMV0,CPMV2,CPMV3}, {CPMV1,CPMV2,CPMV3}, {CPMV0,CPMV1} and {CPMV0,CPMV2}.

[0223] According to another embodiment of the method for deriving weight index information for the affine merge candidate, when weight index information for CP0 located at the upper left side of the current block is the same as weight index information for CP1 located at the upper right side of the current block, the weight index information for the affine merge candidate may be derived based on 0th weight index information for the CP0. The 0th weight index information may correspond to weight index information of a block used for deriving the CPMV0 among neighboring blocks of the CP0. Meanwhile, when weight index information for CP0 located at the upper left side of the current block is not the same as weight index information for CP1 located at the upper right side of the current block, the weight index information for the affine merge candidate may be derived based on default weight index information. The default weight index information may correspond to weight index information that assigns the same weight to each of the L0 prediction sample and the L1 prediction sample.

[0224] According to still another embodiment of the method for deriving weight index information for the affine merge candidate, the weight index information for the affine merge candidate may be derived using a weight index of a candidate that occurs frequently among the weight indexes of the candidates. For example, the most overlapping weight index may be derived using a weight index of the affine merge candidate among the weight indexes of the candidate blocks determined to have a motion vector in CP0 among the CP0 candidate blocks, the weight index of the candidate blocks determined to have a motion vector in CP1 among the CP1 candidate blocks, the weight index of the candidate blocks determined to have a motion vector in CP2 among the CP2 candidate blocks, and / or the weight index of the candidate blocks determined to have a motion vector in CP3 among the CP3 candidate blocks.

[0225] For example, CP0 and CP1 may be used as the control points, or CP0, CP1, and CP2 may be used, and CP3 may not be used. However, for example, when using a CP3 candidate of an affine block (a block coded in an affine prediction mode), the method of deriving a weight index in a temporal candidate block described in the above embodiment may be used.

[0226] 12 and 13 illustrate an example of a schematic of a video / image encoding method and associated components according to an embodiment of the present document.

[0227] The method disclosed in FIG. 12 may be performed by the encoding apparatus disclosed in FIG. 2 or FIG. 13. Specifically, for example, S1200 to S1220 in FIG. 12 may be performed by the prediction unit 220 of the encoding apparatus 200 in FIG. 13, and S1230 in FIG. 12 may be performed by the entropy encoding unit 240 of the encoding apparatus 200 in FIG. 13. Also, although not shown in FIG. 12, the prediction unit 220 of the encoding apparatus 200 in FIG. 12 may derive prediction samples or prediction-related information, the residual processing unit 230 of the encoding apparatus 200 may derive residual information from original samples or prediction samples, and the entropy encoding unit 240 of the encoding apparatus 200 may generate a bitstream from the residual information or prediction-related information. The method disclosed in FIG. 12 may include the embodiments described above in this document.

[0228] 12, an encoding apparatus may determine an inter prediction mode of a current block and generate inter prediction mode information indicating the inter prediction mode (S1200). For example, the encoding apparatus may determine a merge mode, an affine (merge) mode, or a sub-block merge mode as an inter prediction mode to be applied to the current block, and may generate inter prediction mode information indicating the same.

[0229] The encoding apparatus may generate a merge candidate list for the current block based on the inter prediction mode (S1210). For example, the encoding apparatus may generate the merge candidate list according to a determined inter prediction mode. Here, when the determined inter prediction mode is an affine merge mode or a sub-block merge mode, the merge candidate list may be referred to as an affine merge candidate list or a sub-block merge candidate list, or may be simply referred to as a merge candidate list.

[0230] For example, candidates may be inserted into the merge candidate list until the number of candidates in the merge candidate list becomes the maximum number of candidates. Here, a candidate may represent a candidate or a candidate block for deriving motion information (or a motion vector) of a current block. For example, a candidate block may be derived through a search for neighboring blocks of a current block. For example, the neighboring blocks may include spatial neighboring blocks and / or temporal neighboring blocks of a current block, and the spatial neighboring blocks may be searched first to derive a (spatial merge) candidate, and then the temporal neighboring blocks may be searched to derive a (temporal merge) candidate, and the derived candidate may be inserted into the merge candidate list. For example, the merge candidate list may insert an additional candidate if the number of candidates in the merge candidate list is less than the maximum number of candidates even after inserting the candidate. For example, the additional candidates may include at least one of history based merge candidate(s), pair-wise average merge candidate(s), ATMVP, combined bi-predictive merge candidate (if the slice / tile group type of the current slice / tile group is type B), and / or zero vector merge candidate.

[0231] Alternatively, for example, candidates may be inserted into the affine merge candidate list until the number of candidates in the affine merge candidate list reaches the maximum number of candidates. Here, the candidates may include a control point motion vector (CPMV) of the current block. Alternatively, the candidates may represent candidates or candidate blocks for deriving the CPMV. The CPMV may represent a motion vector at a control point (CP) of the current block. For example, there may be two, three, or four CPs, and the CPs may be located at least in part of the upper left side (or upper left corner), upper right side (or upper right corner), lower left side (or lower left corner), or lower right side (or lower right corner) of the current block, and there may be only one CP for each position.

[0232] For example, the candidates may be derived through a search for neighboring blocks of the current block (or neighboring blocks of the CP of the current block). For example, the affine merge candidate list may include at least one of an inherited affine merge candidate, a constructed affine merge candidate, or a zero motion vector candidate. For example, the affine merge candidate list may first insert the inherited affine merge candidate, and then insert the constructed affine merge candidate. In addition, if the number of candidates in the affine merge candidate list is less than the maximum number of candidates after the constructed affine merge candidate is inserted in the affine merge candidate list, the remainder may be filled with a zero motion vector candidate. Here, the zero motion vector candidate may also be referred to as a zero vector. For example, the affine merge candidate list may be a list according to an affine merge mode in which a motion vector is derived in a sample unit, or may be a list according to an affine merge mode in which a motion vector is derived in a sub-block unit. In this case, the affine merge candidate list may be referred to as a sub-block merge candidate list, and the sub-block merge candidate list may also include candidates derived with SbTMVP (or SbTMVP candidates). For example, if an SbTMVP candidate is included in the sub-block merge candidate list, it may be positioned before inherited and constructed affine merge candidates in the sub-block merge candidate list.

[0233] The encoding apparatus may generate selection information indicating one of the candidates included in the merge candidate list (S1220). For example, the merge candidate list may include at least a portion of a spatial merge candidate, a temporal merge candidate, a pairwise candidate, or a zero vector candidate, and one of such candidates may be selected for inter prediction of the current block. Alternatively, for example, the merge candidate list of a sub-block may include at least a portion of an inherited affine merge candidate, a constructed affine merge candidate, an SbTMVP candidate, or a zero vector candidate, and one of such candidates may be selected for inter prediction of the current block.

[0234] For example, the selection information may include index information indicating a selected candidate in the merge candidate list, For example, the selection information may be referred to as merge index information or sub-block merge index information.

[0235] In addition, the encoding apparatus may generate inter-prediction type information indicating an inter-prediction type of a current block as bi-prediction. For example, the inter-prediction type of the current block may be determined as bi-prediction among L0 prediction, L1 prediction, or bi-prediction, and inter-prediction type information indicating this may be generated. Here, L0 prediction may indicate reference picture list 0-based prediction, L1 prediction may indicate reference picture list 1-based prediction, and bi-prediction may indicate reference picture list 0- and reference picture list 1-based prediction. For example, the encoding apparatus may generate inter-prediction type information based on the inter-prediction type. For example, the inter-prediction type information may include an inter_pred_idc syntax element.

[0236] The encoding apparatus may encode image information including inter prediction mode information and selection information (S1230). For example, the image information may be referred to as video information. The image information may include various information according to the above-mentioned embodiments of this document. For example, the image information may include at least a portion of prediction related information or residual related information. For example, the prediction related information may include at least a portion of the inter prediction mode information, selection information, and inter prediction type information. For example, the encoding apparatus may encode image information including all or a portion of the above-mentioned information (or syntax elements) to generate a bitstream or encoded information. Alternatively, the bitstream or encoded information may be output in the form of a bitstream. The bitstream or encoded information may be transmitted to a decoding apparatus via a network or a storage medium.

[0237] Although not shown in FIG. 12, for example, the encoding apparatus may generate a prediction sample of the current block. Alternatively, for example, the encoding apparatus may generate a prediction sample of the current block based on a selected candidate. Alternatively, for example, the encoding apparatus may derive motion information based on a selected candidate and generate a prediction sample of the current block based on the motion information. For example, the encoding apparatus may generate an L0 prediction sample and an L1 prediction sample by bi-prediction, and may generate a prediction sample of the current block based on the L0 prediction sample and the L1 prediction sample. In this case, a prediction sample of the current block may be generated from the L0 prediction sample and the L1 prediction sample using weight index information (or weight information) for bi-prediction. Here, the weight information may be indicated based on the weight index information.

[0238] In other words, for example, the encoding apparatus may generate L0 predicted samples and L1 predicted samples of the current block based on the selected candidates. For example, if the inter prediction type of the current block is determined to be bi-predictive, reference picture list 0 and reference picture list 1 may be used for predicting the current block. For example, the L0 predicted samples may represent predicted samples of the current block derived based on the reference picture list 0, and the L1 predicted samples may represent predicted samples of the current block derived based on the reference picture list 1.

[0239] For example, the candidates may include a spatial merge candidate. For example, if the selected candidate is the spatial merge candidate, L0 motion information and L1 motion information may be derived based on the spatial merge candidate, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 prediction sample.

[0240] For example, the candidates may include a temporal merge candidate. For example, if the selected candidate is the temporal merge candidate, L0 motion information and L1 motion information may be derived based on the temporal merge candidate, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 prediction sample.

[0241] For example, the candidates may include pair-wise candidates. For example, if the selected candidate is a pair-wise candidate, L0 motion information and L1 motion information may be derived based on the pair-wise candidate, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 prediction sample. For example, the pair-wise candidate may be derived based on two other candidates among the candidates included in the merge candidate list.

[0242] Alternatively, for example, the merge candidate list may be a sub-block merge candidate list, and an affine merge candidate, a sub-block merge candidate, or an SbTMVP candidate may be selected, where the sub-block-based affine merge candidate may also be referred to as a sub-block merge candidate.

[0243] For example, the candidates may include subblock merging candidates. For example, if the selected candidate is the subblock merging candidate, L0 motion information and L1 motion information may be derived based on the subblock merging candidate, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 prediction sample. For example, the subblock merging candidate may include a control point motion vector (CPMV), and the L0 prediction sample and the L1 prediction sample may be generated by performing prediction on a subblock basis based on the CPMV.

[0244] Here, the CPMV can be represented based on one of the neighboring blocks of the CP (Control Point) of the current block. For example, there can be two, three, or four CPs, and they can be located at least in part of the upper left side (or upper left corner), upper right side (or upper right corner), lower left side (or lower left corner), or lower right side (or lower right corner) of the current block, and only one CP can exist for each position.

[0245] For example, the CP may be CP0 located at the upper left side of the current block. In this case, the neighboring blocks may include a neighboring block at the upper left corner of the current block, a neighboring block on the left side adjacent to the lower side of the neighboring block at the upper left corner, and a neighboring block on the upper right side of the neighboring block at the upper left corner. Alternatively, the neighboring blocks may include block A2, block B2, or block B3 in FIG. 10.

[0246] Alternatively, for example, the CP may be CP1 located at the upper right side of the current block. In this case, the neighboring blocks may include a neighboring block at the upper right corner of the current block and a neighboring block at the upper left side of the neighboring block at the upper right corner. Alternatively, the neighboring blocks may include block B0 or ​​block B1 in FIG. 10.

[0247] Alternatively, for example, the CP may be CP2 located at the lower left side of the current block. In this case, the neighboring blocks may include a neighboring block at the lower left corner of the current block and a neighboring block on the left side adjacent to the upper side of the neighboring block at the lower left corner. Alternatively, the neighboring blocks may include block A0 or block A1 in FIG. 10.

[0248] Or, for example, the CP may be CP3 located at the lower right side of the current block. Here, CP3 may also be called RB. In this case, the neighboring blocks may include a col block of the current block or a neighboring block at the lower right corner of the col block. Here, the col block may include a block at the same position as the current block in a reference picture different from the current picture in which the current block is located. Alternatively, the neighboring blocks may include a T block in FIG. 10.

[0249] Alternatively, for example, the candidate may include an SbTMVP candidate. For example, if the selected candidate is the SbTMVP candidate, L0 motion information and L1 motion information may be derived based on a left neighboring block of the current block, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 prediction sample. For example, the L0 prediction sample and the L1 prediction sample may be generated by performing prediction on a sub-block basis.

[0250] For example, the L0 motion information may include an L0 reference picture index and an L0 motion vector, etc., and the L1 motion information may include an L1 reference picture index and an L1 motion vector, etc. The L0 reference picture index may include information representing a reference picture in reference picture list 0, and the L1 reference picture index may include information representing a reference picture in reference picture list 1.

[0251] For example, the encoding apparatus may generate a prediction sample of a current block based on an L0 prediction sample, an L1 prediction sample, and weight information. For example, the weight information may be represented based on weight index information. The weight index information may represent weight index information for bi-prediction. For example, the weight information may include information for a weighted average of an L0 prediction sample or an L1 prediction sample. That is, the weight index information may represent index information for a weight used in the weighted average, and the weight index information may be generated in a procedure of generating a prediction sample based on the weighted average. For example, the weight index information may include information representing any one of three or five weights. For example, the weight average may represent a weighted average in Bi-prediction with CU-level Weight (BCW) or Bi-prediction with Weighted Average (BWA).

[0252] For example, the candidates may include a temporal merge candidate, and the weight index information for the temporal merge candidate may be represented as 0. That is, the weight index information for the temporal merge candidate may be represented as 0. Here, the weight index information being 0 may represent that the weights of each reference direction (i.e., L0 prediction direction and L1 prediction direction in bi-prediction) are the same. Alternatively, for example, the candidates may include a temporal merge candidate, and the weight index information may be represented based on weight index information of a col block. That is, the weight index information for a temporal merge candidate may be represented based on weight index information of a col block. Here, the col block may include a block at the same position as the current block in a reference picture different from the current picture in which the current block is located.

[0253] For example, the candidates may include a pair-wise candidate, and the weight index information may be represented based on weight index information of one of two other candidates in a merge candidate list used to derive the pair-wise candidate. That is, the weight index information for the pair-wise candidate may be represented based on weight index information of one of two other candidates in a merge candidate list used to derive the pair-wise candidate.

[0254] For example, the candidates include a pair-wise candidate, and the pair-wise candidate may be represented based on two other candidates among the candidates. If the weight index information of each of the other two candidates is the same as a first weight index information, the weight index information for the pair-wise candidate may be represented based on the first weight index information. If the weight index information of each of the other two candidates is not the same as each other, the weight index information for the pair-wise candidate may be represented based on default weight index information. In this case, the default weight index information may correspond to weight index information that assigns the same weight to each of the L0 prediction sample and the L1 prediction sample.

[0255] For example, the candidates include a pair-wise candidate, and the pair-wise candidate may be represented based on two other candidates among the candidates. If the weight index information of each of the other two candidates is the same as a first weight index information, the weight index information for the pair-wise candidate may be represented based on the first weight index information. If the weight index information of each of the other two candidates is not the same as each other, the weight index information for the pair-wise candidate may be represented based on weight index information that is not default weight index information among the weight index information of each of the other two candidates. The default weight index information may correspond to weight index information that assigns the same weight to each of the L0 prediction sample and the L1 prediction sample.

[0256] For example, the merge candidate list may be a sub-block merge candidate list, and an affine merge candidate, a sub-block merge candidate, or an SbTMVP candidate may be selected. Here, a sub-block-based affine merge candidate may also be referred to as a sub-block merge candidate.

[0257] For example, the candidates may include affine merge candidates, which may include Control Point Motion Vectors (CPMVs).

[0258] For example, if the affine merge candidates include CPMV0 for Control Point 0 (CP0) located at the upper left side of the current block, weight index information for the affine merge candidates may be represented based on 0th weight index information for the CP0. If the affine merge candidates do not include CPMV0 for CP0 located at the upper left side of the current block, weight index information for the affine merge candidates may be represented based on 1st weight index information for Control Point 1 (CP1) located at the upper right side of the current block.

[0259] The 0th weight index information corresponds to weight index information of a block used for deriving the CPMV0 among the neighboring blocks of the CP0, and the neighboring blocks of the CP0 may include a neighboring block at the upper left corner of the current block, a left neighboring block adjacent to the lower side of the neighboring block at the upper left corner, and an upper neighboring block adjacent to the right side of the neighboring block at the upper left corner.

[0260] The first weight index information corresponds to weight index information of a block among the neighboring blocks of CP1 that is used for deriving CPMV1, and the neighboring blocks of CP1 may include a neighboring block in the upper right corner of the current block and an upper neighboring block adjacent to the left of the neighboring block in the upper right corner.

[0261] Alternatively, for example, the candidates may include SbTMVP candidates, and weight index information for the SbTMVP candidates may be represented based on weight index information of left neighboring blocks of the current block. That is, weight index information for SbTMVP candidates may be represented based on weight index information of the left neighboring blocks.

[0262] Or, for example, the candidates may include an SbTMVP candidate, and weight index information for the SbTMVP candidate may be represented as 0. That is, weight index information for an SbTMVP candidate may be represented as 0. Here, weight index information being 0 may represent that the weights of each reference direction (i.e., the L0 prediction direction and the L1 prediction direction in bi-prediction) are the same.

[0263] Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be represented based on weight index information of a center block in a col block. That is, the weight index information for the SbTMVP candidates may be represented based on weight index information of a center block in a col block. Here, the col block may include a block at the same position as the current block in a reference picture different from the current picture in which the current block is located, and the center block may include a lower right sub-block among four sub-blocks located in the center of the col block.

[0264] Or, for example, the candidates may include SbTMVP candidates, and the weight index information may be represented based on the weight index information of each of the sub-blocks of a col block. That is, the weight index information for the SbTMVP candidates may be represented based on the weight index information of each of the sub-blocks of a col block.

[0265] Alternatively, although not shown in FIG. 12, for example, the encoding apparatus may derive a residual sample based on the prediction sample and an original sample. In this case, residual-related information may be derived based on the residual sample. A residual sample may be derived based on the residual-related information. A reconstructed sample may be generated based on the residual sample and the prediction sample. A reconstructed block and a reconstructed picture may be derived based on the reconstructed sample. Alternatively, for example, the encoding apparatus may encode video information including residual-related information or prediction-related information.

[0266] For example, an encoding device may encode video information including all or a part of the above-mentioned information (or syntax elements) to generate a bitstream or encoded information. Alternatively, the video information may be output in the form of a bitstream. The bitstream or encoded information may be transmitted to a decoding device via a network or a storage medium. Alternatively, the bitstream or encoded information may be stored in a computer-readable storage medium, and the bitstream or encoded information may be generated by the above-mentioned video encoding method.

[0267] 14 and 15 illustrate an example of a video / image decoding method and associated components according to embodiments of the present document.

[0268] The method disclosed in Fig. 14 may be performed by the decoding apparatus disclosed in Fig. 3 or Fig. 15. Specifically, for example, S1400 in Fig. 14 may be performed by the entropy decoding unit 310 of the decoding apparatus 300 in Fig. 15, and S1410 to S1440 in Fig. 14 may be performed by the prediction unit 330 of the decoding apparatus 300 in Fig. 15. Also, although not shown in Fig. 14, in Fig. 15, the entropy decoding unit 310 of the decoding apparatus 300 may derive prediction related information or residual information from a bitstream, the residual processing unit 320 of the decoding apparatus 300 may derive residual samples from the residual information, the prediction unit 330 of the decoding apparatus 300 may derive prediction samples from the prediction related information, and the adder 340 of the decoding apparatus 300 may derive reconstructed blocks or reconstructed pictures from the residual samples or prediction samples. The method disclosed in FIG. 14 may include the embodiments previously described in this document.

[0269] Referring to FIG 14, a decoding device may receive image information including inter prediction mode information via a bitstream (S1400). For example, the image information may be referred to as video information. The image information may include various information according to the above-described embodiments of this document. For example, the image information may include at least a portion of prediction-related information or residual-related information.

[0270] For example, the prediction related information may include inter prediction mode information or inter prediction type information. For example, the inter prediction mode information may include information indicating at least a part of various inter prediction modes. For example, various modes such as merge mode, skip mode, motion vector prediction (MVP) mode, affine mode, sub-block merge mode, or merge with MVD (MMVD) mode may be used. In addition, a decoder side motion vector refinement (DMVR) mode, an adaptive motion vector resolution (AMVR) mode, bi-prediction with CU-level weight (BCW), or bi-directional optical flow (BDOF), etc. may be used in addition to or instead of the additional mode. For example, the inter prediction type information may include an inter_pred_idc syntax element. Alternatively, the inter prediction type information may include information indicating any of L0 prediction, L1 prediction, or bi-prediction.

[0271] The decoding apparatus may generate a merge candidate list for the current block based on the inter prediction mode information (S1410). For example, the decoding apparatus may determine the inter prediction mode of the current block as a merge mode, an affine (merge) mode, or a sub-block merge mode based on the inter prediction mode information, and may generate a merge candidate list according to the determined inter prediction mode. Here, when the inter prediction mode is determined to be the affine merge mode or the sub-block merge mode, the merge candidate list may be called an affine merge candidate list, a sub-block merge candidate list, or the like, or may be simply called a merge candidate list.

[0272] For example, candidates may be inserted into the merge candidate list until the number of candidates in the merge candidate list becomes the maximum number of candidates. Here, a candidate may represent a candidate or a candidate block for deriving motion information (or a motion vector) of a current block. For example, a candidate block may be derived through a search for neighboring blocks of a current block. For example, the neighboring blocks may include spatial neighboring blocks and / or temporal neighboring blocks of a current block, and the spatial neighboring blocks may be searched first to derive a (spatial merge) candidate, and then the temporal neighboring blocks may be searched to derive a (temporal merge) candidate, and the derived candidate may be inserted into the merge candidate list. For example, the merge candidate list may insert an additional candidate if the number of candidates in the merge candidate list is less than the maximum number of candidates even after inserting the candidate. For example, the additional candidates may include at least one of history based merge candidate(s), pair-wise average merge candidate(s), ATMVP, combined bi-predictive merge candidate (if the slice / tile group type of the current slice / tile group is type B), and / or zero vector merge candidate.

[0273] Alternatively, for example, candidates may be inserted into the affine merge candidate list until the number of candidates in the affine merge candidate list reaches the maximum number of candidates. Here, the candidates may include a control point motion vector (CPMV) of the current block. Alternatively, the candidates may represent candidates or candidate blocks for deriving the CPMV. The CPMV may represent a motion vector at a control point (CP) of the current block. For example, there may be two, three, or four CPs, and the CPs may be located at least in part of the upper left side (or upper left corner), upper right side (or upper right corner), lower left side (or lower left corner), or lower right side (or lower right corner) of the current block, and there may be only one CP for each position.

[0274] For example, the candidate block may be derived through a search for neighboring blocks of the current block (or neighboring blocks of the CP of the current block). For example, the affine merge candidate list may include at least one of an inherited affine merge candidate, a constructed affine merge candidate, or a zero motion vector candidate. For example, the affine merge candidate list may first insert the inherited affine merge candidate, and then insert the constructed affine merge candidate. In addition, if the number of candidates in the affine merge candidate list is less than the maximum number of candidates after the constructed affine merge candidate is inserted in the affine merge candidate list, the remainder may be filled with a zero motion vector candidate. Here, the zero motion vector candidate may also be referred to as a zero vector. For example, the affine merge candidate list may be a list according to an affine merge mode in which a motion vector is derived in a sample unit, or may be a list according to an affine merge mode in which a motion vector is derived in a sub-block unit. In this case, the affine merge candidate list may also be referred to as a sub-block merge candidate list, and the sub-block merge candidate list may also include candidates derived with SbTMVP (or SbTMVP candidates). For example, if an SbTMVP candidate is included in the sub-block merge candidate list, it may be positioned before the inherited affine merge candidate and the constructed affine merge candidate in the sub-block merge candidate list.

[0275] The decoding apparatus may derive motion information of the current block based on a selected candidate from the merge candidate list (S1420). For example, the merge candidate list may include at least a portion of a spatial merge candidate, a temporal merge candidate, a pairwise candidate, or a zero vector candidate, and one of such candidates may be selected for inter prediction of the current block. Alternatively, for example, the sub-block merge candidate list may include at least a portion of an inherited affine merge candidate, a constructed affine merge candidate, an SbTMVP candidate, or a zero vector candidate, and one of such candidates may be selected for inter prediction of the current block. For example, the selected candidate may be selected from the merge candidate list based on selection information. For example, the selection information may include index information indicating a selected candidate in the merge candidate list. For example, the selection information may be referred to as merge index information or sub-block merge index information. For example, the selection information may be included in the video information. Alternatively, the selection information may be included in the inter prediction mode information.

[0276] The decoding apparatus may generate an L0 prediction sample and an L1 prediction sample of the current block based on the motion information (S1430). For example, when the inter prediction type is derived as bi-prediction, the decoding apparatus may derive L0 motion information and L1 motion information based on the selected candidate. The decoding apparatus may derive the inter prediction type of the current block as bi-prediction based on the inter prediction type information. For example, the inter prediction type of the current block may be derived as bi-prediction among L0 prediction, L1 prediction, or bi-prediction based on the inter prediction type information. Here, the L0 prediction may indicate a reference picture list 0-based prediction, the L1 prediction may indicate a reference picture list 1-based prediction, and the bi-prediction may indicate a reference picture list 0-based and a reference picture list 1-based prediction. For example, the inter prediction type information may include an inter_pred_idc syntax element.

[0277] For example, the L0 motion information may include an L0 reference picture index and an L0 motion vector, etc., and the L1 motion information may include an L1 reference picture index and an L1 motion vector, etc. The L0 reference picture index may include information indicating a reference picture in reference picture list 0, and the L1 reference picture index may include information indicating a reference picture in reference picture list 1.

[0278] For example, the candidates may include a spatial merge candidate. For example, if the selected candidate is the spatial merge candidate, L0 motion information and L1 motion information may be derived based on the spatial merge candidate, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 prediction sample.

[0279] For example, the candidates may include a temporal merge candidate. For example, if the selected candidate is the temporal merge candidate, L0 motion information and L1 motion information may be derived based on the temporal merge candidate, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 prediction sample.

[0280] For example, the candidates may include pair-wise candidates. For example, if the selected candidate is a pair-wise candidate, L0 motion information and L1 motion information may be derived based on the pair-wise candidate, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 prediction sample. For example, the pair-wise candidate may be derived based on two other candidates among the candidates included in the merge candidate list.

[0281] Alternatively, for example, the merge candidate list may be a sub-block merge candidate list, and an affine merge candidate, a sub-block merge candidate, or an SbTMVP candidate may be selected, where the sub-block-based affine merge candidate may also be referred to as a sub-block merge candidate.

[0282] For example, the candidates may include an affine merge candidate. For example, if the selected candidate is the affine merge candidate, L0 motion information and L1 motion information may be derived based on the affine merge candidate, and the L0 prediction sample and the L1 prediction sample may be generated based on the affine merge candidate. For example, the affine merge candidate may include a control point motion vector (CPMV), and the L0 prediction sample and the L1 prediction sample may be generated by performing prediction on a sub-block basis based on the CPMV.

[0283] Here, the CPMV may be derived based on one of the neighboring blocks of the CP (Control Point) of the current block. For example, there may be two, three, or four CPs, which may be located at least in part of the upper left side (or upper left corner), upper right side (or upper right corner), lower left side (or lower left corner), or lower right side (or lower right corner) of the current block, and only one CP may exist for each position.

[0284] For example, the CP may be CP0 located at the upper left side of the current block. In this case, the neighboring blocks may include a neighboring block at the upper left corner of the current block, a neighboring block on the left side adjacent to the lower side of the neighboring block at the upper left corner, and a neighboring block on the upper right side of the neighboring block at the upper left corner. Alternatively, the neighboring blocks may include block A2, block B2, or block B3 in FIG. 10.

[0285] Alternatively, for example, the CP may be CP1 located at the upper right side of the current block. In this case, the neighboring blocks may include a neighboring block at the upper right corner of the current block and a neighboring block at the upper left side of the neighboring block at the upper right corner. Alternatively, the neighboring blocks may include block B0 or ​​block B1 in FIG. 10.

[0286] Alternatively, for example, the CP may be CP2 located at the lower left side of the current block. In this case, the neighboring blocks may include a neighboring block at the lower left corner of the current block and a neighboring block on the left side adjacent to the upper side of the neighboring block at the lower left corner. Alternatively, the neighboring blocks may include block A0 or block A1 in FIG. 10.

[0287] Or, for example, the CP may be CP3 located at the lower right side of the current block. Here, CP3 may also be called RB. In this case, the neighboring blocks may include a col block of the current block or a neighboring block at the lower right corner of the col block. Here, the col block may include a block at the same position as the current block in a reference picture different from the current picture in which the current block is located. Alternatively, the neighboring blocks may include a T block in FIG. 10.

[0288] Alternatively, for example, the candidate may include an SbTMVP candidate. For example, if the selected candidate is the SbTMVP candidate, L0 motion information and L1 motion information may be derived based on a neighboring block to the left of the current block, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 prediction sample. For example, the L0 prediction sample and the L1 prediction sample may be generated by performing prediction in units of sub-blocks.

[0289] The decoding apparatus may generate a prediction sample of a current block based on the L0 prediction sample, the L1 prediction sample, and weight information (S1440). For example, the weight information may be derived based on weight index information for a selected candidate among candidates included in a merge candidate list. For example, the weight information may include information for a weighted average of the L0 prediction sample or the L1 prediction sample. That is, the weight index information may indicate index information for a weight used in the weighted average, and the weighted average may be performed based on the weight index information. For example, the weight index information may include information indicating any one of three or five weight values. For example, the weighted average may indicate a weighted average in Bi-prediction with CU-level Weight (BCW) or Bi-prediction with Weighted Average (BWA).

[0290] For example, the candidates may include a temporal merge candidate, and weight index information for the temporal merge candidate may be derived to 0. That is, weight index information for the temporal merge candidate may be derived to 0. Here, weight index information being 0 may represent that weights of each reference direction (i.e., L0 prediction direction and L1 prediction direction in bi-prediction) are the same.

[0291] For example, the candidates may include temporal merge candidates, and weight index information for the temporal merge candidates may be derived based on weight index information of col blocks. That is, weight index information for the temporal merge candidates may be derived based on weight index information of col blocks. Here, the col blocks may include blocks at the same position as the current block in a reference picture different from the current picture in which the current block is located.

[0292] For example, the candidates may include a pair-wise candidate, and the weight index information may be derived from weight index information of one of two other candidates in a merge candidate list used to derive the pair-wise candidate. That is, the weight index information for the pair-wise candidate may be derived from weight index information of one of two other candidates in a merge candidate list used to derive the pair-wise candidate.

[0293] For example, the candidates include a pair-wise candidate, and the pair-wise candidate may be derived based on two other candidates among the candidates. If the weight index information of each of the other two candidates is identical to a first weight index information, the weight index information for the pair-wise candidate may be derived based on the first weight index information. If the weight index information of each of the other two candidates is not identical to each other, the weight index information for the pair-wise candidate may be derived based on default weight index information. In this case, the default weight index information may correspond to weight index information that assigns the same weight to each of the L0 prediction sample and the L1 prediction sample.

[0294] For example, the candidates include a pair-wise candidate, and the pair-wise candidate may be derived based on two other candidates among the candidates. If the weight index information of each of the other two candidates is identical to a first weight index information, the weight index information for the pair-wise candidate may be derived based on the first weight index information. If the weight index information of each of the other two candidates is not identical to each other, the weight index information for the pair-wise candidate may be derived based on weight index information that is not default weight index information among the weight index information of each of the other two candidates. The default weight index information may correspond to weight index information that assigns the same weight to each of the L0 prediction sample and the L1 prediction sample.

[0295] For example, the merge candidate list may be a sub-block merge candidate list, and an affine merge candidate, a sub-block merge candidate, or an SbTMVP candidate may be selected. Here, a sub-block-based affine merge candidate may also be referred to as a sub-block merge candidate.

[0296] For example, the candidates may include affine merge candidates, which may include Control Point Motion Vectors (CPMVs).

[0297] For example, if the affine merge candidates include CPMV0 for Control Point 0 (CP0) located at the upper left side of the current block, weight index information for the affine merge candidates may be derived based on 0th weight index information for the CP0. If the affine merge candidates do not include CPMV0 for CP0 located at the upper left side of the current block, weight index information for the affine merge candidates may be derived based on 1st weight index information for Control Point 1 (CP1) located at the upper right side of the current block.

[0298] The 0th weight index information corresponds to weight index information of a block used for deriving the CPMV0 among the neighboring blocks of the CP0, and the neighboring blocks of the CP0 may include a neighboring block at the upper left corner of the current block, a left neighboring block adjacent to the lower side of the neighboring block at the upper left corner, and an upper neighboring block adjacent to the right side of the neighboring block at the upper left corner.

[0299] The first weight index information corresponds to weight index information of a block among the neighboring blocks of CP1 that is used for deriving CPMV1, and the neighboring blocks of CP1 may include a neighboring block in the upper right corner of the current block and an upper neighboring block adjacent to the left of the neighboring block in the upper right corner.

[0300] Alternatively, for example, the candidates may include SbTMVP candidates, and weight index information for the SbTMVP candidates may be derived based on weight index information of neighboring blocks to the left of the current block. That is, weight index information for SbTMVP candidates may be derived based on weight index information of neighboring blocks to the left.

[0301] Or, for example, the candidates may include an SbTMVP candidate, and weight index information for the SbTMVP candidate may be derived as 0. That is, weight index information for an SbTMVP candidate may be derived as 0. Here, weight index information being 0 may indicate that the weights of each reference direction (i.e., the L0 prediction direction and the L1 prediction direction in bi-prediction) are the same.

[0302] Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be derived based on weight index information of a center block in a col block. That is, the weight index information for the SbTMVP candidates may be derived based on weight index information of a center block in a col block. Here, the col block may include a block at the same position as the current block in a reference picture different from the current picture in which the current block is located, and the center block may include a lower right sub-block among four sub-blocks located in the center of the col block.

[0303] Or, for example, the candidates may include SbTMVP candidates, and the weight index information may be derived based on the weight index information of each of the sub-blocks of a col block, i.e., the weight index information for the SbTMVP candidates may be derived based on the weight index information of each of the sub-blocks of a col block.

[0304] Although not shown in Fig. 14, for example, the decoding apparatus may derive a residual sample based on residual-related information included in the video information, generate a reconstructed sample based on the prediction sample and the residual sample, and derive a reconstructed block and a reconstructed picture based on the reconstructed sample.

[0305] For example, a decoding device may decode a bitstream or encoded information to obtain video information including all or a part of the above-mentioned information (or syntax elements), and the bitstream or encoded information may be stored in a computer-readable storage medium, and the above-mentioned decoding method may be performed.

[0306] In the above-described embodiments, the method is described based on a flow chart with a series of steps or blocks, but the embodiment is not limited to the order of steps, and a step may occur in a different order or simultaneously with different steps than described above. Also, a person skilled in the art can understand that the steps shown in the flow chart are not exclusive, and other steps may be included, or one or more steps of the flow chart may be deleted without affecting the scope of the embodiments of this document.

[0307] The methods according to the embodiments of the present document described above may be implemented in software form, and the encoding device and / or decoding device according to the present document may be included in a device that performs video processing, such as a TV, a computer, a smartphone, a set-top box, or a display device.

[0308] In this document, when the embodiments are implemented in software, the methods described above may be implemented with modules (processes, functions, etc.) that perform the functions described above. The modules may be stored in a memory and executed by a processor. The memory may be internal or external to the processor and may be coupled to the processor in various well-known ways. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may include a read-only memory (ROM), a random access memory (RAM), a flash memory, a memory card, a storage medium, and / or other storage devices. That is, the embodiments described in this document may be implemented and executed on a processor, microprocessor, controller, or chip. For example, the functional units shown in each drawing may be implemented and executed on a computer, processor, microprocessor, controller, or chip. In this case, information (e.g., information on instructions) or algorithms for implementation may be stored on a digital storage medium.

[0309] In addition, the decoding device and the encoding device to which the embodiment of this document is applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interactive device, a real-time communication device such as a video communication, a mobile streaming device, a storage medium, a camcorder, a custom video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, a virtual reality (VR) device, an argument reality (AR) device, an image telephone video device, a transportation means terminal (e.g., a vehicle (including an autonomous vehicle) terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, and may be used to process a video signal or a data signal. For example, the over-the-top video (OTT) device may include a game console, a Blu-ray player, an internet-connected TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), etc.

[0310] In addition, the processing method to which the embodiment of the present document is applied may be produced in the form of a program executed by a computer and may be stored in a computer-readable recording medium. In addition, multimedia data having a data structure according to the embodiment of the present document may also be stored in a computer-readable recording medium. The computer-readable recording medium includes all kinds of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium may include a medium realized in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bit stream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.

[0311] Also, the embodiments of the present document may be implemented in a computer program product by program code, the program code being executable by a computer according to the embodiments of the present document. The program code may be stored on a computer readable carrier.

[0312] FIG. 16 illustrates an example of a content streaming system in which the embodiments disclosed herein may be applied.

[0313] Referring to FIG. 16, a content streaming system to which the embodiments of this document are applied may broadly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0314] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted.

[0315] The bitstream may be generated by an encoding method or a bitstream generation method applied to an embodiment of this document, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0316] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as a medium to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server transmits multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server controls commands / responses between devices in the content streaming system.

[0317] The streaming server may receive content from a media repository and / or an encoding server. For example, when the content is received from the encoding server, the content may be received in real time. In this case, the streaming server may store the bitstream for a certain period of time in order to provide a smooth streaming service.

[0318] Examples of the user devices include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glass, head mounted displays (HMDs), digital TVs, desktop computers, and digital signage.

[0319] Each server in the content streaming system can be operated as a distributed server, in which case data received by each server can be processed in a distributed manner.

[0320] The claims described herein may be combined in various ways. For example, the technical features of the method claims herein may be combined and realized in an apparatus, and the technical features of the apparatus claims herein may be combined and realized in a method. Also, the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and realized in an apparatus, and the technical features of the method claims herein and the technical features of the apparatus claims herein may be combined and realized in a method.

Claims

1. 1. A video decoding method performed by a decoding device, comprising: obtaining video information including inter-prediction mode information via a bitstream; generating a merge candidate list for a current block based on the inter-prediction mode information; deriving motion information for the current block based on a candidate selected from among candidates in the merge candidate list; generating an L0 predicted sample and an L1 predicted sample of the current block based on the motion information; generating a prediction sample for the current block based on the L0 prediction sample, the L1 prediction sample, and a weight index for the current block, the weight index being derived based on a weight index for the selected candidate; the candidates include constructed affine merge candidates; The constructed affine merge candidate includes three control point motion vectors (CPMVs), the weight index for the constructed affine merge candidate indicates one of five weights; If the constructed affine merge candidate is constructed based on a CPMV0 for a control point 0 (CP0), a CPMV1 for a control point 1 (CP1), and a CPMV2 for a control point 2 (CP2), the weight index for the constructed affine merge candidate is set equal to the weight index for the CP0; The CP0 corresponds to the upper left corner of the current block; The CP1 is associated with the top right corner of the current block; CP2 is associated with the lower left corner of the current block; where the constructed affine merge candidate is constructed based on CPMV0 for CP0, CPMV1 for CP1, and CPMV3 for Control Point 3 (CP3), the weight index for the constructed affine merge candidate is set equal to the weight index for CP0; CP3 is associated with the lower right corner of the current block; where the constructed affine merge candidate is constructed based on the CPMV0 for the CP0, the CPMV2 for the CP2, and the CPMV3 for the CP3, the weight index for the constructed affine merge candidate is set equal to the weight index for the CP0; A video decoding method, wherein when the constructed affine merge candidate is constructed based on the CPMV1 for the CP1, the CPMV2 for the CP2, and the CPMV3 for the CP3, the weight index for the constructed affine merge candidate is set equal to the weight index for the CP1.

2. A video encoding method performed by an encoding device, comprising: determining an inter prediction mode of a current block and generating inter prediction mode information indicating the inter prediction mode; generating a merge candidate list for the current block based on the inter prediction mode; generating selection information indicative of one of the candidates included in the merge candidate list; encoding image information including the inter prediction mode information and the selection information; the candidates include constructed affine merge candidates; The constructed affine merge candidate includes three control point motion vectors (CPMVs), a weight index for the constructed affine merge candidate indicating one of five weights; If the constructed affine merge candidate is constructed based on a CPMV0 for a control point 0 (CP0), a CPMV1 for a control point 1 (CP1), and a CPMV2 for a control point 2 (CP2), the weight index for the constructed affine merge candidate is set equal to the weight index for the CP0; The CP0 corresponds to the upper left corner of the current block; The CP1 is associated with the top right corner of the current block; CP2 is associated with the lower left corner of the current block; where the constructed affine merge candidate is constructed based on CPMV0 for CP0, CPMV1 for CP1, and CPMV3 for Control Point 3 (CP3), the weight index for the constructed affine merge candidate is set equal to the weight index for CP0; CP3 is associated with the lower right corner of the current block; where the constructed affine merge candidate is constructed based on the CPMV0 for the CP0, the CPMV2 for the CP2, and the CPMV3 for the CP3, the weight index for the constructed affine merge candidate is set equal to the weight index for the CP0; A video encoding method, wherein the weight index for the constructed affine merge candidate is set equal to the weight index for the CP1 when the constructed affine merge candidate is constructed based on the CPMV1 for the CP1, the CPMV2 for the CP2, and the CPMV3 for the CP3.

3. A method for transmitting data for video, comprising the steps of: obtaining a bitstream for the video, the bitstream comprising: determining an inter prediction mode of a current block and generating inter prediction mode information indicating the inter prediction mode; generating a merge candidate list for the current block based on the inter prediction mode; generating selection information indicative of one of the candidates included in the merge candidate list; encoding image information including the inter prediction mode information and the selection information; and transmitting the data including the bitstream; the candidates include constructed affine merge candidates; The constructed affine merge candidate includes three control point motion vectors (CPMVs), a weight index for the constructed affine merge candidate indicating one of five weights; If the constructed affine merge candidate is constructed based on a CPMV0 for a control point 0 (CP0), a CPMV1 for a control point 1 (CP1), and a CPMV2 for a control point 2 (CP2), the weight index for the constructed affine merge candidate is set equal to the weight index for the CP0; The CP0 corresponds to the upper left corner of the current block; The CP1 is associated with the top right corner of the current block; CP2 is associated with the lower left corner of the current block; where the constructed affine merge candidate is constructed based on CPMV0 for CP0, CPMV1 for CP1, and CPMV3 for Control Point 3 (CP3), the weight index for the constructed affine merge candidate is set equal to the weight index for CP0; CP3 is associated with the lower right corner of the current block; where the constructed affine merge candidate is constructed based on the CPMV0 for the CP0, the CPMV2 for the CP2, and the CPMV3 for the CP3, the weight index for the constructed affine merge candidate is set equal to the weight index for the CP0; A transmission method, wherein the weight index for the constructed affine merge candidate is set equal to the weight index for the CP1 based on the case where the constructed affine merge candidate is constructed based on the CPMV1 for the CP1, the CPMV2 for the CP2, and the CPMV3 for the CP3.

Citation Information

Patent Citations

  • Motion vector generation for affine motion model for video coding

    US20180192069A1

  • Method and apparatus for video coding

    WO2020185555A1

  • Sub-block based intra block copy

    WO2020244658A1