Video or image coding deriving weight index information for bi-prediction - Patents.com
Weight-based bi-prediction in video coding addresses the inefficiencies of existing methods by enhancing compression efficiency through improved construction of motion vector candidates, reducing data requirements for high-resolution and immersive media.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2026-01-05
- Publication Date
- 2026-03-11
AI Technical Summary
The increasing demand for high-resolution and high-quality images/videos, along with the rise of immersive media, has led to a need for highly efficient image/video compression technologies to effectively compress and transmit/store such content, as existing methods result in increased transmission and storage costs due to the higher amount of information required.
The implementation of weight-based bi-prediction in video coding, which involves deriving weight index information for bi-prediction during inter prediction, particularly in merge candidate lists, to enhance compression efficiency.
This approach improves the efficiency of image/video compression by efficiently constructing motion vector candidates and performing weight-based bi-prediction, thereby reducing the amount of data needed for transmission and storage.
Smart Images

Figure 2026042878000001_ABST
Abstract
Description
[Technical Field]
[0001] The present technology relates to video or image coding that derives weight index information for bi-prediction. [Background technology]
[0002] In recent years, the demand for high-resolution, high-quality images / videos, such as 4K or 8K or higher UHD (Ultra High Definition) images / videos, 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 and storage costs increase.
[0003] In addition, interest and demand for immersive media such as VR (Virtual Reality), AR (Artificial Reality) content and holograms has been increasing in recent years, and the broadcast of images / videos with different image characteristics from real images, such as game images, is increasing.
[0004] Therefore, there is a need 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 [Means for solving the problem]
[0005] According to one embodiment of the present document, a method and apparatus for improving the efficiency of image / video coding is provided.
[0006] According to one embodiment of this document, a method and apparatus for using weight-based bi-prediction in video coding is provided.
[0007] According to one embodiment of the present document, a method and apparatus for deriving weight index information for bi-prediction in inter prediction are provided.
[0008] According to one embodiment of the present document, a method and apparatus are provided for deriving weight index information for candidates in a merge candidate list or an affine merge candidate list during bi-prediction.
[0009] According to one embodiment of the present document, there is provided a video / image decoding method performed by a decoding device.
[0010] According to one embodiment of the present document, there is provided a decoding device for performing video / image decoding.
[0011] According to one embodiment of the present document, there is provided a video / image encoding method performed by an encoding device.
[0012] According to one embodiment of the present document, there is provided an encoding device for performing video / image encoding.
[0013] According to one embodiment of the present document, there is provided a computer-readable digital storage medium having encoded video / image information stored thereon, the encoded video / image information being generated by the video / image encoding method disclosed in at least one of the embodiments of the present document.
[0014] According to one embodiment of the present document, there is provided a computer-readable digital storage medium storing encoded information or encoded video / image information that causes a decoding device to perform the video / image decoding method disclosed in at least one of the embodiments of the present document. [Effects of the Invention]
[0015] According to one embodiment of this document, the efficiency of image / video compression in general can be improved.
[0016] According to one embodiment of this document, motion vector candidates can be efficiently constructed during inter prediction.
[0017] According to one embodiment of this document, weight-based bi-prediction can be performed efficiently. [Brief explanation of the drawings]
[0018] [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 the configuration of a video / image encoding device to which an embodiment of this document can be applied. [Figure 3] 1 is a diagram illustrating the configuration of a video / image decoding device to which an embodiment of this document can be applied. [Figure 4] FIG. 10 is a diagram illustrating a merge mode in inter prediction. [Figure 5A] 1 illustrates an exemplary CPMV for affine motion prediction. [Figure 5B] 1 illustrates an exemplary CPMV for affine motion prediction. [Figure 6] A case where the affine MVF is determined in units of sub-blocks will be illustrated as an example. [Figure 7] FIG. 10 is a diagram illustrating an affine merge mode in inter prediction. [Figure 8] FIG. 10 is a diagram illustrating the positions of candidates in an affine merge mode. [Figure 9] FIG. 10 is a diagram for explaining SbTMVP in inter prediction. [Figure 10] 1 illustrates an example of a video / image encoding method and associated components according to an embodiment of the present document. [Figure 11] 1 illustrates an example of a video / image encoding method and associated components according to an embodiment of the present document. [Figure 12]1 illustrates an example of a schematic representation of an image / video decoding method and related components according to an embodiment of the present document; [Figure 13] 1 illustrates an example of a schematic representation of an image / video decoding method and related components according to an embodiment of the present document; [Figure 14] 1 illustrates an example of a content streaming system to which the embodiments disclosed herein can be applied. DETAILED DESCRIPTION OF THE INVENTION
[0019] Although the disclosure of this document 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. The terms used in this document are used merely to describe specific embodiments and are not intended to limit the technical ideas of the embodiments in this document. The singular expressions include the plural expressions unless the context clearly indicates otherwise. In this document, terms such as "comprise" or "have" are intended to specify the presence of features, numbers, steps, operations, components, parts, or combinations thereof described in the document, and should be understood not to preclude the possibility of the presence or addition of one or more different features, numbers, steps, operations, components, parts, or combinations thereof.
[0020] Meanwhile, each component in the drawings described in this document is shown independently for the convenience of describing 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 included within the scope of this document.
[0021] Hereinafter, the embodiments of the present document will be described with reference to the accompanying drawings. Hereinafter, the same reference numerals may be used for the same components in the drawings, and duplicate descriptions of the same components may be omitted.
[0022] FIG. 1 illustrates a schematic diagram of an example video / image coding system to which embodiments of this document may be applied.
[0023] 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.
[0024] 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 / video encoding device, and the decoding device may be referred to as a video / video 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.
[0025] 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 by a process in which related data is generated.
[0026] An encoding device can encode input video / images. The encoding device can perform a series of procedures 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.
[0027] The transmitter can transmit the encoded video / image information or data output in the form of a bitstream to a receiver of a receiving device via a digital storage medium or a network in the form of a file or streaming. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter can include elements for generating a media file in a predetermined file format and elements for transmission via a broadcasting / communication network. The receiver can receive / extract the bitstream and transmit it to a decoding device.
[0028] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transform, and prediction, which correspond to the operations of the encoding device.
[0029] The renderer can render the decoded video / image, and the rendered video / image can be displayed via a display unit.
[0030] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document may be applied to methods disclosed in the versatile video coding (VVC) standard. The methods / embodiments disclosed in this document may also be applied to methods disclosed in the essential video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the second generation audio video coding standard (AVS2), or next-generation video / image coding standards (e.g., H.267 or H.268).
[0031] This document presents various embodiments relating to video / image coding, which may be used in combination with one another unless otherwise specified.
[0032] In this document, video may refer to a collection of a series of images over time. A picture generally refers to a unit that represents an image at a specific time period, and a slice / tile is a unit that constitutes part of a picture in coding. A slice / tile may include one or more coding tree units (CTUs). A picture may consist of one or more slices / tiles. 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, and the rectangular region has a height equal to the height of the picture, and the width may be specified by syntax elements in the picture parameter set. The tile row is a rectangular region of CTUs having a height specified by syntax elements in the picture parameter set and a width equal to the width of the picture.A tile scan may indicate a specific sequential ordering of CTUs partitioning a picture, in which the CTUs are ordered consecutively in CTU raster scan in a tile, whereas tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture. A slice includes an integer number of complete tiles or an integer number of consecutive complete CTU rows within a tile of a picture that may be exclusively contained in a single NAL unit.
[0033] 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.
[0034] A pixel or a pel may refer to the smallest unit constituting one picture (or 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, 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.
[0035] A unit may refer to a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. 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 a set (or array) of samples or transform coefficients consisting of M columns and N rows.
[0036] In this document, "A or B" may mean "only A," "only B," or "both A and B." In other words, in this document, "A or B" may be interpreted as "A and / or B." For example, in this document, "A, B or C" may mean "only A," "only B," "only C," or "any combination of A, B and C."
[0037] A slash ( / ) or a comma (comma) used in this document can mean "and / or." For example, "A / B" can mean "A and / or B." This means that "A / B" can mean "only A," "only B," or "both A and B." For example, "A, B, C" can mean "A, B, or C."
[0038] In this document, "at least one of A and B" can mean "only A," "only B," or "both A and B." Also, in this document, 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."
[0039] Also, in this document, "at least one of A, B and C" can mean "only A," "only B," "only C," or "any combination of A, B and C." Also, "at least one of A, B or C" and "at least one of A, B and / or C" can mean "at least one of A, B and C."
[0040] Furthermore, parentheses used in this document may mean "for example." Specifically, when "prediction (intra prediction)" is displayed, "intra prediction" may be suggested as an example of "prediction." In other words, "prediction" in this document is not limited to "intra prediction," and "intra prediction" may be suggested as an example of "prediction." Furthermore, when "prediction (i.e., intra prediction)" is displayed, "intra prediction" may be suggested as an example of "prediction."
[0041] Technical features individually described in one drawing in this document may be embodied individually or simultaneously.
[0042] 2 is a diagram illustrating the configuration of a video / image encoding device to which an embodiment of the present document can be applied. Hereinafter, the encoding device may include an image encoding device and / or a video encoding device.
[0043] As shown in FIG. 2, the encoding apparatus 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) and may be configured by a digital storage medium. The hardware components may further include the memory 270 as an internal / external component.
[0044] The image division unit 210 may divide an input image (or picture or 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) according to 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 the ternary structure may be applied. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present disclosure may be performed based on a final coding unit that is not further divided. In this case, the 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.
[0045] The term "unit" may be used interchangeably with terms such as "block" or "area." In general, an MxN block may refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample generally refers to a pixel or a pixel value, and may refer to only a pixel / pixel value of a luma component or only a pixel / pixel value of a chroma component. A sample can be used as a term corresponding to one pixel or pel of a picture (or image).
[0046] 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 video 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 encoder 200 that subtracts a prediction signal (predicted block, prediction sample array) from an input video 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.
[0047] The intra prediction unit 222 can predict the current block by referring to samples in the current picture. The referenced samples can be located in the neighborhood of the current block or can be located far away, depending on the prediction mode. In intra prediction, prediction modes can include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes can include, for example, DC mode and planar mode. The directional modes can 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 can also determine the prediction mode to be applied to the current block using the prediction modes applied to neighboring blocks.
[0048] 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.
[0049] The predictor 220 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 intra block copy (IBC) prediction mode or 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 deriving a reference block within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document. 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.
[0050] 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 graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, GBT refers to a transform obtained from a graph representing relationship information between pixels. 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 square size or non-square blocks of variable sizes.
[0051] The quantization unit 233 quantizes the transform coefficients and transmits the quantized signal to the entropy encoding unit 240. The entropy encoding unit 240 encodes the quantized signal (information about the quantized transform coefficients) and outputs the encoded signal as a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantization unit 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 encoding unit 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 encoding unit 240 may also encode information required for video / image restoration (e.g., values of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / picture information) may be transmitted or stored in the form of a bitstream in units of network abstraction layer (NAL) units. The video / picture 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 / picture information may also include general constraint information. In this document, information and / or syntax elements transmitted / signaled from an encoding device to a decoding device may be included in the video / picture 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 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 apparatus 200, or the transmitter may be included in the entropy encoding unit 240.
[0052] The quantized transform coefficients output from the quantizer 233 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 234 and the inverse transformer 235. The adder 155 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter predictor 221 or the intra predictor 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 block to be processed in the current picture, or may be used for inter prediction of the next picture after filtering, as described below.
[0053] Meanwhile, luma mapping with chroma scaling (LMCS) can be applied during picture encoding and / or reconstruction.
[0054] 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 connection with each filtering method. The filtering information may be encoded by the entropy encoding unit 240 and output in the form of a bitstream.
[0055] 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 apparatus can avoid prediction mismatch between the encoding apparatus 100 and the decoding apparatus, and can also improve coding efficiency.
[0056] The DPB of the memory 270 may store the 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.
[0057] 3 is a diagram illustrating the configuration of a video / image decoding device to which an embodiment of the present document can be applied. Hereinafter, the term "decoding device" may include an image decoding device and / or a video decoding device.
[0058] 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 inter predictor 331 and an intra predictor 332. The residual processor 320 may include a dequantizer 321 and an inverse transformer 321. Depending on the embodiment, the entropy decoding unit 310, the residual processor 320, the predictor 330, the adder 340, and the filter 350 may be implemented as a single hardware component (e.g., a decoder chipset or processor). The memory 360 may include a decoded picture buffer (DPB) or may be implemented as a digital storage medium. The hardware components may further include a memory 360 as an internal / external component.
[0059] When a bitstream including video / image information is input, the decoding apparatus 300 can reconstruct an image corresponding to the process in which the video / image information was processed by the encoding apparatus of FIG. 3. For example, the decoding apparatus 300 can derive units / blocks based on block division-related information obtained from the bitstream. The decoding apparatus 300 can perform decoding using a processing unit applied by the encoding apparatus. 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 apparatus 300 can be played back via a playback device.
[0060] The decoding apparatus 300 may receive a signal output from the encoding apparatus 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 / video information) necessary for video restoration (or picture restoration). The video / video 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 / video information may also include general constraint information. The decoding apparatus may further decode pictures based on the information on the parameter sets and / or the general constraint information. Signaled / 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 on the syntax element to be decoded and decoding information on neighboring and current blocks or information on 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.In this case, after determining a context model, the CABAC entropy decoding method may update the context model using information on the decoded symbol / bin for the context model of the next symbol / bin. Prediction-related information from the information decoded by the entropy decoding unit 310 may be provided to a prediction unit (inter prediction unit 332 and intra prediction unit 331), and residual values entropy decoded by the entropy decoding unit 310, i.e., quantized transform coefficients and related parameter information, may be input to the residual processing unit 320. The residual processing unit 320 may derive a residual signal (residual block, residual sample, residual sample array). Furthermore, filtering-related information from the information decoded by the entropy decoding unit 310 may be provided to the filtering unit 350. Meanwhile, a receiving unit (not shown) for receiving a signal output from the encoding apparatus may be further configured as an internal / external element of the decoding apparatus 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.
[0061] 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 apparatus. 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.
[0062] The inverse transform unit 322 performs inverse transform on the transform coefficients to obtain a residual signal (residual block, residual sample array).
[0063] 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 the prediction information output from the entropy decoding unit 310, and may determine a specific intra / inter prediction mode.
[0064] The predictor 320 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 video / movie 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 deriving a reference block within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document. 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 / picture information and signaled.
[0065] The intra prediction unit 331 can predict a current block by referring to samples in a current picture. The referenced samples can be located in the neighborhood of the current block or far away from it depending on the prediction mode. In intra prediction, prediction modes can include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 331 can also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.
[0066] The inter prediction unit 332 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. 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.
[0067] The adder 340 can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to a prediction signal (predicted block, predicted sample array) output from a prediction unit (including an inter prediction unit 332 and / or an intra prediction unit 331). When there is no residual for the current block, such as when a skip mode is applied, the predicted block can be used as the reconstructed block.
[0068] 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.
[0069] Meanwhile, LMCS (luma mapping with chroma scaling) can be applied during picture decoding.
[0070] 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 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.
[0071] 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 260 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.
[0072] 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.
[0073] When inter prediction is applied, a prediction unit of an encoding / decoding apparatus may perform inter prediction on a block-by-block basis to derive a prediction sample. Inter prediction may refer to a prediction derived in a manner that is dependent on data elements (e.g., sample values or motion information) of pictures other than the current picture. When inter prediction is applied to a current block, a predicted block (prediction sample array) for the current block may be derived based on a reference block (reference sample array) identified by a motion vector in a reference picture indicated by a reference picture index. In this case, to reduce the amount of motion information transmitted in the inter prediction mode, motion information of the current block may be predicted in block, sub-block, or sample units 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 an inter prediction type (e.g., L0 prediction, L1 prediction, Bi prediction, etc.). When inter-prediction is applied, the neighboring blocks may include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in a reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring blocks may be the same or different. The temporal neighboring blocks may be called collocated reference blocks, collocated CUs (colCUs), etc., and the reference picture including the temporal neighboring blocks may be called collocated pictures (colPics).For example, a motion information candidate list may be constructed based on neighboring blocks of the current block, and flag or index information indicating which candidate is selected (used) to derive the motion vector and / or reference picture index of the current block may be signaled. Inter prediction may be performed based on various prediction modes. For example, in skip mode and merge mode, the motion information of the current block may be the same as the motion information of the selected neighboring block. In skip mode, unlike merge mode, a residual signal may not be transmitted. In motion vector prediction (MVP) mode, the motion vector of the selected neighboring block is used as a motion vector predictor, and a motion vector difference may be signaled. In this case, the motion vector of the current block may be derived using the sum of the motion vector predictor and the motion vector difference.
[0074] The motion information may include L0 motion information and / or L1 motion information depending on the inter prediction type (L0 prediction, L1 prediction, Bi prediction, etc.). A motion vector in the L0 direction may be referred to as an L0 motion vector or MVL0, and a motion vector in the L1 direction may be referred to as an L1 motion vector or MVL1. Prediction based on an L0 motion vector may be referred to as L0 prediction, prediction based on an L1 motion vector may be referred to as L1 prediction, and prediction based on both the L0 motion vector and the L1 motion vector may be referred to as bi-prediction (Bi) prediction. Here, an L0 motion vector may indicate a motion vector associated with a reference picture list L0 (L0), and an L1 motion vector may indicate a motion vector associated with a reference picture list L1 (L1). The reference picture list L0 may include pictures that are earlier in output order than the current picture as reference pictures, and the reference picture list L1 may include pictures that are later in output order than the current picture. The previous picture may be called a forward (reference) picture, and the subsequent picture may be called a backward (reference) picture. The reference picture list L0 may further include, as reference pictures, pictures that are subsequent to the current picture in output order. In this case, the previous picture may be indexed first in the reference picture list L0, and the subsequent picture may be indexed thereafter. The reference picture list L1 may further include, as reference pictures, pictures that are subsequent to the current picture in output order. In this case, the subsequent picture may be indexed first in the reference picture list L1, and the previous picture may be indexed thereafter. Here, the output order may correspond to a picture order count (POC) order.
[0075] 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 additional 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 (AMVP). In this document, motion information candidates derived by some modes and / or some modes may be included as one of the motion information candidates for other modes. For example, an HMVP candidate may be added as a merge candidate for the merge / skip mode, or as an MVP candidate for the MVP mode. When the HMVP candidate is used as a candidate for motion information in the merge mode or skip mode, the HMVP candidate may be referred to as an HMVP merge candidate.
[0076] Prediction mode information indicating the inter prediction mode of the current block may be signaled from the encoding apparatus to the 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 the skip mode is applied, and if the skip mode is not applied, a merge flag may be signaled to indicate whether the 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 affine merge mode and affine MVP mode.
[0077] Meanwhile, information indicating whether the above-mentioned list0 (L0) prediction, list1 (L1) prediction, or bi-prediction (BI) prediction is used for the current block (current coding unit) may be signaled for the current block. This information may be called motion prediction direction information, inter prediction direction information, or inter prediction indication information, and may be configured / encoded / signaled in the form of, for example, an inter_pred_idc syntax element. That is, the inter_pred_idc syntax element may indicate whether the above-mentioned L0 prediction, L1 prediction, or bi-prediction is used for the current block (current coding unit). In this document, for convenience of explanation, the inter prediction type (L0 prediction, L1 prediction, or BI prediction) indicated by the inter_pred_idc syntax element may be referred to as a motion prediction direction. For example, L0 prediction may be represented as pred_L0, L1 prediction as pred_L1, and bi-prediction as pred_BI.
[0078] As described above, one picture may include one or more slices. A slice may have one of slice types, including an I slice (intra slice), a P slice (predictive slice), and a B slice (bi-predictive slice). The slice type may be indicated based on slice type information. For blocks in an I slice, inter prediction may not be used for prediction, and only intra prediction may be used. Of course, even in this case, original sample values may be coded and signaled without prediction. For blocks in a P slice, intra prediction or inter prediction may be used, and when inter prediction is used, only uni-prediction may be used. On the other hand, for blocks in a B slice, intra prediction or inter prediction may be used, and when inter prediction is used, up to bi-prediction may be used. That is, for blocks in a B slice, when inter prediction is used, uni-prediction or bi-prediction may be used.
[0079] L0 and L1 may include reference pictures encoded / decoded earlier than the current picture. Here, L0 may indicate reference picture list 0, and L1 may indicate reference picture list 1. For example, L0 may include reference pictures earlier and / or later than the current picture in picture order count (POC) order, and L1 may include reference pictures later and / or earlier than the current picture in POC order. In this case, L0 may be assigned a reference picture index lower than the reference picture earlier than the current picture in POC order, and L1 may be assigned a reference picture index lower than the reference picture later than the current picture in POC order. In the case of a B slice, bi-prediction may be applied, and in this case, unidirectional bi-prediction or bi-directional bi-prediction may be applied. Bi-directional bi-prediction may be referred to as true bi-prediction.
[0080] Meanwhile, inter-prediction may be performed using motion information of the current block. The encoding apparatus may derive optimal motion information for the current block through a motion estimation procedure. For example, the encoding apparatus may use an original block in an original picture for the current block to search for a similar reference block with high correlation within a predetermined search range in the reference picture in fractional pixel units, thereby deriving motion information. Block similarity may be derived based on a difference in phase-based sample values. For example, block similarity may be calculated based on the sum of absolute differences (SAD) between the current block (or a template of the current block) and the 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 the decoding apparatus in various ways based on the inter-prediction mode.
[0081] FIG. 4 is a diagram illustrating the 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 syntax element regular_merge_flag 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, although embodiments of this document are not limited thereto. Furthermore, the maximum number of merge candidate blocks may be transmitted in a slice header or a tile group header, although embodiments of this document are not limited thereto. After finding 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 for the spatial neighboring blocks based on a priority order, 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. 4 in the order A1->B1->B0->A0->B2, sequentially index available candidates, and construct a merge candidate list.
[0088] The coding device can search for the 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 on a reference picture that is a different picture from the current picture in which the current block is located. The reference picture on which the temporal neighboring blocks are located may be called a collocated picture or a col picture. The temporal neighboring blocks can be searched in the order of the neighboring blocks around the lower right corner and the block at the center of the lower right side of the co-located block for the current block on the col picture. On the other hand, when motion data compression is applied, specific motion information can be stored as representative motion information for each fixed storage unit in the col picture. In this case, it is not necessary to store the motion information for all blocks within the fixed storage unit, and through this, the effect of motion data compression can be obtained. In this case, the fixed storage unit may be predetermined, for example, in a 16x16 sample unit, an 8x8 sample unit, etc., or the 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 blocks can be replaced with the representative motion information of the fixed storage unit in which the temporal neighboring blocks are located. That is, in this case, from the aspect of implementation, instead of the prediction block located at the coordinates of the temporal neighboring blocks, based on the coordinates (upper left sample position) of the temporal neighboring blocks, after arithmetic right shift by a certain value and then arithmetic left shift, the motion information of the prediction block covering the shifted position can be used to derive the temporal merge candidate. For example, when the fixed storage unit is a 2nx2n sample unit, if the coordinates of the temporal neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the corrected positions ((xTnb>>n)<<n), (yTnb>>n)<<n)) can be used for the temporal merge candidate.Specifically, for example, if the fixed storage unit is a 16x16 sample unit and the coordinates of the temporal neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the modified position ((xTnb>>4)<<4), (yTnb>>4)<<4) can be used for the temporal merge candidate. Alternatively, for example, if the fixed storage unit is an 8x8 sample unit and the coordinates of the temporal neighboring block are (xTnb, yTnb), the motion information of the prediction block located at the modified position ((xTnb>>3)<<3), (yTnb>>3)<<3) can be used for the temporal merge candidate.
[0089] The coding device may check whether the current number of merging candidates is smaller than the maximum number of merging candidates. The maximum number of merging candidates may be predefined or signaled from the encoding device to the decoding device. For example, the encoding device may generate and encode information regarding the maximum number of merging candidates and transmit the information to the decoder in the form of a bitstream. If the maximum number of merging candidates is full, no further candidate addition process may be performed.
[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 of the current slice / tile group is type B), and / or zero vector merge candidate (described below).
[0091] If the check results in the current number of merge candidates being 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 a rate-distortion (RD) cost, and may signal selection information (e.g., a 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 for 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 apparatus can derive residual samples of the current block based on the predicted sample and signal residual information about the residual sample to the decoding apparatus. The decoding apparatus 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 a skip mode is applied, the motion information of the current block can be derived in the same manner as when the merge mode is applied. However, when the skip mode is applied, the residual signal for the corresponding block is omitted, and therefore, the predicted sample can be directly used as the reconstructed sample. The skip mode can be applied, for example, when the value of the syntax element cu_skip_flag is 1.
[0094] Meanwhile, the pair-wise average merge candidate may be referred to as a pairwise average candidate. The pair-wise average candidate 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 indicate 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 can be used directly. For example, if no motion vectors are available, the list may remain in an inactive state.
[0095] For example, if the merge candidate list is still not full after adding the pairwise average merge candidates, i.e., if the number of current merge candidates in the merge candidate list is less than the number of maximum merge candidates, a zero vector (zero MVP) can be inserted at the end until the number of current merge candidates in the merge candidate list is equal to the number of maximum merge candidates.
[0096] Meanwhile, in the past, only one motion vector could be used to represent the motion of a coding block. That is, a translation motion model could be used. However, while this method may represent the optimal motion on a block-by-block basis, coding efficiency can be improved if the optimal motion vector can be determined on a sample-by-sample basis, rather than the optimal motion of each actual sample. For this reason, an affine motion model can be used. The affine motion prediction method for coding using an affine motion model is as follows.
[0097] The affine motion estimation method can express a motion vector for each sample of a block using two, three, or four motion vectors. For example, an affine motion model can express four motions. Among the motions that can be expressed by an affine motion model, an affine motion model that expresses three motions (translation, scale, and rotation) may be called a similarity (or simplified) affine motion model, and the following description will be based on this, but is not limited to the above motion models.
[0098] 5a and 5b exemplarily illustrate CPMV for affine motion prediction.
[0099] 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, where the collection of motion vectors can be denoted as an affine motion vector field (MVF).
[0100] For example, Figure 5a may show a case where two CPMVs are used, which may be called a four-parameter affine model. In this case, the motion vector at a sample position of (x, y) may be determined, for example, as shown in Equation 1.
[0101]
number
[0102] For example, Figure 5b 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 a sample position of (x, y) may be determined, for example, as shown in Equation 2.
[0103]
number
[0104] 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.
[0105] FIG. 6 exemplarily shows a case where the affine MVF is determined in units of subblocks.
[0106] In the encoding / decoding process, the affine MVF can be determined in sample units or in predefined sub-block units. 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.
[0107] In the embodiment, it may be assumed that the affine MVF is determined in units of 4x4 sub-blocks. However, this is for convenience of explanation, and the size of the sub-blocks may be variously modified.
[0108] 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 can refer to a model in which an existing block-based motion vector is used, the 4-parameter affine motion model can refer to a model in which two CPMVs are used, and the 6-parameter affine motion model can refer to a model in which three CPMVs are used.
[0109] On the other hand, affine motion prediction can include affine MVP (or affine inter) mode or affine merge mode.
[0110] FIG. 7 is a diagram illustrating the affine merge mode in inter prediction.
[0111] For example, in affine merge mode, CPMV can be determined by the affine motion model of neighboring blocks coded with affine motion prediction. For example, neighboring blocks coded with 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 with affine motion prediction, the current block can be coded in the affine merge mode. Here, the affine merge mode may be referred to as AF_MERGE.
[0112] When the affine merge mode is applied, the CPMV of the current block can be derived using the CPMV of the neighboring blocks. In this case, the CPMV of the neighboring blocks may be used as the CPMV of the current block as is, or the CPMV of the neighboring blocks may be modified based on the sizes of the neighboring blocks and the current block, and then used as the CPMV of the current block.
[0113] Meanwhile, in the case of an affine merge mode in which a motion vector (MV) is derived on a subblock basis, this may be referred to as a subblock merge mode, which may be indicated based on a subblock 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 subblock merge mode is applied. In this case, an affine merge candidate list (described later) may also be referred to as a subblock merge candidate list. In this case, the subblock merge candidate list may further include a candidate derived as an SbTMVP (described later). In this case, the candidate derived as an SbTMVP may be used as the candidate with the zeroth index in the subblock merge candidate list. In other words, the candidate derived as an SbTMVP may be located before an inherited affine candidate or a constructed affine candidate (described later) in the subblock merge candidate list.
[0114] When the affine merge mode is applied, an affine merge candidate list can be constructed to derive the CPMV for the current block. For example, the affine merge candidate list can 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 can indicate a candidate constructed with a CPMV whose value is 0.
[0115] The affine merge candidate list can be constructed, for example, as follows:
[0116] There may be up to two inherited affine candidates, which may be derived from the affine motion model of the surrounding blocks. The surrounding blocks may include one left surrounding block and one above surrounding block. The candidate blocks may be positioned as shown in FIG. 4. The scan order for the left predictor may be A1->A0, and the scan order for the above predictor may be B1->B0->B2. Only one inherited candidate may be selected from each of the left and above. There may be no pruning check between two inherited candidates.
[0117] If a neighboring affine block is identified, the control point motion vector of the identified block may be used to derive a CPMVP candidate in the affine merge list of the current block. Here, the neighboring 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. 7, 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 neighboring block A can be obtained. If 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 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.
[0118] FIG. 8 is a diagram for explaining the positions of candidates in the affine merge mode.
[0119] 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 can be derived from the identified spatial and temporal surroundings. k(k=1、2、3、4) can indicate the kth control point.
[0120] Referring to Figure 8, for CPMV1, blocks can be checked in the order B2->B3->A2, and the motion vector of the first available block can be used. For CPMV2, blocks can be checked in the order B1->B0, and for CPMV3, blocks can be checked in the order A1->A0. If available, a temporal motion vector predictor (TMVP) can be used for CPMV4.
[0121] After the motion vectors of the four control points are obtained, affine merge candidates can be constructed based on the obtained motion information. The combinations of control point motion vectors can be constructed in the following order: {CPMV1,CPMV2,CPMV3}, {CPMV1,CPMV2,CPMV4}, {CPMV1,CPMV3,CPMV4}, {CPMV2,CPMV3,CPMV4}, {CPMV1,CPMV2}, and {CPMV1,CPMV3}.
[0122] 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.
[0123] FIG. 9 is a diagram illustrating SbTMVP in inter prediction.
[0124] On the other hand, a subblock-based temporal motion vector prediction (SbTMVP) method may also be used. For example, SbTMVP may also 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 may also be called a col picture.
[0125] 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 a collocated picture, where the motion shift can be obtained from the motion vector of one of the spatially neighboring blocks of the current block.
[0126] SbTMVP can predict the motion vector of a sub-block (or sub-CU) in a current block (or CU) through two steps.
[0127] In the first step, the spatial neighboring blocks may be examined in the order of A1, B1, B0, and A0 in Figure 4. The first spatial neighboring block with a motion vector that uses the col picture as its reference picture may be identified, and the motion vector may be selected as the motion shift to be applied. If no such motion is identified from the spatial neighboring blocks, the motion shift may be set to (0,0).
[0128] 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 to 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.
[0129] The combined sub-block-based merge list containing all SbTVMP candidates and affine merge candidates can be used to signal affine merge mode. Here, affine merge mode may be referred to as sub-block-based merge mode. SbTVMP mode may or may not be available depending on a flag included in the sequence parameter set (SPS). If SbTMVP mode is available, the SbTMVP predictor may be added as the first entry in the list of sub-block-based merge candidates, followed by affine merge candidates. The maximum allowed size of the affine merge candidate list may be five.
[0130] The size of the sub-CUs (or sub-blocks) used in SbTMVP may be fixed at 8x8, and like the affine merge mode, SbTMVP mode may only be applied to blocks whose width and height are both 8 or greater. The encoding logic for additional SbTMVP merge candidates may be the same as for other merge candidates. That is, for each CU in a P or B slice, a rate-distortion (RD) check using an additional RD cost may be performed to determine whether to use an SbTMVP candidate.
[0131] Meanwhile, a predicted block for the current block may be derived based on motion information derived according to the prediction mode. The predicted block may include prediction samples (prediction sample array) of the current block. If the motion vector of the current block points to a fractional sample unit, an interpolation procedure may be performed, through which prediction samples of the current block may be derived based on reference samples in fractional sample units within a reference picture. If affine inter-prediction (affine prediction mode) is applied to the current block, prediction samples may be generated based on MVs in sample / sub-block units. 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) may be used as prediction samples for the current block. Here, a motion vector in the L0 direction may be referred to as an L0 motion vector or MVL0, and a motion vector in the L1 direction may be referred to as an L1 motion vector or MVL1. When bi-prediction is applied, if a reference picture used for L0 prediction and a reference picture used for L1 prediction are located in different temporal directions relative to the current picture (i.e., if they are both bi-predictive and bidirectional), this may be referred to as true bi-prediction.
[0132] As described above, reconstructed samples and reconstructed pictures can be generated based on the derived predicted samples, and subsequent procedures such as in-loop filtering can be performed.
[0133] On the other hand, when bi-prediction is applied to the current block, a predicted sample may be derived based on a weighted average. For example, bi-prediction using a weighted average may be referred to as BCW (Bi-prediction with CU-level Weight), BWA (Bi-prediction with Weighted Average), or weighted averaging bi-prediction.
[0134] Conventionally, a bi-predictive signal (i.e., a bi-predictive sample) could be derived through a simple average of an L0 predicted signal (L0 predicted sample) and an L1 predicted signal (L1 predicted sample). That is, a bi-predictive sample was derived as an average of an L0 predicted sample based on an L0 reference picture and MVL0 and an L1 predicted sample based on an L1 reference picture and MVL1. However, when bi-prediction is applied, a bi-predictive signal (bi-predictive sample) may also be derived through a weighted average of an L0 predicted signal and an L1 predicted signal as follows: For example, a bi-predictive signal (bi-predictive sample) may be derived as shown in Equation 3.
[0135]
number
[0136] In Equation 3, P bi-pred P0 may indicate a value of a bi-predictive signal, i.e., a predicted sample value derived by applying bi-prediction, and w may indicate a weighting value. In addition, P0 may indicate a value of an L0 predicted signal, i.e., a predicted sample value derived by applying L0 prediction, and P1 may indicate a value of an L1 predicted signal, i.e., a predicted sample value derived by applying L1 prediction.
[0137] 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 candidate weights including -2, 3, 4, 5, or 10. For each CU to which bi-prediction is applied, the weight w may be determined by one of two methods. In the first method, for non-merged CUs, a weight index may be signaled after a motion vector difference. In the second method, for merged CUs, a weight index may be inferred from neighboring blocks based on merge candidate indexes.
[0138] For example, weighted average bi-prediction may be applied to a CU with 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 greater than or equal to 256. For low-delay pictures, 5 weights may be used, and for non-low-delay pictures, 3 weights may be used. For example, the 3 weights may include 3, 4, or 5.
[0139] 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 checked as a condition for the precision of 1-pel and 4-pel motion vectors. For example, when combined with affine (when affine prediction mode is used as the inter prediction mode), if affine prediction mode is selected as the current best mode, affine motion estimation (ME) can be performed for unequal weights. For example, if two bi-predictive reference pictures are identical, unequal weights can be checked as a condition. 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 weighting values may not be searched.
[0140] For example, a BCW weight index (or weight index) can be coded using one context-coded bin and subsequent bypass-coded bins. The first context-coded bin can indicate whether identical weights are used. If non-identical weights are used based on the first context-coded bin, additional bins can be signaled using bypass coding to indicate the non-identical weights to be used.
[0141] Meanwhile, according to one embodiment of the present document, when configuring motion vector candidates for a merge mode, if temporal motion vector candidates use bi-prediction, weight indexes for weighted averaging can be induced or derived. That is, if the inter-prediction type is bi-prediction, weight index information for temporal merge candidates (or temporal motion vector candidates) in a merge candidate list can be induced or derived.
[0142] For example, for a candidate temporal motion vector, the weight index for weighted averaging may always be derived as 0. Here, a weight index of 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, in this case, the procedure for deriving a motion vector of the luma component for merge mode is as shown in the following table.
[0143] [Table 1]
[0144] [Table 2]
[0145] [Table 3]
[0146] Tables 1 to 3 may show one procedure, and the procedure may be performed consecutively in the order of the tables. The procedure may include a procedure (8.4.2.2) for deriving a motion vector of a luma component for merge mode.
[0147] Referring to Tables 1 to 3, gbiIdx may indicate a bi-prediction weight index, and gbiIdxCol may indicate a bi-prediction weight index for a temporal merge candidate (e.g., a temporal motion vector candidate in a merge candidate list), and in the procedure for deriving a motion vector of the luma component for the merge mode (step 3 in 8.4.2.2), gbiIdxCol may be derived as 0. That is, the weight index of a temporal motion vector candidate may be derived as 0.
[0148] Alternatively, for example, a weight index for a weighted average of candidate temporal motion vectors can be derived as a weight index of a collocated block. Here, the collocated block may be referred to as a col block, a co-position block, or a co-position reference block, and a col block may indicate a block at the same position as the current block on the reference picture. For example, in this case, the procedure for deriving a motion vector of the luma component for merge mode is as shown in the following table.
[0149] [Table 4]
[0150] [Table 5]
[0151] [Table 6]
[0152] Tables 4 to 6 may show one procedure, and the procedures may be performed consecutively in the order of the tables. The procedures may include a procedure (8.4.2.2) for deriving a motion vector for the luma component for merge mode.
[0153] Referring to Tables 4 to 6, gbiIdx may indicate a bi-prediction weight index, and gbiIdxCol may indicate 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 for the luma component for the merge mode (step 3 in 8.4.2.2), gbiIdxCol may be derived as 0, but if the slice type or tile group type is B (step 4 in 8.4.2.2), gbiIdxCol may be derived as gbiIdxCol. That is, the weight index of a temporal motion vector candidate may be derived as the weight index of a col block.
[0154] Meanwhile, according to another embodiment of the present document, when constructing motion vector candidates for a subblock-based merge mode, if the temporal motion vector candidates use bi-prediction, weight indexes for weighted averaging can be induced or derived. Here, the subblock-based merge mode may be referred to as a (subblock-based) affine merge mode, and the temporal motion vector candidates may indicate subblock-based temporal motion vector candidates, also referred to as SbTMVP candidates. That is, when the inter prediction type is bi-prediction, weight index information for the SbTMVP candidates (or subblock-based temporal motion vector candidates) in the affine merge candidate list or the subblock merge candidate list can be induced or derived.
[0155] For example, a weight index for weighted averaging of sub-block-based temporal motion vector candidates may always be derived as 0. Here, a weight index of 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, in this case, the procedure for deriving motion vectors and reference indexes in the sub-block merge mode or the procedure for deriving sub-block-based temporal merge candidates is as shown in the following table.
[0156] [Table 7]
[0157] [Table 8]
[0158] [Table 9]
[0159] [Table 10]
[0160] [Table 11]
[0161] Tables 7 to 11 may show two procedures, which may be performed consecutively in the order of the tables, including a procedure for deriving motion vectors and reference indices in sub-block merge mode (8.4.4.2) or a procedure for deriving sub-block-based temporal merge candidates (8.4.4.3).
[0162] Referring to Tables 7 to 11, gbiIdx may indicate a bi-prediction weight index, and gbiIdxSbCol may indicate 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 for deriving the sub-block-based temporal merge candidate (8.4.4.3), gbiIdxSbCol may be derived as 0. That is, the weight index of a sub-block-based temporal motion vector candidate may be derived as 0.
[0163] Alternatively, for example, a weight index for weighted averaging of sub-block-based temporal motion vector candidates may be derived as a weight index of a temporal center block. For example, the temporal center block may indicate a col block or a sub-block or sample located at the center of the col block, and more specifically, may indicate 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, the procedure for deriving motion vectors and reference indexes in the sub-block merge mode, the procedure for deriving sub-block-based temporal merge candidates, or the procedure for deriving base motion information for sub-block-based temporal merge are as shown in the following table.
[0164] [Table 12]
[0165] [Table 13]
[0166] [Table 14]
[0167] [Table 15]
[0168] [Table 16]
[0169] [Table 17]
[0170] [Table 18]
[0171] [Table 19]
[0172] [Table 20]
[0173] Tables 12 to 20 may show three procedures, which may be performed consecutively in the order of the tables, including a procedure for deriving motion vectors and reference indices in sub-block merge mode (8.4.4.2), a procedure for deriving sub-block-based temporal merge candidates (8.4.4.3), or a procedure for deriving base motion information for sub-block-based temporal merge (8.4.4.4).
[0174] Referring to Tables 12 to 20, gbiIdx may indicate a bi-prediction weight index, and gbiIdxSbCol may indicate 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 for deriving base motion information for sub-block-based temporal merge (8.4.4.4), gbiIdxSbCol may be derived as gbiIdxcolCb. That is, a weight index for a sub-block-based temporal motion vector candidate may be derived as a temporal center block. For example, the temporal center block may indicate a col block or a sub-block or sample located at the center of the col block, and more specifically, may indicate a sub-block or sample located at the bottom right of the central four sub-blocks or samples of the col block.
[0175] Alternatively, for example, a weight index for weighted averaging of sub-block-based temporal motion vector candidates may be derived as a weight index for each sub-block, or if a sub-block is not available, as a weight index for a temporal center block. For example, the temporal center block may indicate a col block or a sub-block or sample located at the center of the col block, and more specifically, may indicate a sub-block or sample located at the bottom right of the four central sub-blocks or samples of the col block. In this case, for example, a procedure for deriving motion vectors and reference indexes in the sub-block merge mode, a procedure for deriving sub-block-based temporal merge candidates, or a procedure for deriving base motion information for sub-block-based temporal merge is as shown in the following table.
[0176] [Table 21]
[0177] [Table 22]
[0178] [Table 23]
[0179] [Table 24]
[0180] [Table 25]
[0181] [Table 26]
[0182] [Table 27]
[0183] [Table 28]
[0184] [Table 29]
[0185] Tables 21 to 29 may show three procedures, which may be performed consecutively in the order of the tables, including a procedure for deriving motion vectors and reference indices in sub-block merge mode (8.4.4.2), a procedure for deriving sub-block-based temporal merge candidates (8.4.4.3), or a procedure for deriving base motion information for sub-block-based temporal merge (8.4.4.4).
[0186] Referring to Tables 21 to 29, gbiIdx may indicate a bi-prediction weight index, gbiIdxSbCol may indicate 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 for deriving base motion information for sub-block-based temporal merge (8.4.4.3), gbiIdxSbCol may be derived as gbiIdxcolCb. Alternatively, depending on a condition (e.g., when availableFlagL0SbCol and availableFlagL1SbCol are all 0), in the procedure for deriving base motion information for sub-block-based temporal merging (8.4.4.3), the gbiIdxSbCol may be derived as ctrgbiIdx, and in the procedure for deriving base motion information for sub-block-based temporal merging (8.4.4.4), the ctrgbiIdx may be derived as gbiIdxSbCol. That is, the weight index of a candidate sub-block-based temporal motion vector may be derived as a weight index for each sub-block, or if a sub-block is unavailable, it may be derived as a temporal center block. For example, the temporal center block may indicate a col block or a sub-block or sample located at the center of the col block, and more specifically, may indicate the sub-block or sample located at the bottom right of the central four sub-blocks or samples of the col block.
[0187] Meanwhile, according to another embodiment of the present document, when constructing motion vector candidates for a merge mode, weighted indexes for pair-wise candidates may be induced or derived. In other words, pair-wise candidates may be included in a merge candidate list, and in this case, weighted indexes for weighted averaging of the pair-wise candidates may be derived. For example, 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, weighted indexes for weighted averaging may be derived. That is, if the inter-prediction type is bi-prediction, weighted index information for pair-wise candidates in the merge candidate list may be induced or derived.
[0188] For example, the pairwise candidate may be derived based on two merge candidates (e.g., cand0 and cand1) in the merge candidate list. If the pairwise candidate uses bi-prediction, the weighted index of the pairwise candidate may be derived based on the weighted index of the merge candidate cand0 and / or the merge candidate cand1. In other words, the weighted index of the pairwise candidate may be derived as the weighted index of one of the merge candidates (e.g., merge candidate cand0 or merge candidate cand1) used to derive the pairwise candidate. Alternatively, for example, the weighted index of the pairwise candidate may be derived at a specific ratio of the weighted indexes of the merge candidates (e.g., merge candidate cand0 and merge candidate cand1) used to derive the pairwise candidate. Here, the specific ratio may be 1:1, but may also be derived at a different ratio. For example, the specific ratio may be determined as a default ratio or a default value, but is not limited thereto, and the default ratio may be defined as a 1:1 ratio or a different ratio. Alternatively, for example, when deriving a weighted index for a pairwise candidate based on a specific ratio of the weighted indexes of merge candidates, the specific ratio may derive the same result as deriving the weighted index for the pairwise candidate as the weighted index of one of the merge candidates, as described above.
[0189] Meanwhile, according to another embodiment of the present document, when constructing motion vector candidates for a sub-block-based merge mode, if a (representative) motion vector candidate uses bi-prediction, weight indexes for weighted averaging can be induced or derived. That is, if the inter-prediction type is bi-prediction, weight index information for candidates (or affine merge candidates) in an affine merge candidate list or a sub-block merge candidate list can be induced or derived.
[0190] For example, among affine merge candidates, a constructed affine merge candidate may indicate a candidate for deriving an MVF as an affine model by deriving a CP0, CP1, CP2, or RB candidate based on motion information of a spatially adjacent block (or spatially neighboring block) or a temporally adjacent block (or temporally neighboring block) of the current block. For example, CP0 may indicate a control point located at the upper left sample position of the current block, CP1 may indicate a control point located at the upper right sample position of the current block, and CP2 may indicate a control point located at the lower left sample position of the current block. Also, RB may indicate a control point located at the lower right sample position of the current block.
[0191] For example, if the (representative) motion vector candidate is a constructed affine merge candidate (or a (current) affine merge candidate), the weight index of the (current) affine merge candidate may be derived as the weight index of a block determined by the motion vector at CP0 among the CP0 candidate blocks. Alternatively, the weight index of the (current) affine merge candidate may be derived as the weight index of a block determined by the motion vector at CP1 among the CP1 candidate blocks. Alternatively, the weight index of the (current) affine merge candidate may be derived as the weight index of a block determined by the motion vector at CP2 among the CP2 candidate blocks. Alternatively, the weight index of the (current) affine merge candidate may be derived as the weight index of a block determined by the motion vector at RB among the RB candidate blocks. Alternatively, the weight index of the (current) affine merge candidate may be derived based on at least one of the weight index of the block determined by the motion vector at CP0, the weight index of the block determined by the motion vector at CP1, the weight index of the block determined by the motion vector at CP2, or the weight index of the block determined by the motion vector at RB. For example, when deriving the weight index of the (current) affine merge candidate based on a plurality of weight indexes, a specific ratio of the plurality of weight indexes may be used. Here, the specific ratio may be 1:1, 1:1:1, or 1:1:1:1, but may also be derived using another ratio. For example, the specific ratio may be determined using a default ratio or a default value, but is not limited thereto. The default ratio may be defined as a 1:1 ratio, but may also be defined as another ratio.
[0192] Alternatively, the weight index of the (current) affine merge candidate may be derived as the weight index of the candidate that occurs most frequently among the weight indexes of the candidates. For example, the weight index of the (current) affine merge candidate may be derived as the weight index of the (current) affine merge candidate, which overlaps most among the weight index of the candidate block determined by the motion vector at CP0 among the CP0 candidate blocks, the weight index of the candidate block determined by the motion vector at CP1 among the CP1 candidate blocks, the weight index of the candidate block determined by the motion vector at CP2 among the CP2 candidate blocks, and / or the weight index of the candidate block determined by the motion vector at RB among the RB candidate blocks.
[0193] For example, CP0 and CP1 may be used as the control points, or CP0, CP1, and CP2 may be used, and RB may not be used. However, for example, when using RB candidates for an affine block (a block coded in affine prediction mode), the method of inducing or deriving a weighted index for a temporal candidate block described in the above embodiment may be used. For example, CP0, CP1, or CP2 may derive candidates based on spatial neighboring blocks of the current block, and a block to be used as a motion vector for CP0, CP1, or CP2 (i.e., CPMV1, CPMV2, or CPMV3) may be determined from the candidates. Alternatively, for example, RB may derive candidates based on temporal neighboring blocks of the current block, and a block to be used as a motion vector for RB may be determined from the candidates.
[0194] Alternatively, for example, if a (representative) motion vector candidate is an SbTMVP (or ATMVP) candidate, the weight index of the SbTMVP candidate can be derived as the weight index of the neighboring block on the left side of the current block. That is, if a candidate derived from SbTMVP (or ATMVP) uses bi-prediction, the weight index of the neighboring block on the left side of the current block can be derived as the weight index for the sub-block-based merge mode. That is, if the inter-prediction type is bi-prediction, weight index information for the SbTMVP candidate in the affine merge candidate list or the sub-block merge candidate list can be derived or derived.
[0195] For example, since an SbTMVP candidate can derive a col block based on the spatially adjacent left block (or left neighboring block) of the current block, the weight index of the left neighboring block can be considered reliable. Thus, the weight index of the SbTMVP candidate can be derived as the weight index of the left neighboring block.
[0196] 10 and 11 show a schematic diagram of an example of a video / image encoding method and associated components according to an embodiment of the present document.
[0197] The method disclosed in Fig. 10 may be performed by the encoding apparatus disclosed in Fig. 2 or Fig. 11. Specifically, for example, S1000 to S1030 of Fig. 10 may be performed by the prediction unit 220 of the encoding apparatus 200 of Fig. 11, and S1040 of Fig. 10 may be performed by the entropy encoding unit 240 of the encoding apparatus 200 of Fig. 11. Also, although not shown in Fig. 10, the prediction unit 220 of the encoding apparatus 200 in Fig. 11 may derive prediction samples or prediction-related information, the residual processing unit 230 of the encoding apparatus 200 may derive residual information from original samples or prediction samples, and the entropy encoding unit 240 of the encoding apparatus 200 may generate a bitstream from the residual information or prediction-related information. The method disclosed in Fig. 10 may include the embodiments described above in this document.
[0198] 10, an encoding apparatus may determine an inter prediction mode of a current block and generate inter prediction mode information indicating the inter prediction mode (S1000). 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 may generate inter prediction mode information indicating the same.
[0199] The encoding apparatus may generate a merge candidate list for the current block based on the inter prediction mode (S1010). For example, the encoding apparatus may generate the merge candidate list according to a 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 may simply be referred to as a merge candidate list.
[0200] 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 indicate a candidate or a candidate block for deriving motion information (or a motion vector) of the current block. For example, a candidate block may be derived through a search of neighboring blocks of the 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 (spatial merge) candidates, and then the temporal neighboring blocks may be searched and derived as (temporal merge) candidates. The derived candidates 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 the 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(s) (if the slice / tile group type of the current slice / tile group is type B), and / or zero vector merge candidate(s).
[0201] Alternatively, for example, candidates can 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 candidate can include the CPMV (Control Point Motion Vector) of the current block. Alternatively, the candidate can indicate a candidate or candidate block for deriving the CPMV. The CPMV can indicate a motion vector at a 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 at the upper left side (or upper left corner), upper right side (or upper right corner), lower left side (or lower left corner), or lower right side (or lower right corner) of the current block, and only one CP can exist for each position.
[0202] 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, and zero motion vector candidates. For example, the affine merge candidate list may initially include the inherited affine merge candidates, and then include 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 added to the affine merge candidate list, the remaining candidates may be filled with zero motion vector candidates. Here, zero motion vector candidates are sometimes 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 the sub-block merge candidate list, and the sub-block merge candidate list may also include candidates derived as 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 and constructed affine merge candidates in the sub-block merge candidate list.
[0203] The encoding apparatus may select one of the candidates included in the merge candidate list and generate selection information indicating the selected candidate (S1020). For example, the merge candidate list may include at least a portion of spatial merge candidates, temporal merge candidates, pairwise candidates, or zero vector candidates, and one of such candidates may be selected for inter prediction of the current block. Alternatively, for example, the merge candidate list of a sub-block may include at least a portion of inherited affine merge candidates, constructed affine merge candidates, SbTMVP candidates, or zero vector candidates, and one of such candidates may be selected for inter prediction of the current block.
[0204] 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.
[0205] The encoding apparatus may generate inter-prediction type information indicating the inter-prediction type of the current block as bi-prediction (S1030). For example, the inter-prediction type of the current block may be determined as bi-prediction among L0 prediction, L1 prediction, or bi-prediction, and inter-prediction type information indicating this may be generated. Here, L0 prediction may indicate reference picture list 0-based prediction, L1 prediction may indicate reference picture list 1-based prediction, and bi-prediction may indicate 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 a syntax element of inter_pred_idc.
[0206] The encoding apparatus may encode video information including inter-prediction mode information, selection information, and inter-prediction type information (S1040). 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.
[0207] Although not shown in FIG. 10 , 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.
[0208] In other words, for example, the encoding apparatus may generate L0 predicted samples and L1 predicted samples of the current block based on the selected candidate. 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 indicate predicted samples of the current block derived based on reference picture list 0, and the L1 predicted samples may indicate predicted samples of the current block derived based on reference picture list 1.
[0209] For example, the candidates may include spatial merge candidates. For example, if the selected candidate is the spatial merge candidate, L0 motion information and L1 motion information can be derived based on the spatial merge candidate, and the L0 prediction sample and the L1 prediction sample can be generated based on this.
[0210] 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 this.
[0211] 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.
[0212] 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, where sub-block affine merge candidates may also be referred to as sub-block merge candidates.
[0213] For example, the candidates may include sub-block merging candidates. For example, if the selected candidate is a 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.
[0214] Here, the CPMV can be represented 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 on the upper left side (or upper left corner), upper right side (or upper right corner), lower left side (or lower left corner), or lower right side (or lower right corner) of the current block, and there can be only one CP per position.
[0215] 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. 8.
[0216] 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 above and adjacent to the left of the neighboring block at the upper right corner. Alternatively, the neighboring blocks may include block B0 or block B1 in FIG. 8.
[0217] 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 left of the neighboring block at the lower left corner. Alternatively, the neighboring blocks may include block A0 or block A1 in FIG. 8.
[0218] 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. 8.
[0219] 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 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.
[0220] For example, the L0 motion information may include an index of an L0 reference picture and an L0 motion vector, etc., and the L1 motion information may include an index of an L1 reference picture and an L1 motion vector, etc. The index of an L0 reference picture may include information indicating a reference picture in reference picture list 0, and the index of an L1 reference picture may include information indicating a reference picture in reference picture list 1.
[0221] 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 indicated based on weight index information. The weight index information may indicate 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 indicate index information for a weight used in the weighted average, and weight index information may be generated in a procedure for generating a predicted sample based on the weighted average. 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 in BCW (Bi-prediction with CU-level Weight) or BWA (Bi-prediction with Weighted Average).
[0222] For example, the candidates may include temporal merge candidates, and the weight index information may be indicated by 0. That is, the weight index information for the temporal merge candidates may be indicated by 0. Here, the 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 indicated based on the weight index information of col blocks. That is, the weight index information for the temporal merge candidates may be indicated based on the weight index information of col blocks. Here, the col blocks may include blocks at the same position as the current block in a reference picture different from the current picture in which the current block is located.
[0223] Alternatively, for example, the candidates may include a pair-wise candidate, and the weight index information may be indicated by the weight index information of one of the other two candidates in the merge candidate list used to derive the pair-wise candidate. That is, the weight index information for the pair-wise candidate may be indicated by the weight index information of one of the other two candidates in the merge candidate list used to derive the pair-wise candidate. Alternatively, for example, the weight index information may be indicated based on the weight index information of the two candidates.
[0224] 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, where sub-block affine merge candidates may also be referred to as sub-block merge candidates.
[0225] For example, the candidates may include sub-block merging candidates, and the weight index information may be indicated based on weight index information of a specific block among neighboring blocks of the CP of the current block. That is, the weight index information for the sub-block merging candidate may be indicated based on weight index information of a specific block among neighboring blocks of the CP of the current block. Here, the specific block may be a block used to derive a CPMV for the CP. Alternatively, the specific block may be a block among neighboring blocks of the CP of the current block that has an MV used as the CPMV.
[0226] For example, the CP may be CP0 located at the upper left corner of the current block. In this case, the weight index information may be represented based on weight index information of a neighboring block at the upper left corner of the current block, weight index information of a neighboring block on the left side adjacent to the lower side of the neighboring block at the upper left corner, or weight index information of a neighboring block on the upper right side adjacent to the neighboring block at the upper left corner. Alternatively, the weight index information may be represented based on weight index information of block A2, block B2, or block B3 in FIG. 8.
[0227] Alternatively, for example, the CP may be CP1 located at the upper right side of the current block. In this case, the weight index information may be represented based on the weight index information of a neighboring block at the upper right corner of the current block or the weight index information of a neighboring block on the upper left side of the neighboring block at the upper right corner. Alternatively, the weight index information may be represented based on the weight index information of block B0 or block B1 in FIG. 8.
[0228] Alternatively, for example, the CP may be CP2 located at the lower left of the current block. In this case, the weight index information may be represented based on the weight index information of a neighboring block at the lower left corner of the current block or the weight index information of a neighboring block on the left side adjacent to the upper side of the neighboring block at the lower left corner of the current block. Alternatively, the weight index information may be represented based on the weight index information of block A0 or block A1 in FIG. 8.
[0229] 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 weight index information may be represented based on weight index information of a col block of the current block or weight index information of a neighboring block 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 weight index information may be represented based on weight index information of a T block in FIG. 8.
[0230] Alternatively, for example, the CP may include a plurality of CPs. For example, the plurality of CPs may include at least two of CP0, CP1, CP2, and RB. In this case, the weight index information may be indicated based on the most overlapping weight index information among the weight index information of specific blocks used to derive each of the CPMVs. Alternatively, the weight index information may be indicated based on the most frequently occurring weight index information among the weight index information of the specific blocks. That is, the weight index information may be indicated based on the weight index information of specific blocks used to derive the CPMV for each of the plurality of CPs.
[0231] Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be indicated based on the weight index information of neighboring blocks to the left of the current block. That is, the weight index information for SbTMVP candidates may be indicated based on the weight index information of the neighboring blocks to the left. Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be indicated as 0. That is, the weight index information for SbTMVP candidates may be indicated 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. Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be indicated based on the weight index information of a center block in a col block. That is, the weight index information for SbTMVP candidates may be indicated based on the weight index information of a center block in a 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, and the center block may include the lower right sub-block of four sub-blocks located at the center of the col block. Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be indicated 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 indicated based on the weight index information of each sub-block of the col block.
[0232] Alternatively, although not shown in FIG. 10 , 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.
[0233] 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.
[0234] 12 and 13 show a schematic diagram of an example of a video / image decoding method and related components according to an embodiment of the present document.
[0235] The method disclosed in Figure 12 may be performed by the decoding apparatus disclosed in Figure 3 or Figure 13. Specifically, for example, S1200 of Figure 12 may be performed by the entropy decoding unit 310 of the decoding apparatus 300 in Figure 13, and S1210 to S1260 of Figure 12 may be performed by the prediction unit 330 of the decoding apparatus 300 in Figure 13. Also, although not shown in Figure 12, in Figure 13, 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. 12 may include the embodiments previously described in this document.
[0236] 12, a decoding device may receive image information including inter-prediction mode information and inter-prediction type information via a bitstream (S1200). For example, the image information may also 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.
[0237] For example, the prediction-related information may include inter-prediction mode information or inter-prediction type information. For example, the inter-prediction mode information may include information indicating at least a portion 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 auxiliary mode. For example, the inter-prediction type information may include a syntax element of inter_pred_idc. Alternatively, the inter-prediction type information may include information indicating L0 prediction, L1 prediction, or bi-prediction.
[0238] The decoding apparatus may generate a merge candidate list for the current block based on inter prediction mode information (S1210). 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 may be simply referred to as a merge candidate list.
[0239] 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 refer to 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 (spatial merge) candidates, and then the temporal neighboring blocks may be searched to derive (temporal merge) candidates. The derived candidates 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 the 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(s) (if the slice / tile group type of the current slice / tile group is type B), and / or zero vector merge candidate(s).
[0240] Alternatively, for example, candidates can 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 candidate can include the CPMV (Control Point Motion Vector) of the current block. Alternatively, the candidate can indicate a candidate or candidate block for deriving the CPMV. The CPMV can indicate a motion vector at a 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 at the upper left side (or upper left corner), upper right side (or upper right corner), lower left side (or lower left corner), or lower right side (or lower right corner) of the current block, and only one CP can exist for each position.
[0241] 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 initially include the inherited affine merge candidates, and then include 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 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 the sub-block merge candidate list, and the sub-block merge candidate list may also include candidates derived as 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 and constructed affine merge candidates in the sub-block merge candidate list.
[0242] The decoding apparatus may select one of the candidates included in the merge candidate list (S1220). For example, the merge candidate list may include at least a portion 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 a portion 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 also 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.
[0243] The decoding apparatus may derive the inter prediction type of the current block as bi-prediction based on the inter prediction type information (S1230). 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 prediction based on reference picture list 0 and reference picture list 1. For example, the inter prediction type information may include a syntax element of inter_pred_idc.
[0244] The decoding apparatus may derive motion information of the current block based on the selected candidate (S1240). For example, the decoding apparatus may derive L0 motion information and L1 motion information based on the selected candidate by deriving the inter prediction type as bi-prediction. For example, the L0 motion information may include an index of an L0 reference picture and an L0 motion vector, etc., and the L1 motion information may include an index of an L1 reference picture and an L1 motion vector, etc. The index of the L0 reference picture 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.
[0245] The decoding apparatus may generate L0 predicted samples and L1 predicted samples of the current block based on the motion information (S1250). For example, if the inter prediction type of the current block is derived as bi-prediction, reference picture list 0 and reference picture list 1 may be used to predict the current block. For example, the L0 predicted samples may indicate predicted samples of the current block derived based on reference picture list 0, and the L1 predicted samples may indicate predicted samples of the current block derived based on reference picture list 1.
[0246] For example, the candidates may include spatial merge candidates. For example, if the selected candidate is the spatial merge candidate, L0 motion information and L1 motion information can be derived based on the spatial merge candidate, and the L0 prediction sample and the L1 prediction sample can be generated based on this.
[0247] 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 can be derived based on the temporal merge candidate, and the L0 prediction sample and the L1 prediction sample can be generated based on this.
[0248] 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.
[0249] 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, where sub-block affine merge candidates may also be referred to as sub-block merge candidates.
[0250] 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.
[0251] 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 on the upper left side (or upper left corner), upper right side (or upper right corner), lower left side (or lower left corner), or lower right side (or lower right corner) of the current block, and there can be only one CP per position.
[0252] 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. 8.
[0253] 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 above and adjacent to the left of the neighboring block at the upper right corner. Alternatively, the neighboring blocks may include block B0 or block B1 in FIG. 8.
[0254] 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. 8.
[0255] 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. 8.
[0256] 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 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.
[0257] 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 (S1260). For example, the weight information may be derived based on weight index information. For example, the weight information may include information for weighted averaging 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 averaging, and the weighted averaging 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 averaging may indicate a weighted averaging using BCW (Bi-prediction with CU-level Weight) or BWA (Bi-prediction with Weighted Average).
[0258] For example, the candidates may include temporal merge candidates, and the weight index information may be derived as 0. That is, the weight index information for the temporal merge candidates may be derived as 0. Here, the 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 derived based on the weight index information of a col block. That is, the weight index information for the temporal merge candidates may be derived based on the weight index information of a col block. Here, the col block may include a block at the same position as the current block in a reference picture different from the current picture in which the current block is located.
[0259] Alternatively, for example, the candidates may include a pair-wise candidate, and the weighted index information may be derived as the weighted index information of one of the other two candidates in the merge candidate list used to derive the pair-wise candidate. That is, the weighted index information for the pair-wise candidate may be derived as the weighted index information of one of the other two candidates in the merge candidate list used to derive the pair-wise candidate. Alternatively, for example, the weighted index information may be derived based on the weighted index information of the two candidates.
[0260] 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, where sub-block affine merge candidates may also be referred to as sub-block merge candidates.
[0261] For example, the candidates may include sub-block merging candidates, and the weight index information may be derived based on weight index information of a specific block among neighboring blocks of the CP of the current block. That is, the weight index information for the sub-block merging candidate may be derived based on weight index information of a specific block among neighboring blocks of the CP of the current block. Here, the specific block may be a block used to derive a CPMV for the CP. Alternatively, the specific block may be a block among neighboring blocks of the CP of the current block having an MV used as the CPMV.
[0262] For example, the CP may be CP0 located at the upper left corner of the current block. In this case, the weight index information may be derived based on weight index information of a neighboring block at the upper left corner of the current block, weight index information of a neighboring block on the left side adjacent to the lower side of the neighboring block at the upper left corner, or weight index information of a neighboring block on the upper right side adjacent to the neighboring block at the upper left corner. Alternatively, the weight index information may be derived based on weight index information of block A2, block B2, or block B3 in FIG. 8.
[0263] Alternatively, for example, the CP may be CP1 located at the upper right side of the current block. In this case, the weight index information may be derived based on weight index information of a neighboring block at the upper right corner of the current block or weight index information of a neighboring block above and adjacent to the lower side of the neighboring block at the upper right corner. Alternatively, the weight index information may be derived based on weight index information of block B0 or block B1 in FIG. 8.
[0264] Alternatively, for example, the CP may be CP2 located at the lower left of the current block. In this case, the weight index information may be derived based on weight index information of a neighboring block at the lower left corner of the current block or weight index information of a neighboring block on the left side adjacent to the upper side of the neighboring block at the lower left corner of the current block. Alternatively, the weight index information may be derived based on weight index information of block A0 or block A1 in FIG. 8.
[0265] 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 weight index information may be derived based on weight index information of a col block of the current block or weight index information of a neighboring block 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 weight index information may be derived based on weight index information of a T block in FIG. 8.
[0266] Alternatively, for example, the CP may include a plurality of CPs. For example, the plurality of CPs may include at least two of CP0, CP1, CP2, and RB. In this case, the weight index information may be derived based on the most overlapping weight index information among the weight index information of specific blocks used to derive each of the CPMVs. Alternatively, the weight index information may be derived based on the most frequently occurring weight index information among the weight index information of the specific blocks. That is, the weight index information may be derived based on the weight index information of specific blocks used to derive the CPMV for each of the plurality of CPs.
[0267] Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be derived based on weight index information of neighboring blocks to the left of the current block. That is, the weight index information for the SbTMVP candidates may be derived based on weight index information of the neighboring blocks to the left. Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be derived as 0. That is, the weight index information for the SbTMVP candidates may be derived as 0. Here, weight index information of 0 may indicate that the weights of the reference directions (i.e., the L0 prediction direction and the L1 prediction direction in bi-prediction) are the same. Alternatively, for example, the candidates may include SbTMVP candidates, and the weight index information may be derived based on weight index information of a center block in a col block. That is, the weight index information for the SbTMVP candidates may be derived based on weight index information of a center block in a col block. Here, the col block may include a block 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, and the center block may include the lower right sub-block of four sub-blocks located at the center of the col block. 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.
[0268] Although not shown in Figure 12, 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.
[0269] For example, a decoding device can decode a bitstream or encoded information to obtain video information including all or part of the above-described information (or syntax elements). Also, the bitstream or encoded information can be stored in a computer-readable storage medium and can be used to cause the above-described decoding method to be performed.
[0270] In the above-described embodiments, the method is described based on a flowchart as a series of steps or blocks, but the embodiments are 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. Furthermore, those skilled in the art will understand that the steps shown in the flowcharts are not exclusive, and that different steps may be included, or one or more steps in the flowcharts may be deleted without affecting the scope of the embodiments herein.
[0271] The methods according to the embodiments of the present document described above may be implemented in the form of software, and the encoding device and / or decoding device according to the present document may be included in devices that perform video processing, such as TVs, computers, smartphones, set-top boxes, display devices, etc.
[0272] When the embodiments described herein are implemented in software, the methods described above may be implemented with modules (processes, functions, etc.) that perform the functions described above. The modules may be stored in 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 on a processor, microprocessor, controller, or chip. For example, the functional units illustrated in the figures may be implemented 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.
[0273] 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 customized 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, a video 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 video signals or data signals. For example, over-the-top (OTT) video (over-the-top) devices may include a game console, a Blu-ray player, an internet access TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), etc.
[0274] In addition, a processing method to which the embodiments of this document are 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 the embodiments 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. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. The computer-readable recording medium may also include media embodied in the form of a carrier wave (e.g., transmission via the Internet). The bitstream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.
[0275] Furthermore, the embodiments of the present document may be embodied in a computer program product with 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.
[0276] FIG. 14 illustrates an example of a content streaming system to which the embodiments disclosed herein can be applied.
[0277] Referring to FIG. 14, 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.
[0278] 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.
[0279] The bitstream can be generated by an encoding method or a bitstream generation method to which an embodiment of this document is applied, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.
[0280] 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.
[0281] 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.
[0282] Examples of the user device include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a PDA (personal digital assistant), a PMP (portable multimedia player), a navigation system, a slate PC, a tablet PC, an ultrabook, a wearable device (e.g., a smartwatch, a smart glass, a head mounted display (HMD)), a digital TV, a desktop computer, a digital signage, etc.
[0283] 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.
[0284] The claims described herein may be combined in various ways. For example, technical features of method claims herein may be combined to be embodied as an apparatus, and technical features of apparatus claims herein may be combined to be embodied as a method. Furthermore, technical features of method claims herein and technical features of apparatus claims herein may be combined to be embodied as an apparatus, and technical features of method claims herein and technical features of apparatus claims herein may be combined to be embodied as a method.
Claims
1. A video decoding method performed by a decoding device, 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; selecting one candidate from the merge candidate list; deriving motion information of the current block based on the selected candidate; generating L0 predicted samples and L1 predicted samples based on the derived motion information; generating a prediction sample of 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 include inherited affine merge candidates and constructed affine merge candidates; The inherited affine merge candidate is derived based on the Control Point Motion Vector (CPMV) of neighboring blocks of the current block; the constructed affine merge candidate includes a plurality of CPMVs of control points (CPs); Based on the fact that the constructed affine merge candidate includes a CPMV for CP0 (Control Point 0) and bi-prediction is applied to the current block, weight index information for the constructed affine merge candidate is fixed to be equal to weight index information of a specific block among neighboring blocks of the CP0 of the current block, the CP0 being associated with the upper left corner of the current block; the specific block is a block used to derive the CPMV for the CP0; The constructed affine merge candidate is inserted in the merge candidate list after the inherited affine merge candidate.
2. 2. The image decoding method of claim 1, wherein the neighboring blocks include a neighboring block in the upper left corner of the current block, a left neighboring block adjacent to the lower side of the neighboring block in the upper left corner, and an upper neighboring block adjacent to the right side of the neighboring block in the upper left corner.
3. the candidates include pair-wise candidates; the pairwise candidates are derived based on two different candidates from the candidates; The video decoding method of claim 1 , wherein the weight index information for the pairwise candidates is derived based on weight index information of one of the two candidates.
4. the candidates include subblock-based temporal merge candidates; The image decoding method of claim 1 , wherein the weight index information for the sub-block-based temporal merging candidate is derived based on weight index information of a neighboring block to the left of the current block.
5. the candidates include sub-block based temporal merging candidates; The video decoding method of claim 1 , wherein the weight index information for the sub-block-based temporal merging candidate is derived as 0.
6. the candidates include subblock-based temporal merge candidates; weight index information for the sub-block-based temporal merging candidate is derived based on weight index information of a center block in a col block; The col block includes 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, 2. The image decoding method of claim 1, wherein the center block is a lower right sub-block among four sub-blocks located at the center of the Col block.
7. the candidates include subblock-based temporal merge candidates; The weight index information for the sub-block-based temporal merge candidate is derived based on weight index information of each sub-block of a col block; The video decoding method of claim 1 , wherein the collocating blocks 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.
8. A video encoding method performed by an encoding device, 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; selecting one candidate from the candidates included in the merge candidate list and generating selection information indicating the selected candidate; encoding video information including the inter prediction mode information and the selection information; the candidates include inherited affine merge candidates and constructed affine merge candidates, the constructed affine merge candidates including a Control Point Motion Vector (CPMV); The inherited affine merge candidate is derived based on the Control Point Motion Vector (CPMV) of neighboring blocks of the current block; the constructed affine merge candidate includes a plurality of CPMVs of control points (CPs); Based on the fact that the constructed affine merge candidate includes a CPMV for CP0 (Control Point 0) and bi-prediction is applied to the current block, weight index information for the constructed affine merge candidate is fixed to be equal to weight index information of a specific block among neighboring blocks of CP0 (Control Point 0) of the current block, where CP0 is associated with the upper left corner of the current block; the specific block is a block used to derive a CPMV for the CP0; The constructed affine merge candidate is inserted in the merge candidate list after the inherited affine merge candidate.
9. A transmission method for video data, comprising: a transmitting device obtaining encoded video information, the encoded video information being generated by: determining an inter prediction mode of a current block; 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; selecting one of the candidates included in the merge candidate list; generating selection information indicating the selected candidate; and encoding video information including the inter prediction mode information and the selection information; the transmitting device transmitting the video data for the encoded video information; the candidates include inherited affine merge candidates and constructed affine merge candidates, the constructed affine merge candidates including a Control Point Motion Vector (CPMV); The inherited affine merge candidate is derived based on the Control Point Motion Vector (CPMV) of neighboring blocks of the current block; the constructed affine merge candidate includes a plurality of CPMVs of control points (CPs); Based on the fact that the inherited affine merge candidate includes a CPMV for CP0 (Control Point 0) and bi-prediction is applied to the current block, weight index information for the constructed affine merge candidate is fixed to be equal to weight index information of a specific block among neighboring blocks of CP0 (Control Point 0) of the current block, where CP0 is associated with the upper left corner of the current block; The specific block is a block used to derive a CPMV for the CP0, The constructed affine merge candidate is inserted into the merge candidate list after the inherited affine merge candidate.