Video decoding method and device for deriving weight index information for generation of prediction sample
The video decoding method improves compression efficiency by generating a merge candidate list and using weight index information for affine merge candidates, addressing challenges in high-resolution and immersive media encoding.
Patent Information
- Application Number
- JP2025134969
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-06-14
- Filing Date
- 2025-08-14
- Publication Date
- 2025-11-05
- Estimated Expiration
- 2040-06-10
AI Technical Summary
The increasing demand for high-resolution and immersive media has led to challenges in efficiently compressing and transmitting video data, particularly in deriving weight index information for generating prediction samples during inter prediction and bi-prediction.
A video decoding method that generates a merge candidate list based on inter prediction mode information, derives motion information, and uses weight index information for affine merge candidates, including Control Point Motion Vectors (CPMVs) to improve video coding efficiency.
This method enhances the overall image/video compression efficiency and enables efficient construction of motion vector candidates during inter prediction and weighted value-based bi-prediction.
Smart Images

Figure 2025166162000001_ABST
Abstract
Description
[Technical Field]
[0001] The present technology relates to a video decoding method and apparatus for deriving weight index information for generating prediction samples. [Background technology]
[0002] In recent years, demand for high-resolution, high-quality images / videos, such as 4K or 8K or higher UHD (Ultra High Definition) images / videos, has been increasing in various fields. As the resolution and quality of image / video data increases, the amount of information or bits to be transmitted increases relatively compared to existing image / video data. Therefore, when transmitting image data using existing media such as wired or wireless broadband lines or storing image / video data using existing storage media, transmission costs and storage costs increase.
[0003] In addition, interest in and demand for immersive media such as VR (Virtual Reality), AR (Artificial Reality) content, and holograms have been increasing in recent years, and the broadcast of images / videos with 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 that has 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] 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 executed by a decoding device, the method including: receiving 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 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; and 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 Control Point Motion Vectors (CPMVs), and the affine merge candidates being associated with a Control Point Motion Vector (CP0) located at an upper left side of the current block. If the affine merge candidate includes a CPMV0 for CP0 (Control Point 0), the weight index information for the affine merge candidate is derived based on the 0th weight index information for the CP0. If the affine merge candidate does not include a CPMV0 for CP0 located in the upper left corner of the current block, the 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 corner 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: 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 video information including the inter prediction mode information and the selection information, wherein the candidates include affine merge candidates, the affine merge candidates including Control Point Motion Vectors (CPMVs), and if the affine merge candidate includes a CPMV0 for 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 0th weighted value index information for CP0; and if the affine merge candidate does not include a CPMV0 for Control Point 0 (CP0) located at the upper left side of the current block, weighted value index information for the affine merge candidate is indicated based on 1st weighted value index information for Control Point 1 (CP1) located at an upper right side of the current block.
[0010] According to another embodiment of the present document, there is provided a computer-readable digital storage medium storing a bitstream containing 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 the bitstream; generating a merge candidate list for a current block based on the inter prediction mode information; selecting one candidate from the merge candidate list; deriving motion information for 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; and 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), and the affine merge candidate being located at a Control Point Motion Vector (CP0) located at an upper left side of the current block. If the affine merge candidate includes a CPMV0 for CP0 (Control Point 0), the weight index information for the affine merge candidate is derived based on the 0th weight index information for the CP0. If the affine merge candidate does not include a CPMV0 for CP0 located in the upper left corner of the current block, the 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 corner of the current block. [Effects of the Invention]
[0011] According to this document, it is possible to improve the overall image / video compression efficiency.
[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 explanation of the drawings]
[0014] [Figure 1] 1 illustrates schematically an example of a video / image coding system to which embodiments of the present document may be applied. [Figure 2] 1 is a diagram illustrating a schematic configuration of a video / image encoding device to which embodiments of the present document can be applied; [Figure 3] 1 is a diagram illustrating the configuration of a video / image decoding device to which the embodiments of the present document can be applied; [Figure 4] 1 illustrates an exemplary procedure for inter prediction. [Figure 5] 10 is a diagram illustrating a merge mode in inter prediction. [Figure 6] 10 illustrates an exemplary motion represented 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] 10 is a diagram illustrating an affine merge mode in inter prediction. [Figure 10] 10 is a diagram illustrating the positions of candidates in an affine merge mode. [Figure 11] 10 is a diagram for explaining SbTMVP in inter prediction. [Figure 12] 1 illustrates an example of a video / image encoding method and associated components according to embodiments of the present document. [Figure 13] 1 illustrates an example of a 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 embodiments 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 embodiments 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 INVENTION
[0015] The present disclosure may be modified in various ways and may have various embodiments. Specific embodiments will be illustrated in the drawings and described in detail. However, this is not intended to limit the disclosure to the specific embodiments. Common terms used in this document are used merely to describe specific embodiments and are not intended to limit the technical ideas of the present disclosure. The singular expressions include the plural expressions unless the context clearly dictates otherwise. In this specification, the terms "comprise" 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 component in the drawings described in this disclosure is illustrated independently for the convenience of explaining different characteristic functions, and does not mean that each component is realized by separate hardware or software. For example, two or more components may be combined to form a single component, or a single component may be divided into multiple components. Embodiments in which each component is integrated and / or separated are also within the scope of the present disclosure as long as they do 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] As used herein, "at least one of A and B" can mean "A only," "B only," or "both A and B." Furthermore, as used herein, the expressions "at least one of A or B" and "at least one of A and / or B" can be interpreted in the same way as "at least one of A and B."
[0020] Furthermore, 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" or "at least one of A, B, and / or C" can mean "at least one of A, B, and C."
[0021] Furthermore, parentheses used herein may mean "for example." Specifically, when "prediction (intra prediction)" is used, "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 used, "intra prediction" is proposed as an example of "prediction."
[0022] Technical features individually described 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 will be used to refer to the same components in the drawings, and redundant descriptions of the same components may be omitted.
[0024] FIG. 1 illustrates schematically an example of a video / image coding system to which the present disclosure may be applied.
[0025] As shown in Figure 1, a 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 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 transmitting 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 include a display unit, which may be a separate device or an external component.
[0027] A video source can acquire video / images through a video / image capture, synthesis, or generation process. A video source can include a video / image capture device and / or a video / image generation device. A video / image capture device can include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device can include, for example, a computer, a tablet, a smartphone, etc., and can (electronically) generate video / images. For example, a virtual video / image can be generated via a computer, etc., in which case the video / image capture process can be replaced with a process in which related data is generated.
[0028] An encoding device can encode input video / images. The encoding device can perform a series of steps such as prediction, transformation, and quantization for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.
[0029] The transmitter can transmit the encoded video / image information or data output in the form of a bitstream to a receiver in the 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 transmitter can include elements for generating a media file in a predetermined file format and elements for transmission via a broadcast / communication network. The receiver 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 transform, prediction, etc., which correspond to the operations of the encoding device.
[0031] The renderer can render the decoded video / image, and the rendered video / image can be displayed via the 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 second generation audio video coding standard (AVS2), or the next generation video / image coding standard (e.g., H.267 or H.268).
[0033] This document presents various embodiments relating to video / image coding, which, unless otherwise stated, may also be implemented in combination with one another.
[0034] In this document, video can refer to a collection of a series of images over time. A picture generally refers to a unit that shows one image at a specific time, and a slice / tile is a unit that constitutes part of a picture in coding. A slice / tile can include one or more coding tree units (CTUs). One picture can consist 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 width specified by syntax elements in the picture parameter set and a height equal to the height of the picture.A tile scan may represent a specific sequential ordering of CTUs partitioning a picture, where the CTUs are ordered consecutively in a 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 may include multiple complete tiles or multiple consecutive CTU rows in one tile of a picture, which may be included in one NAL unit. In this document, the terms tile group and slice may be used interchangeably. For example, in this document, tile group / tile group header may be referred to as slice / slice header.
[0036] On the other hand, a picture can be divided into two or more sub-pictures, each of which 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 constituting a picture (or an image). A "sample" may also be used as a term corresponding to a pixel. A sample may generally refer to a pixel or a pixel value, or 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, when such a pixel value is transformed into the frequency domain, may refer to a transform coefficient in the frequency domain.
[0038] A unit may refer to a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to that region. One unit may include one luma block and two chroma (e.g., cb, cr) blocks. The term unit may be used interchangeably with terms such as block or area. In general, an M×N block may include samples (or a sample array) consisting of M columns and N rows, or a set (or an array) of transform coefficients.
[0039] 2 is a diagram illustrating the configuration of a video / image encoding device to which the present disclosure can be applied. Hereinafter, the term "video encoding device" may include an image encoding device.
[0040] As shown in FIG. 2, the encoding device 200 may 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 predictor 221 and an intra predictor 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 dividing unit 210, the predicting unit 220, the residual processing unit 230, the entropy encoding unit 240, the adding unit 250, and the filtering unit 260 may be configured by one or more hardware components (e.g., an encoder chipset or a processor) depending on the embodiment. Also, the memory 270 may include a decoded picture buffer (DPB) or 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. For 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) using a quad-tree, binary-tree, ternary-tree (QTBTTT) structure. For example, one coding unit may be divided into multiple coding units of deeper depths 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 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 largest 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 needed, 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) or a transform unit (TU). In this case, the prediction unit and the transform unit may each be divided or partitioned from the final coding unit.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 term "unit" may be used interchangeably with terms such as "block" or "area." In general, an MxN block can refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample generally refers to a pixel or pixel value, and can refer to only a pixel / pixel value of a luma component or only a pixel / pixel value of a chroma component. A sample can also be used as a term corresponding to one pixel or pel of a picture (or image).
[0043] The encoding apparatus 200 may subtract 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) to generate a residual signal (residual block, residual sample array), and the generated residual signal is transmitted to the conversion unit 232. In this case, as shown in the figure, a unit in the encoding apparatus 200 that subtracts a prediction signal (predicted block, prediction sample array) from an input image signal (original block, original sample array) may be referred to as a subtraction unit 231. The prediction unit may perform prediction on a current block to be processed (hereinafter, referred to as 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 on a current block or CU basis. 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 far away, depending on the prediction mode. In intra prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, DC mode and planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the granularity of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the settings. The intra prediction unit 222 may also determine the prediction mode to be applied to the current block using the prediction modes applied to 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. To reduce the amount of motion information transmitted in inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation 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 information on the inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (col CU), etc., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter predictor 221 may construct a motion information candidate list based on neighboring blocks and generate information indicating which candidate is used to derive a motion vector and / or a reference picture index for the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of a skip mode or a merge mode, the inter predictor 221 may use motion information of neighboring blocks as motion information for 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 predictor 220 may generate a prediction signal based on various prediction methods, which will be described later. For example, the predictor may not only apply intra prediction or inter prediction for prediction of a block, but also simultaneously apply intra prediction and inter prediction. This may be referred to as combined inter and intra prediction (CIIP). The predictor may also use intra block copy (IBC) prediction mode or 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, such as screen content coding (SCC). IBC basically performs prediction within a current picture, but may be similar to inter prediction in that it derives a reference block within the current picture. That is, IBC may utilize at least one of the inter prediction techniques described herein. Palette mode may be considered an example of intra coding or intra prediction. When palette mode is applied, sample values within a picture may be signaled based on information related to 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 reconstructed signal or 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, GBT refers to a transform obtained from a graph representing inter-pixel relationship information. 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 rectangular size, or may be applied to non-rectangular blocks of variable size.
[0048] The quantizer 233 quantizes the transform coefficients and transmits the quantized signal to the entropy encoder 240. The entropy encoder 240 encodes the quantized signal (information about the quantized transform coefficients) and outputs it as a bitstream. The information about 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 about 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. In addition to the quantized transform coefficients, the entropy encoder 240 may encode information required for video / image restoration (e.g., values of syntax elements) 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 also 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-described encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or stored in a digital storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A 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 quantization unit 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantization unit 234 and the inverse transform unit 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 skip mode is applied, a predicted block may be used as the 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, or may be used for inter prediction of the next picture after filtering, as described below.
[0050] Meanwhile, luma mapping with chrominance scaling (LMCS) can be applied during picture encoding and / or reconstruction.
[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 to be used as a reference picture in the inter predictor 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 predictor 221 to be used as motion information of a spatially neighboring block or a temporally neighboring block. The memory 270 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 222.
[0054] Meanwhile, in this document, at least one of quantization / dequantization and / or transform / inverse transform may be omitted. When the quantization / dequantization is omitted, the quantized transform coefficients may be referred to as transform coefficients. When 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 the sake of uniformity of expression.
[0055] Furthermore, in this document, quantized transform coefficients and transform coefficients may be referred to as transform coefficients and scaled transform coefficients, respectively. In this case, residual information may include information about the transform coefficient(s), and the information about the transform coefficient(s) may be signaled via residual coding syntax. Transform coefficients may be derived based on the residual information (or information about the transform coefficient(s)), and scaled transform coefficients may be derived through an inverse transform (scaling) of the transform coefficient(s). Residual samples may be derived based on an inverse transform (transform) of the scaled transform coefficient(s). This may be similarly applied / expressed in other parts of this document.
[0056] FIG. 3 is a diagram illustrating the 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 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 a single hardware component (e.g., a decoder chipset or processor) according to an embodiment. The memory 360 may include a decoded picture buffer (DPB) or may be configured as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.
[0058] When a bitstream including video / image information is input, the decoding device 300 can reconstruct an image corresponding to the process in which the video / image information was processed by the encoding device of FIG. 2. For example, the decoding device 300 can derive units / blocks based on block division-related information obtained from the bitstream. The decoding device 300 can perform decoding using a processing unit applied by the encoding device. Therefore, 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 maximal 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. The reconstructed image signal decoded and output by the decoding device 300 can be reproduced by a playback 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 parse the bitstream to derive information (e.g., video / image information) necessary for image restoration (or picture restoration). The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / image information may also include general constraint information. The decoding device may further decode pictures based on the information on the parameter sets and / or the general constraint information. Signaling / received information and / or syntax elements, which will be 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 receives bins corresponding to each syntax element in the bitstream, determines a context model using information about the syntax element to be decoded and decoded information about neighboring and current blocks, or information about symbols / bins decoded in previous steps, predicts the occurrence probability of the bins based on the determined context model, and performs arithmetic decoding of the bins to generate symbols corresponding to the values of each syntax element. After determining the context model, the CABAC entropy decoding method may update the context model using information about the decoded symbol / bin for the context model of the next symbol / bin.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 a residual processing unit 320. The residual processing unit 320 may derive a residual signal (residual block, residual sample, residual sample array). In addition, among the information decoded by the entropy decoding unit 310, information related to filtering may be provided to a filtering unit 350. Meanwhile, a receiving unit (not shown) that receives 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 and output the transform coefficients. The inverse quantization unit 321 may rearrange the quantized transform coefficients in a two-dimensional block format. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the encoding device. The inverse quantization unit 321 may inverse quantize the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) to obtain transform coefficients.
[0061] The inverse transform unit 322 performs inverse transform on 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 about the prediction output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.
[0063] The predictor 330 may generate a prediction signal based on various prediction methods, which will be described later. For example, the predictor may apply intra prediction or inter prediction for predicting a block, or may simultaneously apply intra prediction and inter prediction. This may be referred to as combined inter and intra prediction (CIIP). The predictor may also use an intra block copy (IBC) prediction mode or a palette mode for predicting a block. The IBC prediction mode or palette mode may be used for content image / video coding, such as games, such as screen content coding (SCC). IBC basically performs prediction within a current picture, but may be similar to inter prediction in that a reference block is derived within the current picture. That is, IBC may use at least one of the inter prediction techniques described herein. The palette mode may be considered 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 far away from the current block depending on the prediction mode. In intra prediction, prediction modes 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 using prediction modes applied to neighboring blocks.
[0065] The inter prediction unit 332 may derive a predicted block for a current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. To reduce the amount of motion information transmitted in inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation 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 information on the inter prediction direction (e.g., L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 332 may construct a motion information candidate list based on the neighboring blocks and derive a motion vector and / or a reference picture index for the current block based on received candidate selection information. Inter prediction may be performed based on various prediction modes, and the prediction information may include information indicating the inter prediction mode 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 predicted 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 the current block, such as when a skip mode is applied, the predicted block may be used as the 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 the 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 can be used as a reference picture in the inter predictor 332. The memory 360 can store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information can be transmitted to the inter predictor 332 to be used as motion information of a spatially neighboring block or a temporally neighboring block. The memory 360 can store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra predictor 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 during video coding. Accordingly, 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 the spatial domain (or pixel domain). The predicted block is derived in the same way by an encoding device and a decoding device. The encoding device can improve image coding efficiency by signaling to a decoding device information (residual information) regarding the residual between the original block and the predicted block, rather than the original sample values of the original block themselves. The decoding device can derive a residual block including residual samples based on the residual information, add the residual block and the predicted block to generate a reconstructed block including reconstructed samples, and generate a reconstructed picture including the reconstructed block.
[0073] The residual information may be generated through a transform and quantization procedure. For example, an encoding device may derive a residual block between the original block and the predicted block, perform a transform procedure on 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 (via a bitstream) to a decoding device. 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 device may derive residual samples (or residual blocks) by performing an inverse quantization / inverse transform procedure based on the residual information. The decoding device may generate a reconstructed picture based on the predicted block and the residual block. The encoding device may also 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 example of the inter prediction procedure.
[0075] 4, the inter prediction procedure may include an inter prediction mode determination step, a motion information deriving step according to the determined prediction mode, and a prediction (generation of prediction samples) step 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, a coding device may include an encoding device and / or a decoding device.
[0076] Referring to FIG. 4, a coding apparatus determines an inter prediction mode for a current block (S400). Various inter prediction modes can be used to predict a current block in a picture. For example, merge mode, skip mode, motion vector prediction (MVP) mode, affine mode, sub-block merge mode, merge with MVD (MMVD) mode, etc. can be used. Decoder side motion vector refinement (DMVR) mode, adaptive motion vector resolution (AMVR) mode, bi-prediction with CU-level weight (BCW), bi-directional optical flow (BDOF), etc. can be used in addition to or instead of the auxiliary modes. Affine mode may also be referred to as affine motion prediction mode. MVP mode may also be referred to as advanced motion vector prediction mode. In this document, some modes and / or motion information candidates derived by some modes may be included among motion information candidates 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 the 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 multiple 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 a skip mode is applied, and if the skip mode is not applied, a merge flag may be signaled to indicate whether a merge mode is applied, and if the merge mode is not applied, an MVP mode may be applied, or a flag for additional distinction may be further signaled. The affine mode may be signaled as an independent mode or as 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] A coding apparatus may perform inter-prediction using motion information of a current block. An encoding apparatus may derive optimal motion information for a current block through a motion estimation procedure. For example, the encoding apparatus may use an original block in an original picture for the current block to search for a highly correlated similar reference block in a fractional pixel unit within a predetermined search range in the reference picture, thereby deriving motion information. Block similarity may be derived based on a phase-based sample value difference. For example, block similarity may be calculated based on the SAD between the current block (or a template of the current block) and a reference block (or a template of the reference block). In this case, motion information may be derived based on the reference block with the smallest SAD within the search range. The derived motion information may be signaled to a decoding apparatus in various ways 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 the merge mode is applied, the motion information of the current prediction block is not directly transmitted, but is derived using the 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 the value of a regular_merge_flag syntax element is 1.
[0083] To perform the merge mode, the encoding device 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 (or others) of this document is not limited to this. The maximum number of merge candidate blocks may be transmitted in a slice header or a tile group header, but the embodiment (or others) of this document is not limited to this. After searching for the merge candidate blocks, the encoding device may generate a merge candidate list and select the merge candidate block with the smallest cost as the 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 below may be referred to as SMVPs, and the temporal merge candidates or temporal MVP candidates described below 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 spatially neighboring blocks of a current block and insert the derived spatial merge candidates into a merge candidate list. For example, the spatial neighboring blocks may include a neighboring block in the lower left corner, a neighboring block on the left side, a neighboring block in the upper right corner, an upper neighboring block, and a neighboring block in the upper left corner of the current block. However, this is merely an example, and additional neighboring blocks, such as a neighboring block on the right side, a neighboring block on the lower right side, and a neighboring block on the lower right side, may be used as the spatial neighboring blocks. The coding apparatus may search the spatial neighboring blocks based on priority to detect available blocks and derive motion information of the detected blocks as the spatial merge candidates. For example, the encoding apparatus or decoding apparatus may search the five blocks shown in FIG. 5 in the order A1->B1->B0->A0->B2, sequentially index available candidates, and construct a merge candidate list.
[0088] The coding apparatus may search for temporal neighboring blocks of the current block and insert the derived temporal merge candidates into the merge candidate list. The temporal neighboring blocks may be located in 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 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 in the col picture. Meanwhile, when motion data compression is applied, specific motion information may be stored as representative motion information for each predetermined storage unit in the col picture. In this case, it is not necessary to store motion information for all blocks within the predetermined storage unit, thereby achieving a motion data compression effect. 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 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 covers a position arithmetically shifted leftward by a fixed value based on the coordinates (upper left sample position) of the temporal neighboring block, rather than a predictive block located at the coordinates of the temporal neighboring block.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 bit stream. If all the numbers of the maximum merge candidates are filled, the subsequent candidate addition process cannot proceed.
[0090] If the check result indicates that the number of current merge candidates is less than the maximum number of merge candidates, the coding apparatus may insert additional merge candidates into the merge candidate list. For example, the additional merge candidates may include at least one of history-based merge candidate(s), pair-wise average merge candidate(s), ATMVP, combined bi-predictive merge candidate (when the slice / tile group type of the current slice / tile group is type B), and / or zero vector merge candidate (described below).
[0091] If the check result indicates that the number of current merge candidates is not less than the maximum number of merge candidates, the coding device may terminate construction of the merge candidate list. In this case, the encoding device may select an optimal merge candidate from among the merge candidates constituting the merge candidate list based on rate-distortion (RD) cost and signal selection information (e.g., merge index) indicating the selected merge candidate to the decoding device. The decoding device 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 can be used as the motion information of the current block, and the predicted sample of the current block can be derived based on the motion information of the current block. The encoding device can derive a residual sample of the current block based on the predicted sample and signal residual information about the residual sample to a decoding device. The decoding device can generate reconstructed samples based on the residual samples derived based on the residual information and the predicted sample, and generate a reconstructed picture based on the reconstructed samples.
[0093] When the 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 current block is omitted, and therefore, the predicted samples can be directly used 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 or a pairwise candidate. A pair-wise average candidate (or the like) may be generated by averaging pairs of predefined candidates in an existing merge candidate list. 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 remain in an inactive state.
[0095] For example, if the merge candidate list is not full even after adding the pairwise average merge candidate, 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. That is, zero vectors can be inserted until the number of current merge candidates in the merge candidate list reaches the maximum number of merge candidates.
[0096] Meanwhile, previously, 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 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 types of motion, as described below.
[0097] FIG. 6 shows an example of motion represented via an affine motion model.
[0098] 6, motions that can be represented using the affine motion model include translation motion, scale motion, rotation motion, and shear motion. That is, not only the translation motion in which (a part of) an image moves on a plane over time as shown in FIG. 6, but also the scale motion in which (a part of) an image is scaled over time, the rotation motion in which (a part of) an image is rotated over time, and the shear motion in which (a part of) an image is transformed into a parallelogram over time can be efficiently represented 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 a 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, which reduces the burden of data volume for added additional information and significantly improves the efficiency of inter-prediction.
[0100] An affine motion model that expresses three of the possible motions (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 illustrate 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, Figure 7a shows 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) can be determined as shown in Equation 1.
[0105]
number
[0106] For example, Figure 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 indicate a motion vector at the (x,y) position. 0x ,v 0y} can 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 bottom left corner, W may indicate the width of the current block, and H may indicate the height of the current block.
[0109] FIG. 8 exemplarily shows a case where the affine MVF is determined in units of sub-blocks.
[0110] During the encoding / decoding process, the affine MVF can be determined in sample units or in units of predefined sub-blocks. For example, when determined in sample units, a motion vector is obtained based on each sample value. Alternatively, when determined in sub-block units, the motion vector of the corresponding block is obtained based on the sample value at the center of the sub-block (the lower right side of the center, i.e., the lower right sample of the four central 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 affine merge mode, CPMV can be determined by the affine motion model of neighboring blocks coded using affine motion prediction. For example, neighboring blocks coded using affine motion prediction in the search order can be used for the affine merge mode. That is, if at least one of the neighboring blocks is coded using affine motion prediction, the current block can be coded using the affine merge mode. Here, the affine merge mode can 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 a neighboring block. In this case, the CPMV of the neighboring block may be used as the CPMV of the current block as is, or the CPMV of the neighboring block may be modified based on the size of the neighboring block and the size of the current block, and then used as the CPMV of the current block.
[0117] Meanwhile, an affine merge mode in which a motion vector (MV) is derived on a sub-block basis may be referred to as a sub-block merge mode, which may be indicated based on a sub-block merge flag (or a merge_subblock_flag syntax element). Alternatively, a value of 1 in the merge_subblock_flag syntax element may indicate that the sub-block merge mode is applied. In this case, an affine merge candidate list (described later) may also be referred to as a sub-block merge candidate list. In this case, the sub-block 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 the candidate with the 0th index in the sub-block merge candidate list. In other words, the candidate derived by SbTMVP may be positioned before an inherited affine candidate or a constructed affine candidate (described later) in the sub-block merge candidate list.
[0118] When an affine merge mode is applied, an affine merge candidate list may be constructed for CPMV derivation for the 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. 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. 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 can be up to two inherited affine candidates, and the inherited affine candidates can be derived from the affine motion models of the surrounding blocks. The surrounding blocks can include one left surrounding block and one above surrounding block. The candidate blocks can be positioned as shown in FIG. 4. The scan order for the left predictor can be A1→A0, and the scan order for the above predictor can be B1→B0→B2. Only one inherited candidate can be selected from each of the left and above. There can be no pruning check between two inherited candidates.
[0121] If a surrounding 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 surrounding affine block may refer to a block coded in affine prediction mode among the neighboring blocks of the current block. For example, referring to FIG. 8, if the bottom-left neighboring block A is coded in affine prediction mode, motion vectors v2, v3, and v4 of the top-left, top-right, and bottom-left corners of the neighboring block A can be obtained. If the neighboring block A is coded using a 4-parameter affine motion model, two CPMVs of the current block can be calculated using v2 and v3. If the neighboring block A is coded using a 6-parameter affine motion model, three CPMVs of the current block can be calculated using 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 form a 6-parameter affine merge candidate, and a combination of two CPMVs can form 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 indices of the control points are different from each other.
[0127] FIG. 11 is a diagram for explaining SbTMVP in inter prediction.
[0128] On the other hand, a subblock-based temporal motion vector prediction (SbTMVP) method can also be used. For example, SbTMVP can be called advanced temporal motion vector prediction (ATMVP). SbTMVP can use motion fields in a collocated picture to improve motion vector prediction and merge mode for CUs in the current picture. Here, the collocated picture can also be called a col picture.
[0129] For example, SbTMVP can predict motion at the 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) within the current block (or CU) through two steps.
[0131] In the first step, the spatial neighboring blocks may be examined in the order of A1, B1, B0, and A0 in FIG. 4. The first spatial neighboring block having a motion vector using the col picture as its reference picture may be identified, and the motion vector may be selected with an applied motion shift. If no such motion is identified from the spatial neighboring blocks, the motion shift may be set to (0,0).
[0132] In the second step, the motion shift identified in the first step can be applied to obtain sub-block level motion information (motion vectors and reference indices) 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 the 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 five.
[0134] The size of the sub-CUs (or sub-blocks) used in SbTMVP can be fixed at 8x8, and like the affine merge mode, SbTMVP mode can only be applied to blocks whose width and height are both 8 or greater. The encoding logic for additional SbTMVP merge candidates can be the same as for other merge candidates. That is, for each CU in a P or B slice, an RD (rate-distortion) check using an additional RD cost can be performed to determine whether to use an SbTMVP candidate.
[0135] Meanwhile, a predicted block for the current block can be derived based on motion information derived according to the prediction mode. The predicted block can include prediction samples (prediction sample array) of the current block. If the motion vector of the current block points to a fractional sample unit, an interpolation procedure can be performed, through which prediction samples of the current block can be derived based on reference samples in fractional samples within a reference picture. If affine inter-prediction (affine prediction mode) is applied to the current block, prediction samples can be generated based on sample / sub-block-based MVs. If bi-prediction is applied, prediction samples derived through a weighted sum or weighted average (by phase) of prediction samples derived based on L0 prediction (i.e., prediction using a reference picture in reference picture list L0 and MVL0) and prediction samples derived based on L1 prediction (i.e., prediction using a reference picture in reference picture list L1 and MVL1) can be used as prediction samples for 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 the reference picture used for L0 prediction and the reference picture used for L1 prediction are located in different temporal directions relative to the current picture (i.e., if the bi-prediction corresponds to bidirectional prediction), this may be referred to as true bi-prediction.
[0136] 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 predicted 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 averaging an L0 predicted sample based on an L0 reference picture and MVL0 and an L1 predicted sample based on an L1 reference picture and MVL1. However, 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, w may represent a weighting value, 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, in weighted average bi-prediction, five weights may be allowed. For example, the five weights (w) may include -2, 3, 4, 5, or 10. That is, the weight (w) may be determined as 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 by one of two methods. In the first method, a weight index for a non-merged CU may be signaled after a motion vector difference. In the second method, a weight index for a merged CU may be inferred from neighboring blocks 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 a 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 the inter prediction mode), if the current picture is a low-latency picture, unequal 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 the inter prediction mode), if affine prediction mode is currently selected as the best mode, affine motion estimation (ME) can be performed for unequal weights. For example, if two reference pictures in bi-prediction are identical, unequal weights can be conditionally checked. For example, if certain conditions are met depending on the POC distance between the current picture and the reference picture, the coding QP (quantization parameter), and the temporal level, non-identical weight values may not be searched.
[0144] For example, a BCW weight index (or weight index) may be coded using one context-coded bin and subsequent bypass-coded bins. The first context-coded bin may indicate whether the same weight is 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 to be used.
[0145] On the other hand, when bi-prediction is applied, weight information used to generate a predicted sample can be derived based on weight index information for a selected candidate from among the candidates included in the merge candidate list.
[0146] According to one embodiment of this document, when constructing motion vector candidates for a merge mode, weight index information for temporal motion vector candidates can be derived as follows. For example, when temporal motion vector candidates use bi-prediction, weight index information for weighted averaging can be derived. That is, when the inter prediction type is bi-prediction, weight index information for temporal merge candidates (or temporal motion vector candidates) in the merge candidate list can 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 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 the procedure for deriving a motion vector of a luma component for the merge mode (Table 3 of 8.4.2.2), gbiIdxCol may be derived to 0. That is, the 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, the collocated block may be referred to as a col block, a co-located block, or a co-located reference block, and the col block may represent a block at the same position as the current block on the reference picture. For example, a procedure for deriving a motion vector of a luma component for 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 the procedure for deriving a motion vector of a luma component for the merge mode, if the slice type or tile group type is B (Table of Contents 4 of 8.4.2.2), gbiIdxCol may be derived from gbiIdxCol. That is, the weight index of a temporal motion vector candidate may be derived from the weight index of a col block.
[0161] Meanwhile, according to another embodiment of the present document, when constructing a motion vector candidate for a sub-block-based merge mode, a weight index for weighted averaging of temporal motion vector candidates can be derived. Here, the sub-block-based merge mode can be referred to as a (sub-block-based) affine merge mode. 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. That is, when the inter prediction type is bi-prediction, weight index information can be derived for an SbTMVP candidate (or a sub-block-based temporal motion vector candidate) in an affine merge candidate list or a sub-block 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., the L0 prediction direction and the L1 prediction direction in bi-prediction) are the same. For example, a procedure for deriving motion vectors and reference indices in a sub-block merge mode and a procedure for deriving sub-block-based temporal merge 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) for 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 of the four central sub-blocks or samples of the col block. For example, in this case, procedures for deriving motion vectors and reference indexes in the sub-block merge mode, procedures for deriving sub-block-based temporal merge candidates, and procedures for deriving base motion information for sub-block-based temporal merge 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 the procedure (8.4.4.4) for deriving base motion information for sub-block-based temporal merging, gbiIdxSbCol may be derived from gbiIdxcolCb. That is, the weight index of a sub-block-based temporal motion vector candidate may be derived from the 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, specifically, the sub-block or sample located at the bottom right of the four central sub-blocks or samples of the col block.
[0191] Alternatively, weight index information for weighted averaging of sub-block-based temporal motion vector candidates may be derived based on weight index information for each sub-block, or if a sub-block is unavailable, 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 bottom right of the four central sub-blocks or samples of the col block. For example, in this case, procedures for deriving motion vectors and reference indexes in the sub-block merge mode, procedures for deriving sub-block-based temporal merge candidates, and procedures for deriving base motion information for sub-block-based temporal merge may be as shown in Tables 8, 9, and 10.
[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) for deriving base motion information for sub-block-based temporal merge, gbiIdxSbCol may be derived from gbiIdxcolCb. Alternatively, in the 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 can be derived from ctrgbiIdx, and in the procedure (8.4.4.4) of deriving base motion information for sub-block-based temporal merging, the ctrgbiIdx can be derived from gbiIdxSbCol. That is, the weight index of a sub-block-based temporal motion vector candidate can be derived from a weight index for each sub-block, or, if a sub-block is unavailable, 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 bottom right of the four central sub-blocks or samples of the col block.
[0210] Meanwhile, according to another embodiment of the present document, when constructing motion vector candidates 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 the inter-prediction type is bi-prediction, weight index information for the pair-wise candidates in the merge candidate list may be derived.
[0211] The pairwise candidate may be derived based on two other merge candidates (eg, cand0 and cand1) among the candidates included in the merge candidate list.
[0212] For example, the weight index information for the pairwise candidate may be derived based on weight index information for 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 for the candidate using bi-prediction among the two merge candidates.
[0213] Alternatively, if the weight index information of each of the other two merge 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 merge 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 merge 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 merge candidates is not the same as each other, the weight index information for the pairwise candidate may be derived based on weight index information of each of the other two candidates that is not 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.
[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 of temporal motion vector candidates can be derived. Here, the sub-block-based merge mode can be referred to as a (sub-block-based) affine merge mode. 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 the weight index information of a left-side neighboring block of the current block. That is, when a candidate derived in SbTMVP uses bi-prediction, the weight index of the left-side neighboring block of the current block can be derived using the weight index for the sub-block-based merge mode.
[0216] For example, since an SbTMVP candidate can derive a col block based on a spatially adjacent left block (or left peripheral block) of the current block, the weight index of the left peripheral block can be considered 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 motion vector candidates for an affine merge mode, if the affine merge candidates use 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 affine merge candidates, a constructed affine merge candidate may represent a candidate for deriving MVF using 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, CP2 may represent a control point located at the lower left sample position of the current block, and 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 combinations of the control points 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 one embodiment, when the affine merge candidates include a CPMV0 for a control point 0 (CP0) located at the upper left of the current block, 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 to derive 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 below the neighboring block at the upper left corner, and an upper neighboring block adjacent to the right of the neighboring block at the upper left corner.
[0221] On the other hand, if the affine merge candidates do not include CPMV0 for CP0 located in the upper left corner of the current block, weight index information for the affine merge candidate may be derived based on first weight index information for CP1 (Control Point 1) located in the upper right corner of the current block. The first weight index information may correspond to weight index information of blocks used to derive CPMV1 among the neighboring blocks of CP1. In this case, the neighboring blocks of CP1 may include neighboring blocks in the upper right corner of the current block and neighboring blocks above and adjacent to the left of the neighboring blocks in the upper right corner.
[0222] According to the above method, the weight index information for the affine merge candidates can be derived based on the weight index information of the blocks used to derive 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, if weight index information for CP0 located at the upper left of the current block and weight index information for CP1 located at the upper right of the current block are identical, weight index information for the affine merge candidate may be derived based on zeroth weight index information for CP0. The zeroth weight index information may correspond to weight index information of a block used to derive the CPMV0 among neighboring blocks of CP0. On the other hand, if weight index information for CP0 located at the upper left of the current block and weight index information for CP1 located at the upper right of the current block are not identical, 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 the L0 prediction sample and the L1 prediction sample.
[0224] According to 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 most frequently among the weight indexes of the candidates. For example, the weight index of the affine merge candidate may be derived using the most overlapping weight index of the candidate block determined to have a motion vector in CP0 among the CP0 candidate blocks, the weight index of the candidate block determined to have a motion vector in CP1 among the CP1 candidate blocks, the weight index of the candidate block determined to have a motion vector in CP2 among the CP2 candidate blocks, and / or the weight index of the candidate block 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 for an affine block (a block coded in affine prediction mode), the method for deriving a weight index for a temporal candidate block described in the above-mentioned embodiments may be used.
[0226] 12 and 13 illustrate an example of a video / image encoding method and associated components according to an embodiment of the present document.
[0227] The method disclosed in Figure 12 may be performed by the encoding apparatus disclosed in Figure 2 or Figure 13. Specifically, for example, S1200 to S1220 of Figure 12 may be performed by the prediction unit 220 of the encoding apparatus 200 of Figure 13, and S1230 of Figure 12 may be performed by the entropy encoding unit 240 of the encoding apparatus 200 of Figure 13. Also, although not shown in Figure 12, prediction samples or prediction-related information may be derived by the prediction unit 220 of the encoding apparatus 200 in Figure 12, residual information may be derived from original samples or prediction samples by the residual processing unit 230 of the encoding apparatus 200, and a bitstream may be generated from the residual information or prediction-related information by the entropy encoding unit 240 of the encoding apparatus 200. The method disclosed in Figure 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 the inter prediction mode to be applied to the current block, and 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 the determined inter prediction mode. Here, if 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, a sub-block merge candidate list, or the like, or 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 reaches 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 of neighboring blocks of a current block. For example, the neighboring blocks may include spatial and / or temporal neighboring blocks of the current block. The spatial neighboring blocks may be searched first to derive a candidate (spatial merge), and then the temporal neighboring blocks may be searched to derive a candidate (temporal merge), and the derived candidate may be inserted into the merge candidate list. For example, if the number of candidates in the merge candidate list is less than the maximum number of candidates even after inserting a candidate, an additional candidate may be inserted into the merge candidate list. 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 the 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 they may be located at at least some 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.
[0232] For example, candidates may be derived through a search of neighboring blocks of the current block (or neighboring blocks of the current block's CP). For example, the affine merge candidate list may include at least one of inherited affine merge candidates, constructed affine merge candidates, or zero motion vector candidates. For example, the affine merge candidate list may first insert the inherited affine merge candidates, and then insert the constructed affine merge candidates. Also, if the number of candidates in the affine merge candidate list is less than the maximum number of candidates after the constructed affine merge candidates have been inserted into the affine merge candidate list, the remaining candidates may be filled with zero motion vector candidates. Here, zero motion vector candidates may also be referred to as zero vectors. For example, the affine merge candidate list may be a list according to an affine merge mode in which motion vectors are derived on a sample-by-sample basis, or may be a list according to an affine merge mode in which motion vectors are derived on a sub-block-by-subblock basis. 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 by 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.
[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 some of spatial merge candidates, temporal merge candidates, pairwise candidates, or zero vector candidates, and one of these 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 some of inherited affine merge candidates, constructed affine merge candidates, SbTMVP candidates, or zero vector candidates, and one of these 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, and may also be referred to as merge index information or sub-block merge index information.
[0235] The encoding apparatus may also generate inter-prediction type information indicating the inter-prediction type of the current block as bi-prediction. For example, the inter-prediction type of the current block may be determined to be 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 prediction based on reference picture list 0 and reference picture list 1. 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 video information including inter-prediction mode information and selection information (S1230). For example, the video information may be referred to as video information. The video information may include various information according to the above-described embodiments of this document. For example, the video 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 video information including all or a portion of the above-described 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 for the current block. Alternatively, for example, the encoding apparatus may generate a prediction sample for 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 for the current block based on the motion information. For example, the encoding apparatus may generate an L0 prediction sample and an L1 prediction sample through bi-prediction and generate a prediction sample for the current block based on the L0 prediction sample and the L1 prediction sample. In this case, the prediction sample for 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 device 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 to predict the current block. For example, the L0 predicted samples may represent predicted samples of the current block derived based on reference picture list 0, and the L1 predicted samples may represent predicted samples of the current block derived based on 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 L1 motion information.
[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 L1 motion information.
[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 L1 motion information. For example, the pair-wise candidate may be derived based on two other candidates included in the merge candidate list.
[0242] Alternatively, for example, the merge candidate list may be a sub-block merge candidate list, and affine merge candidates, sub-block merge candidates, or SbTMVP candidates may be selected. Here, sub-block-based affine merge candidates may also be referred to as sub-block merge candidates.
[0243] For example, the candidates may include sub-block merging candidates. For example, if the selected candidate is the sub-block merging candidate, L0 motion information and L1 motion information may be derived based on the sub-block merging candidate, and the L0 prediction sample and the L1 prediction sample may be generated based on the L0 motion information and the L1 motion information. For example, the sub-block 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 sub-block basis based on the CPMV.
[0244] Here, the CPMV can be expressed based on one of the blocks surrounding 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 at each position.
[0245] For example, the CP may be CP0 located at the upper left 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 adjacent to 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 to the upper right of the current block. In this case, the neighboring blocks may include the neighboring block at the upper right corner of the current block and the neighboring block adjacent to the upper left 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 of the current block. In this case, the neighboring blocks may include the neighboring block at the lower left corner of the current block and the neighboring block 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] Alternatively, for example, the CP may be CP3 located to the lower right of the current block. Here, CP3 may also be referred to as RB. In this case, the neighboring blocks may include a col block of the current block or neighboring blocks at the lower right corner of the col block. Here, the col block may include a block located 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 motion information. 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 predicted sample of a current block based on an L0 predicted sample, an L1 predicted 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 the L0 predicted sample or the L1 predicted 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 by a procedure of generating a predicted 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 weighted 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 temporal merge candidates, and weight index information for the temporal merge candidates may be represented by 0. That is, weight index information for the temporal merge candidates may be represented by 0. Here, weight index information of 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. Alternatively, for example, the candidates may include temporal merge candidates, and the weight index information may be represented based on weight index information for col blocks. That is, weight index information for temporal merge candidates may be represented based on weight index information for 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.
[0253] For example, the candidates may include pair-wise candidates, and the weight index information may be represented based on the weight index information of one of the other two 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 the weight index information of one of the other two candidates in a merge candidate list used to derive the pair-wise candidate.
[0254] For example, the candidates may include a pair-wise candidate, and the pair-wise candidate may be represented based on the other two candidates among the candidates. If the weight index information of each of the other two candidates is the same as 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 may include a pair-wise candidate, and the pair-wise candidate may be represented based on the other two candidates among the candidates. If the weight index information of each of the other two candidates is the same as 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 of each of the other two candidates that is not 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.
[0256] For example, the merge candidate list may be a sub-block merge candidate list, and affine merge candidates, sub-block merge candidates, or SbTMVP candidates may be selected. Here, sub-block-based affine merge candidates may also be referred to as sub-block merge candidates.
[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 a CPMV0 for CP0 (Control Point 0) located in the upper left corner of the current block, the weight index information for the affine merge candidate may be represented based on the 0th weight index information for CP0. If the affine merge candidates do not include a CPMV0 for CP0 located in the upper left corner of the current block, the weight index information for the affine merge candidate may be represented based on the 1st weight index information for CP1 (Control Point 1) located in the upper right corner of the current block.
[0259] The 0 weight index information corresponds to weight index information of a block used to derive 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 the CP1 that is used to derive the CPMV1, and the neighboring blocks of the 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.
[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 the left peripheral blocks of the current block. That is, weight index information for SbTMVP candidates may be represented based on weight index information of the left peripheral blocks.
[0262] Alternatively, for example, the candidates may include an SbTMVP candidate, and the weight index information for the SbTMVP candidate may be represented as 0. That is, the weight index information for the SbTMVP candidate may be represented as 0. Here, weight index information of 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.
[0263] Alternatively, for example, the candidate may include an SbTMVP candidate, and the weight index information may be represented based on the weight index information of a center block in a col block. That is, the weight index information for an SbTMVP candidate may be represented based on the 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 the lower right sub-block of four sub-blocks located in the center of the col block.
[0264] Alternatively, 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 the 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 the col block.
[0265] Alternatively, although not shown in FIG. 12 , for example, the encoding apparatus may derive residual samples based on the predicted samples and original samples. In this case, residual-related information may be derived based on the residual samples. Residual samples may be derived based on the residual-related information. Reconstructed samples may be generated based on the residual samples and the predicted samples. Reconstructed blocks and reconstructed pictures may be derived based on the reconstructed samples. 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 part of the above-described information (or syntax elements) to generate a bitstream or encoded information. Alternatively, the encoded 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-described 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 Figure 14 may be performed by the decoding apparatus disclosed in Figure 3 or Figure 15. Specifically, for example, S1400 of Figure 14 may be performed by the entropy decoding unit 310 of the decoding apparatus 300 in Figure 15, and S1410 to S1440 of Figure 14 may be performed by the prediction unit 330 of the decoding apparatus 300 in Figure 15. Also, although not shown in Figure 14, in Figure 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] 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 some 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. Additionally, decoder side motion vector refinement (DMVR) mode, adaptive motion vector resolution (AMVR) mode, bi-prediction with CU-level weight (BCW), or bi-directional optical flow (BDOF) may be used in addition to or instead of the additional modes. 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 L0 prediction, L1 prediction, or bi-prediction.
[0271] The decoding apparatus may generate a merge candidate list for the current block based on 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, if the inter prediction mode is determined to be the affine merge mode or the sub-block merge mode, the merge candidate list may be referred to as an affine merge candidate list, a sub-block merge candidate list, or the like, or simply referred to as 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 reaches 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 of neighboring blocks of a current block. For example, the neighboring blocks may include spatial and / or temporal neighboring blocks of the current block. The spatial neighboring blocks may be searched first to derive a candidate (spatial merge), and then the temporal neighboring blocks may be searched to derive a candidate (temporal merge), and the derived candidate may be inserted into the merge candidate list. For example, if the number of candidates in the merge candidate list is less than the maximum number of candidates even after inserting a candidate, an additional candidate may be inserted into the merge candidate list. 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 the 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 they may be located at at least some 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.
[0274] For example, the candidate block may be derived through a search of neighboring blocks of the current block (or neighboring blocks of the current block's CP). For example, the affine merge candidate list may include at least one of inherited affine merge candidates, constructed affine merge candidates, or zero motion vector candidates. For example, the affine merge candidate list may first insert the inherited affine merge candidates, and then insert the constructed affine merge candidates. Furthermore, if the number of candidates in the affine merge candidate list is less than the maximum number of candidates after the constructed affine merge candidates have been inserted into the affine merge candidate list, the remaining candidates may be filled with zero motion vector candidates. Here, zero motion vector candidates may also be referred to as zero vectors. For example, the affine merge candidate list may be a list according to an affine merge mode in which motion vectors are derived on a sample-by-sample basis, or may be a list according to an affine merge mode in which motion vectors are derived on a sub-block-by-subblock basis. 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 by 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 candidate selected from the merge candidate list (S1420). For example, the merge candidate list may include at least some of spatial merge candidates, temporal merge candidates, pairwise candidates, or zero vector candidates, and one of these candidates may be selected for inter prediction of the current block. Alternatively, for example, the sub-block merge candidate list may include at least some of inherited affine merge candidates, constructed affine merge candidates, SbTMVP candidates, or zero vector candidates, and one of these 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 the 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 L0 prediction samples and L1 prediction samples of the current block based on the motion information (S1430). For example, if 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 from among L0 prediction, L1 prediction, or bi-prediction based on the inter prediction type information. 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 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 L1 motion information.
[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 L1 motion information.
[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 L1 motion information. For example, the pair-wise candidate may be derived based on two other candidates included in the merge candidate list.
[0281] Alternatively, for example, the merge candidate list may be a sub-block merge candidate list, and affine merge candidates, sub-block merge candidates, or SbTMVP candidates may be selected. Here, sub-block-based affine merge candidates may also be referred to as sub-block merge candidates.
[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 L0 motion information and the L1 motion information. 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 can be derived based on one of the blocks surrounding the CP (Control Point) of the current block. For example, there can be two, three, or four CPs, which can be located at least in part of the upper left (or upper left corner), upper right (or upper right corner), lower left (or lower left corner), or lower right (or lower right corner) of the current block, and only one CP can exist at each position.
[0284] For example, the CP may be CP0 located at the upper left 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 adjacent to 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 to the upper right of the current block. In this case, the neighboring blocks may include the neighboring block at the upper right corner of the current block and the neighboring block adjacent to the upper left 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 of the current block. In this case, the neighboring blocks may include the neighboring block at the lower left corner of the current block and the neighboring block 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] Alternatively, for example, the CP may be CP3 located to the lower right of the current block. Here, CP3 may also be referred to as RB. In this case, the neighboring blocks may include a col block of the current block or neighboring blocks at the lower right corner of the col block. Here, the col block may include a block located 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 neighboring blocks to the left of the current block, and the L0 predicted sample and the L1 predicted sample may be generated based on the L0 motion information and the L1 motion information. For example, the L0 predicted sample and the L1 predicted sample may be generated by performing prediction in units of sub-blocks.
[0289] The decoding apparatus may generate a prediction sample of the 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 from 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 weights 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 one of three or five weights. For example, the weighted average may indicate a weighted average using BCW (Bi-prediction with CU-level Weight) or BWA (Bi-prediction with Weighted Average).
[0290] For example, the candidates may include temporal merge candidates, and weight index information for the temporal merge candidates may be derived to 0. That is, weight index information for the temporal merge candidates may be derived to 0. Here, weight index information of 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.
[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 for col blocks. That is, weight index information for the temporal merge candidates may be derived based on weight index information for 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 pair-wise candidates, 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 may include a pair-wise candidate, and the pair-wise candidate may be derived based on two other candidates among the candidates. If weight index information of the other two candidates is identical to first weight index information, the weight index information for the pair-wise candidate may be derived based on the first weight index information. If weight index information 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 may 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 of each of the other two candidates that is not 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.
[0295] For example, the merge candidate list may be a sub-block merge candidate list, and affine merge candidates, sub-block merge candidates, or SbTMVP candidates may be selected. Here, sub-block-based affine merge candidates may also be referred to as sub-block merge candidates.
[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 a CPMV0 for Control Point 0 (CP0) located in the upper left corner of the current block, weight index information for the affine merge candidate may be derived based on the 0th weight index information for CP0. If the affine merge candidates do not include a CPMV0 for Control Point 0 (CP0) located in the upper left corner of the current block, weight index information for the affine merge candidate may be derived based on the 1st weight index information for Control Point 1 (CP1) located in the upper right corner of the current block.
[0298] The 0 weight index information corresponds to weight index information of a block used to derive 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 the CP1 that is used to derive the CPMV1, and the neighboring blocks of the 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.
[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 for 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 for neighboring blocks to the left.
[0301] Or, for example, the candidates may include SbTMVP candidates, and weight index information for the SbTMVP candidates may be derived as 0. That is, weight index information for SbTMVP candidates may be derived as 0. Here, weight index information of 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 candidate may include an SbTMVP candidate, and the weight index information may be derived based on the weight index information of a center block in a col block. That is, the weight index information for the SbTMVP candidate may be derived based on the 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 the lower right sub-block of four sub-blocks located in the center of the col block.
[0303] Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be derived based on the weight index information of each sub-block of the col block. That is, the weight index information for the SbTMVP candidates may be derived based on the weight index information of each sub-block of the col block.
[0304] Although not shown in Figure 14, for example, the decoding device may derive residual samples based on residual-related information included in the video information. Also, the decoding device may generate reconstructed samples based on the predicted samples and the residual samples. Reconstructed blocks and reconstructed pictures may be derived based on the reconstructed samples.
[0305] For example, a decoding device may decode a bitstream or encoded information to obtain video information including all or part of the above-described information (or syntax elements). The bitstream or encoded information may be stored in a computer-readable storage medium, and the above-described decoding method may be performed.
[0306] In the above-described embodiments, the method is described based on a flowchart with a series of steps or blocks, but the embodiment is not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps than those described above. Also, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive, and other steps may be included, or one or more steps in the flowcharts may be deleted without affecting the scope of the embodiments herein.
[0307] The methods according to the embodiments of this document described above can be implemented in software form, and the encoding device and / or decoding device according to this document can be included in devices that perform video processing, such as TVs, computers, smartphones, set-top boxes, and display devices.
[0308] In this document, when an embodiment is implemented in software, the method described above may be implemented with modules (processes, functions, etc.) that perform the functions described above. The modules may be stored in 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 read-only memory (ROM), random access memory (RAM), flash memory, a memory card, a storage medium, and / or other storage devices. That is, the embodiments described herein may be implemented and executed on a processor, microprocessor, controller, or chip. For example, the functional units illustrated in each figure 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 encoding device to which the embodiments of this document are applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interaction device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a custom video (VoD) service providing device, an over-the-top (OTT) video (over-the-top) device, an internet streaming service providing device, a three-dimensional (3D) video device, a virtual reality (VR) device, an augmented reality (AR) device, an image telephone video device, a vehicle terminal (e.g., a vehicle terminal (including an autonomous vehicle), an airplane terminal, a ship terminal, etc.), a medical video device, etc., and may be used to process a video signal or a data signal. For example, an over-the-top (OTT) video (over-the-top) 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, a processing method to which an embodiment of this document is applied may be produced in the form of a computer-executable program and stored in a computer-readable recording medium. Multimedia data having a data structure according to an embodiment of this document may also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. Examples of the computer-readable recording medium include Blu-ray Discs (BDs), Universal Serial Buses (USBs), ROMs, PROMs, EPROMs, EEPROMs, RAMs, CD-ROMs, magnetic tapes, floppy disks, and optical data storage devices. The computer-readable recording medium also includes media implemented in the form of carrier waves (e.g., transmission via the Internet). A bitstream generated by an encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.
[0311] Furthermore, the embodiments of the present document may be implemented in a computer program product by program code, which may be executed by a computer in accordance with 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 to which the embodiments disclosed herein can 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 during 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 an intermediary 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, which then transmits the multimedia data to the user. In this case, the content streaming system may include a separate control server, which controls commands and responses between devices in the content streaming system.
[0317] The streaming server can receive content from a media repository and / or an encoding server. For example, if content is received from the encoding server, the content can be received in real time. In this case, the streaming server can store the bitstream for a certain period of time to provide a smooth streaming service.
[0318] Examples of the user devices include mobile phones, smartphones, 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 glasses, head-mounted displays (HMDs)), digital TVs, desktop computers, and digital signs.
[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. Furthermore, 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. 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 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; When the constructed affine merge candidate is constructed based on CPMV0 for CP0 (Control Point 0), CPMV1 for CP1 (Control Point 1), and CPMV2 for CP2 (Control Point 2), the weight index for the constructed affine merge candidate is set equal to the weight index for CP0; If the constructed affine merge candidate is constructed based on the CPMV1 for CP1, the CPMV2 for CP2, and the CPMV3 for CP3 (Control Point 3), the weight index for the constructed affine merge candidate is set equal to the weight index for CP1; The CP0 is associated with the upper left corner of the current block; CP1 is associated with the top right corner of the current block; CP2 is associated with the bottom left corner of the current block; The CP3 is associated with the bottom right corner of the current block.
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 indicating one of the candidates included in the merge candidate list; encoding video 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; When the constructed affine merge candidate is constructed based on CPMV0 for CP0 (Control Point 0), CPMV1 for CP1 (Control Point 1), and CPMV2 for CP2 (Control Point 2), the weight index for the constructed affine merge candidate is set equal to the weight index for CP0; If the constructed affine merge candidate is constructed based on the CPMV1 for CP1, the CPMV2 for CP2, and the CPMV3 for CP3 (Control Point 3), the weight index for the constructed affine merge candidate is set equal to the weight index for CP1; The CP0 is associated with the upper left corner of the current block; CP1 is associated with the top right corner of the current block; CP2 is associated with the bottom left corner of the current block; The CP3 is associated with the bottom right corner of the current block.
3. 1. A method of transmitting data for video, comprising: 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 indicating one of the candidates included in the merge candidate list; encoding video information including the inter prediction mode information and the selection information; 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; When the constructed affine merge candidate is constructed based on CPMV0 for CP0 (Control Point 0), CPMV1 for CP1 (Control Point 1), and CPMV2 for CP2 (Control Point 2), the weight index for the constructed affine merge candidate is set equal to the weight index for CP0; If the constructed affine merge candidate is constructed based on the CPMV1 for CP1, the CPMV2 for CP2, and the CPMV3 for CP3 (Control Point 3), the weight index for the constructed affine merge candidate is set equal to the weight index for CP1; The CP0 is associated with the upper left corner of the current block; CP1 is associated with the top right corner of the current block; CP2 is associated with the bottom left corner of the current block; The CP3 is associated with the bottom right corner of the current block.
Citation Information
Patent Citations
Motion vector generation for affine motion model for video coding
US20180192069A1
Affine prediction for video coding
WO2017156705A1
Method, device, and system for determining prediction weight for merge mode
WO2020185429A1
Method and apparatus for video coding
WO2020185555A1