Image encoding / decoding method and apparatus, and recording medium storing bit stream

By dividing image patches into multiple partitions and employing bidirectional and weighted prediction methods, the problems of insufficient image compression efficiency and prediction performance in existing technologies are solved, achieving more efficient image compression and accurate prediction.

CN120958818APending Publication Date: 2025-11-14LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202480026484.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-04-22
Filing Date
2024-04-19
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively utilize bidirectional prediction and bit precision adjustment in high-resolution and high-quality image compression, resulting in insufficient compression efficiency and prediction performance.

Method used

By dividing the current block into multiple partitions, a bidirectional prediction method is used to derive the prediction block for each partition. The bit precision is adjusted based on weighted prediction and illumination compensation parameters, and prediction is performed by combining motion vectors and neighboring region information.

Benefits of technology

It improves the efficiency of image compression and prediction performance, and enhances the accuracy of bidirectional prediction and the ability to adjust bit precision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120958818A_ABST
    Figure CN120958818A_ABST
Patent Text Reader

Abstract

The method and apparatus for decoding / encoding an image according to the present disclosure may comprise: dividing a current block into a plurality of partitions including a first partition and a second partition; deriving a first prediction block of the first partition; deriving a second prediction block of the second partition; and deriving a prediction block of the current block based on the first prediction block and the second prediction block. Here, at least one of the first prediction block or the second prediction block may be derived using bidirectional prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to an image encoding / decoding method and apparatus, as well as a recording medium for storing bit streams. Background Technology

[0002] Recently, the demand for high-resolution and high-quality images, such as HD (high-definition) and UHD (ultra-high-definition) images, has been increasing in various application areas, and therefore, efficient image compression technologies are being discussed.

[0003] Various techniques exist, such as inter-frame prediction techniques that use video compression technology to predict pixel values ​​included in the current frame from frames before or after the current frame, intra-frame prediction techniques that use pixel information in the current frame to predict pixel values ​​included in the current frame, and entropy coding techniques that assign short symbols to values ​​that occur frequently and long symbols to values ​​that occur infrequently. These image compression techniques can be used to effectively compress image data and send or store it. Summary of the Invention

[0004] Technical issues

[0005] This disclosure aims to provide a bidirectional prediction method and apparatus for each partition of the current block.

[0006] This disclosure aims to provide a method and apparatus for adjusting bit precision by taking into account the internal / output bit depth.

[0007] This disclosure aims to provide a method and apparatus for efficiently deriving and storing information for weighted prediction.

[0008] Technical solution

[0009] The image decoding method and apparatus of this disclosure can divide a current block into multiple partitions, including a first partition and a second partition, derive a first prediction block for the first partition, derive a second prediction block for the second partition, and derive a prediction block for the current block based on the first and second prediction blocks. Here, at least one of the first or second prediction blocks can be derived through bidirectional prediction.

[0010] In the image decoding method and apparatus according to the present disclosure, when bidirectional prediction is performed on the first partition, L0 prediction blocks and L1 prediction blocks can be derived for the first partition, and the first prediction block can be derived based on the weighted sum of the L0 prediction blocks and L1 prediction blocks.

[0011] In the image decoding method and apparatus according to this disclosure, the weights of the weighted sum can be determined based on any one of a plurality of weight candidates belonging to a predefined weight set.

[0012] In the image decoding method and apparatus according to the present disclosure, deriving the first prediction block may include: determining a predetermined search range based on the motion vector of the first partition; calculating the cost of each search position within the search range; and deriving the L0 prediction block and L1 prediction block of the first partition based on the search position having the minimum cost among the calculated costs.

[0013] In the image decoding method and apparatus according to the present disclosure, the cost can be calculated as the sum of absolute differences (SAD) between the weighted L0 block at the search location and the weighted L1 block corresponding to the weighted L0 block.

[0014] In the image decoding method and apparatus according to the present disclosure, deriving the first prediction block may include: applying a first illumination compensation parameter to the L0 prediction block of the first partition to generate an illumination compensation L0 prediction block; applying a second illumination compensation parameter to the L1 prediction block of the first partition to generate an illumination compensation L1 prediction block; and deriving the first prediction block based on a weighted sum of the illumination compensation L0 prediction block and the illumination compensation L1 prediction block.

[0015] In the image decoding method and apparatus according to the present disclosure, a first illumination compensation parameter can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction block, and a second illumination compensation parameter can be derived based on the neighboring regions of the current block and the neighboring regions of the L1 prediction block.

[0016] In the image decoding method and apparatus according to this disclosure, the weights of the weighted sum can be determined based on any one of a plurality of weight candidates belonging to a predefined weight set.

[0017] In the image decoding method and apparatus according to the present disclosure, the value of a sample of the first prediction block can be derived based on at least one of the value of a sample of the L0 prediction block belonging to the first partition, the value of a sample of the L1 prediction block belonging to the first partition, or a predetermined offset.

[0018] In the image decoding method and apparatus according to the present disclosure, the offset can be derived based on at least one of the horizontal and vertical gradients at the location of a sample belonging to the L0 prediction block or the horizontal and vertical gradients at the location of a sample belonging to the L1 prediction block.

[0019] In the image decoding method and apparatus according to this disclosure, each of the first partition and the second partition can be a block encoded in any of the following modes: merge mode, intra-block copy (IBC) mode, or template matching-based prediction (TMP) mode.

[0020] In the image decoding method and apparatus according to this disclosure, a BCW index can be obtained for each of the first and second partitions. The BCW index can specify any one of a plurality of weight candidates belonging to a predefined weight set.

[0021] In the image decoding method and apparatus according to the present disclosure, the current block can be divided into a first region, a second region, and a mixed region, and either the BCW index of the first partition or the BCW index of the second partition can be selectively stored in the mixed region.

[0022] In the image decoding method and apparatus according to the present disclosure, the first prediction block and the second prediction block may have the same bit precision as the internal bit depth, and the prediction block of the current block may have the same bit precision as the output bit depth.

[0023] In the image decoding method and apparatus according to the present disclosure, the L0 prediction block or L1 prediction block of the first partition and the second partition can have the same bit precision as the internal bit depth, and the first prediction block of the first partition and the second prediction block of the second partition can have the same bit precision as the output bit depth.

[0024] The image coding method and apparatus of this disclosure can divide a current block into multiple partitions, including a first partition and a second partition, derive a first prediction block for the first partition, derive a second prediction block for the second partition, and derive a prediction block for the current block based on the first and second prediction blocks. Here, at least one of the first or second prediction blocks can be derived through bidirectional prediction.

[0025] A computer-readable digital storage medium is provided for storing encoded video / image information, which enables a decoding device according to the present disclosure to perform an image decoding method.

[0026] A computer-readable digital storage medium is provided for storing video / image information generated based on the image encoding method of this disclosure.

[0027] A method and apparatus are provided for transmitting video / image information generated according to the image encoding method of this disclosure.

[0028] Beneficial effects

[0029] According to this disclosure, compression efficiency can be improved by allowing bidirectional prediction of each partition of the current block.

[0030] According to this disclosure, when performing bidirectional prediction on each partition of the current block, prediction performance can be improved by adjusting bit precision by taking into account the internal / output bit depth.

[0031] According to this disclosure, by applying weighted prediction, illumination compensation, motion vector modification, etc., when performing bidirectional prediction, the accuracy of bidirectional prediction can be increased and the compression efficiency can be improved.

[0032] According to this disclosure, information for weighted prediction can be efficiently derived and stored. Attached Figure Description

[0033] Figure 1 A video / image encoding system according to this disclosure is shown.

[0034] Figure 2 A schematic block diagram of an encoding apparatus to which embodiments of the present disclosure are applicable and which performs encoding of video / image signals is shown.

[0035] Figure 3 A schematic block diagram of a decoding apparatus to which embodiments of the present disclosure are applicable and which performs decoding of video / image signals is shown.

[0036] Figure 4 An inter-frame prediction method is shown, performed by a decoding device 300 as an embodiment of the present disclosure.

[0037] Figure 5 A schematic configuration of an inter-frame predictor 332 performing the inter-frame prediction method according to this disclosure is shown.

[0038] Figure 6 An inter-frame prediction method is shown, performed by an encoding device 200 as an embodiment of the present disclosure.

[0039] Figure 7 A schematic configuration of an inter-frame predictor 221 performing the inter-frame prediction method according to this disclosure is shown.

[0040] Figure 8 Examples of content streaming systems to which embodiments of this disclosure can be applied are shown. Detailed Implementation

[0041] Because this disclosure can be modified in various ways and has multiple embodiments, specific embodiments will be shown in the accompanying drawings and described in detail in the specific embodiments. However, this disclosure is not intended to be limited to the specific embodiments, but should be understood to include all changes, equivalents, and substitutions included within the spirit and scope of this disclosure. Similar reference numerals are used for similar components in the description of the various figures.

[0042] Terms such as "first," "second," etc., may be used to describe various components, but components should not be limited by these terms. Terms are used only to distinguish one component from others. For example, without departing from the scope of this disclosure, a first component may be referred to as a second component, and similarly, a second component may be referred to as a first component. Terms include any combination of one or more of the associated terms.

[0043] When a component is described as "connected" or "linked" to another component, it should be understood that it can be directly connected or linked to the other component, but the other component can exist in between. On the other hand, when a component is described as "directly connected" or "directly linked" to another component, it should be understood that there is no other component in between.

[0044] The terminology used in this application is for describing particular embodiments only and is not intended to limit this disclosure. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, it should be understood that terms such as “comprising” or “having” are intended to specify the presence of the features, quantities, steps, operations, components, portions, or combinations thereof described in this specification, but do not preclude the possibility of the presence or addition of one or more other features, quantities, steps, operations, components, portions, or combinations thereof.

[0045] This disclosure relates to video / image coding. For example, the methods / implementations disclosed herein can be applied to methods disclosed in the Multifunctional Video Coding (VVC) standard. Additionally, the methods / implementations disclosed herein can be applied to methods disclosed in the Basic Video Coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the Audio Video Coding 2 (AVS2) standard, or next-generation video / image coding standards (e.g., H.267 or H.268).

[0046] This specification sets forth various implementations of video / image coding, and unless otherwise specified, these implementations may be combined with each other.

[0047] In this article, video can refer to a collection of images over time. A frame typically refers to a unit representing an image within a specific time period, and a slice / tile is a unit that forms part of a frame during encoding. A slice / tile can include at least one Code Tree Unit (CTU). A frame can consist of at least one slice / tile. A tile is a rectangular area composed of multiple CTUs within a specific tile column and a specific tile row of a frame. A tile column is a rectangular area of ​​CTUs with a height equal to the height of the frame and a width specified by the syntax requirements of the frame parameter set. A tile row is a rectangular area of ​​CTUs with a height specified by the frame parameter set and a width equal to the width of the frame. CTUs within a tile can be arranged continuously according to CTU raster scans, and tiles within a frame can be arranged continuously according to tile raster scans. A slice can include an integer number of complete tiles of a frame that can be exclusively included in a single NAL unit, or an integer number of consecutive complete CTU rows within a tile. Furthermore, a frame can be divided into at least two sub-frames. A sub-frame can be a rectangular area of ​​at least one slice within a frame.

[0048] A pixel, or pelin, can represent the smallest unit that makes up a frame (or image). Additionally, "sample" can be used as the term corresponding to a pixel. A sample can typically represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luminance component or only the pixel / pixel value of the chrominance component.

[0049] A unit can represent the basic unit of image processing. A unit may include a specific region of the image and at least one of the information associated with that region. A unit may include a luminance block and two chrominance (e.g., cb, cr) blocks. In some cases, the term "unit" may be used interchangeably with terms such as "block" or "region". In general, an M×N block may include a set (or array) of transform coefficients or samples (or sample arrays) consisting of M columns and N rows.

[0050] In this document, “A or B” can mean “A only”, “B only”, or “both A and B”. In other words, “A or B” can be interpreted as “A and / or B”. For example, “A, B or C” can mean “A only”, “B only”, “C only”, or “any combination of A, B and C”.

[0051] The forward slash ( / ) or comma used in this article can indicate "and / or". For example, "A / B" can mean "A and / or B". Therefore, "A / B" can mean "A only", "B only", or "both A and B". For example, "A, B, C" can mean "A, B, or C".

[0052] In this document, "at least one of A and B" can mean "only A", "only B" or "both A and B". Furthermore, in this document, expressions such as "at least one of A or B" or "at least one of A and / or B" can be interpreted in the same way as "at least one of A and B".

[0053] Additionally, in this document, "at least one of A, B, and C" can mean "A only", "B only", "C only" or "any combination of A, B, and C". Furthermore, "at least one of A, B, or C" or "at least one of A, B, and / or C" can mean "at least one of A, B, and C".

[0054] Additionally, the parentheses used in this document can indicate "for example". Specifically, when the indication is "prediction (intra-frame prediction)", "intra-frame prediction" can be cited as an example of "prediction". In other words, "prediction" in this document is not limited to "intra-frame prediction", and "intra-frame prediction" can be cited as an example of "prediction". Furthermore, even when the indication is "prediction (i.e., intra-frame prediction)", "intra-frame prediction" can be cited as an example of "prediction".

[0055] In this article, the technical features described individually in a single diagram can be implemented individually or simultaneously.

[0056] Figure 1 A video / image encoding system according to this disclosure is shown.

[0057] Reference Figure 1 A video / image encoding system may include a first device (source device) and a second device (receiving device).

[0058] A source device can transmit encoded video / image information or data to a receiving device in the form of a file or stream via a digital storage medium or network. The source device may include a video source, an encoding device, and a transmitting unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display unit, and the display unit may consist of a separate device or external components.

[0059] A video source can acquire video / images through processes that capture, synthesize, or generate video / images. A video source may include means for capturing video / images and means for generating video / images. Means for capturing video / images may include at least one camera, a video / image archive containing previously captured video / images, etc. Means for generating video / images may include a computer, tablet computer, smartphone, etc., and can generate video / images (electronically). For example, virtual video / images can be generated by a computer, etc., and in this case, the process of capturing video / images can be replaced by a process of generating related data.

[0060] Encoding devices can encode input video / images. They can perform a series of processes such as prediction, transformation, and quantization for compression and encoding efficiency. The encoded data (encoded video / image information) can be output as a bitstream.

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

[0062] Decoding devices can decode video / images by performing a series of processes, such as dequantization, inverse transform, and prediction, that correspond to the operations of encoding devices.

[0063] The renderer can render decoded video / images. The rendered video / images can be displayed through a display unit.

[0064] Figure 2 A rough block diagram of an encoding apparatus that can be applied to embodiments of the present disclosure and perform encoding of video / image signals is shown.

[0065] Reference Figure 2 The encoding device 200 may consist of an image segmenter 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-frame predictor 221 and an intra-frame 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 also include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstruction block generator. According to embodiments, the image segmenter 210, predictor 220, residual processor 230, entropy encoder 240, adder 250, and filter 260 may be configured by at least one hardware component (e.g., an encoder chipset or processor). Additionally, the memory 270 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may also include the memory 270 as an internal / external component.

[0066] Image segmenter 210 can segment an input image (or picture or frame) input to encoding device 200 into at least one processing unit. As an example, a processing unit can be referred to as a coding unit (CU). In this case, the coding unit can be recursively segmented from coding tree unit (CTU) or maximum coding unit (LCU) according to a quadtree-binary-tritree (QTBTTT) structure.

[0067] For example, a coding unit can be segmented into multiple deeper coding units based on a quadtree, binary tree, and / or ternary tree structure. In this case, for example, a quadtree structure can be applied first, followed by a binary tree and / or ternary tree structure. Alternatively, a binary tree structure can be applied before the quadtree structure. The coding process according to this specification can be performed based on the final coding unit that is no longer segmented. In this case, based on image characteristics, coding efficiency, etc., the largest coding unit can be directly used as the final coding unit, or, if necessary, the coding unit can be recursively segmented into deeper coding units, and the coding unit with the optimal size can be used as the final coding unit. Here, the coding process can include processes such as prediction, transformation, and reconstruction, as described later.

[0068] As another example, the processing unit may also include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit can be divided or segmented from the aforementioned final encoding unit, respectively. The prediction unit may be a unit for predicting samples, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving residual signals from transform coefficients.

[0069] In some cases, a unit can be used interchangeably with terms such as block or region. Generally, an M×N block can represent a set of transform coefficients or samples consisting of M columns and N rows. Samples can typically represent pixels or pixel values, and can represent only the pixel / pixel value of the luminance component, or only the pixel / pixel value of the chrominance component. Samples can be used as a term to form a frame (or image) corresponding to a pixel or cell.

[0070] Encoding device 200 can subtract the prediction signal (prediction block, prediction sample array) output from inter-frame predictor 221 or intra-frame predictor 222 from the input image signal (original block, original sample array) to generate a residual signal (residual signal, residual sample array), and the generated residual signal is sent to converter 232. In this case, the unit in encoding device 200 that subtracts the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) can be called subtractor 231.

[0071] Predictor 220 can perform prediction on the block to be processed (hereinafter referred to as the current block) and generate a prediction block that includes prediction samples of the current block. Predictor 220 can determine whether to apply intra-frame prediction or inter-frame prediction on a per-block or per-unit basis. Predictor 220 can generate various information about the prediction (e.g., prediction mode information) and send it to entropy encoder 240, as described later in the description of the various prediction modes. The information about the prediction can be encoded in entropy encoder 240 and output as a bitstream.

[0072] Intra-predictor 222 can predict the current block by referencing samples within the current frame. Depending on the prediction mode, the referenced samples can be located near the current block or positioned at a specific distance away from the current block. In intra-prediction, the prediction mode can include at least one non-directional mode and multiple directional modes. The non-directional mode can include at least one of a DC mode or a planar mode. Depending on the level of detail of the prediction direction, the directional modes can include 33 or 65 directional modes. However, this is just an example; more or fewer directional modes can be used depending on the configuration. Intra-predictor 222 can determine the prediction mode applied to the current block by using prediction modes applied to neighboring blocks.

[0073] Inter-frame predictor 221 can deduce the predicted block of the current block based on a reference block (reference sample array) specified by motion vectors on a reference frame. In this case, to reduce the amount of motion information transmitted in inter-frame prediction mode, motion information can be predicted on a block, sub-block, or sample basis based on the correlation between motion information between neighboring blocks and the current block. Motion information may include motion vectors and reference frame indices. Motion information may also include inter-frame prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter-frame prediction, neighboring blocks may include spatially neighboring blocks existing in the current frame and temporally neighboring blocks existing in the reference frame. The reference frame including the reference block and the reference frame including the temporally neighboring block may be the same or different. The temporally neighboring block may be referred to as a co-located reference block, a co-located CU (colCU), etc., and the reference frame including the temporally neighboring block may be referred to as a co-located frame (colPic). For example, inter-frame predictor 221 can configure a motion information candidate list based on neighboring blocks and generate information indicating which candidate to use to deduce the motion vector and / or reference frame index of the current block. Inter-frame prediction can be performed based on various prediction modes. For example, in skip mode and merge mode, the inter-frame predictor 221 can use motion information from neighboring blocks as motion information for the current block. In skip mode, unlike merge mode, residual signals may not be sent. In motion vector prediction (MVP) mode, motion vectors from surrounding blocks are used as motion vector predictors, and the motion vector difference is signaled to indicate the motion vector of the current block.

[0074] Predictor 220 can generate a prediction signal based on various prediction methods described later. For example, the predictor can not only apply intra-frame prediction or inter-frame prediction to predict a block, but can also apply both intra-frame and inter-frame prediction simultaneously. This can be referred to as the Inter-intra-frame Combined Prediction (CIIP) mode. Alternatively, the predictor can predict blocks based on the Intra-Block Copy (IBC) prediction mode, or it can predict blocks based on a palette mode. The IBC prediction mode or palette mode can be used for content image / video coding such as Screen Content Coding (SCC) in games, etc. IBC essentially performs prediction within the current frame, but it can be performed similarly to inter-frame prediction because it derives a reference block within the current frame. In other words, IBC can use at least one of the inter-frame prediction techniques described herein. The palette mode can be considered an example of intra-frame coding or intra-frame prediction. When applying a palette mode, sample values ​​within the frame can be signaled based on information about the palette table and palette index. The prediction signal generated by predictor 220 can be used to generate a reconstructed signal or a residual signal.

[0075] Transformer 232 can generate transform coefficients by applying transform techniques to the residual signal. For example, the transform techniques may include at least one of Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), Karhunen–Loève Transform (KLT), Graph-Based Transform (GBT), or Conditional Nonlinear Transform (CNT). Here, GBT represents the transform obtained from a graph when the relationship information between pixels is represented as a graph. CNT represents the transform obtained based on generating a prediction signal using all previously reconstructed pixels. Furthermore, the transform processing can be applied to square pixel blocks of the same size, or it can be applied to non-square blocks of variable size.

[0076] Quantizer 233 can quantize the transform coefficients and send them to entropy encoder 240, which can encode the quantized signal (information about the quantized transform coefficients) and output it as a bitstream. This information about the quantized transform coefficients can be called residual information. Quantizer 233 can rearrange the block-form quantized transform coefficients into a one-dimensional vector based on the coefficient scan order, and can generate information about the quantized transform coefficients based on this one-dimensional vector form.

[0077] The entropy encoder 240 can perform various encoding methods such as Golomb, context-adaptive variable-length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoder 240 can encode information required for video / image reconstruction other than quantization transform coefficients (e.g., values ​​of syntax elements, etc.) together or separately.

[0078] Encoded information (e.g., encoded video / image information) can be transmitted or stored in bitstream form at the Network Abstraction Layer (NAL) unit level. The video / image information may also include information about various parameter sets such as Adaptive Parameter Set (APS), Picture Parameter Set (PPS), Sequence Parameter Set (SPS), or Video Parameter Set (VPS). Additionally, the video / image information may include general constraint information. Information and / or syntax elements transmitted from the encoding device to / signaled to the decoding device may be included in the video / image information. The video / image information can be encoded and included in the bitstream through the encoding process described above. The bitstream can be transmitted over a network or stored in a digital storage medium. Here, the network may include broadcast networks and / or communication networks, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) for transmitting the signal output from the entropy encoder 240 and / or a storage unit (not shown) for storing the signal may be configured as internal / external components of the encoding device 200, or the transmitting unit may also be included in the entropy encoder 240.

[0079] The quantized transform coefficients output from quantizer 233 can be used to generate a prediction signal. For example, the residual signal (residual block or residual sample) can be reconstructed by applying dequantization and inverse transform to the quantized transform coefficients via dequantizer 234 and inverse transformer 235. Adder 250 can add the reconstructed residual signal to the prediction signal output from inter-frame predictor 221 or intra-frame predictor 222 to generate a reconstructed signal (reconstructed frame, reconstructed block, reconstructed sample array). When there is no residual for the block to be processed (similar to when a skip mode is applied), the prediction block can be used as a reconstructed block. Adder 250 can be referred to as a reconstructor or reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next block to be processed in the current frame, and can also be used for inter-frame prediction of the next frame by filtering, as described later. Furthermore, luminance mapping and chroma scaling (LMCS) can be applied in frame encoding and / or reconstruction processing.

[0080] Filter 260 can improve subjective / objective image quality by applying filtering to the reconstructed signal. For example, filter 260 can generate a modified reconstructed image by applying various filtering methods to the reconstructed image, and the modified reconstructed image can be stored in memory 270 (specifically, the DPB of memory 270). Various filtering methods can include deblocking filtering, sample adaptive offsetting, adaptive loop filtering, bilateral filtering, etc. Filter 260 can generate various information about the filtering and send it to entropy encoder 240. The information about the filtering can be encoded in entropy encoder 240 and output as a bitstream.

[0081] The modified reconstructed frame sent to memory 270 can be used as a reference frame in inter-frame predictor 221. When inter-frame prediction is applied through it, the encoding device can avoid prediction mismatch between the encoding device 200 and the decoding device, and can also improve encoding efficiency.

[0082] The DPB of memory 270 can store modified reconstructed frames for use as reference frames in inter-frame predictor 221. Memory 270 can store motion information of blocks in the current frame from which motion information is derived (or encoded) and / or of blocks in previously reconstructed frames. The stored motion information can be sent to inter-frame predictor 221 as motion information for spatially or temporally neighboring blocks. Memory 270 can store reconstructed samples of reconstructed blocks in the current frame and send them to intra-frame predictor 222.

[0083] Figure 3 A rough block diagram of a decoding device that can be implemented using embodiments of the present disclosure and perform decoding of video / image signals is shown.

[0084] Reference Figure 3 The decoding device 300 can be configured to include an entropy decoder 310, a residual processor 320, a predictor 330, an adder 340, a filter 350, and a memory 360. The predictor 330 may include an inter-frame predictor 332 and an intra-frame predictor 331. The residual processor 320 may include a dequantizer 321 and an inverse transformer 322.

[0085] According to the implementation, the entropy decoder 310, residual processor 320, predictor 330, adder 340, and filter 350 described above can be configured by a single hardware component (e.g., a decoder chipset or processor). Additionally, the memory 360 may include a decoded screen buffer (DPB) and can be configured by a digital storage medium. The hardware component may also include the memory 360 as an internal / external component.

[0086] When the input includes a bitstream containing video / image information, the decoding device 300 can respond to... Figure 2 The encoding device processes video / image information to reconstruct the image. For example, the decoding device 300 can deduce units / blocks based on block segmentation information obtained from the bitstream. The decoding device 300 can perform decoding using processing units applied in the encoding device. Therefore, the decoding processing unit can be an encoding unit, and the encoding unit can be segmented from the encoding tree unit or a larger encoding unit according to a quadtree structure, binary tree structure, and / or ternary tree structure. At least one transform unit can be derived from the encoding unit. Furthermore, the reconstructed image signal decoded and output by the decoding device 300 can be played back by a playback device.

[0087] Decoding device 300 can receive data in bitstream form from... Figure 2 The signal output by the encoding device can be decoded by the entropy decoder 310. For example, the entropy decoder 310 can parse the bitstream to derive the information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information may also include information about various parameter sets such as Adaptive Parameter Set (APS), Picture Parameter Set (PPS), Sequence Parameter Set (SPS), or Video Parameter Set (VPS). In addition, the video / image information may also include general constraint information. The decoding device can also decode the picture based on the information about the parameter sets and / or general constraint information. The information and / or syntax elements that are signaled / received, as described later herein, can be decoded and obtained from the bitstream through the decoding process. For example, the entropy decoder 310 can decode the information in the bitstream based on encoding methods such as Exponential Golomb coding, CAVLC, CABAC, etc., and output the values ​​of the syntax elements required for image reconstruction and the quantized values ​​of the transform coefficients of the residuals. More specifically, the CABAC entropy decoding method can receive bins corresponding to each syntax element from the bitstream, determine a context model using information about the syntax element to be decoded, decoding information of surrounding blocks and the block to be decoded, or information about symbols / bins decoded in previous steps, perform arithmetic decoding of bins by predicting the occurrence probability of bins based on the determined context model, and generate symbols corresponding to the values ​​of each syntax element. In this case, after determining the context model, the CABAC entropy decoding method can update the context model by using information about the decoded symbols / bins for the context model of the next symbol / bin. Among the information decoded in the entropy decoder 310, information about prediction is provided to the predictors (inter-frame predictor 332 and intra-frame predictor 331), and the residual values ​​(i.e., quantization transform coefficients and related parameter information) from which entropy decoding has been performed in the entropy decoder 310 can be input to the residual processor 320. The residual processor 320 can derive residual signals (residual blocks, residual samples, residual sample arrays). In addition, information about filtering from the information decoded in the entropy decoder 310 can be provided to the filter 350. Furthermore, the receiving unit (not shown) that receives the signal output from the encoding device can be further configured as an internal / external component of the decoding device 300, or the receiving unit can be a component of the entropy decoder 310.

[0088] Furthermore, the decoding device according to this specification may be referred to as a video / image / screen decoding device, and the decoding device may be divided into an information decoder (video / image / screen information decoder) and a sample decoder (video / image / screen sample decoder). The information decoder may include an entropy decoder 310, and the sample decoder may include at least one of a dequantizer 321, an inverse transformer 322, an adder 340, a filter 350, a memory 360, an inter-frame predictor 332, and an intra-frame predictor 331.

[0089] Dequantizer 321 can dequantize the quantized transform coefficients and output the transform coefficients. Dequantizer 321 can rearrange the quantized transform coefficients into two-dimensional blocks. In this case, the rearrangement can be performed based on the coefficient scan order performed in the encoding device. Dequantizer 321 can perform dequantization on the quantized transform coefficients using quantization parameters (e.g., quantization step size information) and obtain the transform coefficients.

[0090] The inverse transformer 322 performs an inverse transformation on the transformation coefficients to obtain the residual signal (residual block, residual sample array).

[0091] Predictor 320 can perform prediction on the current block and generate a prediction block that includes prediction samples of the current block. Predictor 320 can determine whether to apply intra-frame prediction or inter-frame prediction to the current block based on the prediction information output from entropy decoder 310, and determine the specific intra-frame / inter-frame prediction mode.

[0092] Predictor 320 can generate prediction signals based on various prediction methods described later. For example, predictor 320 can not only apply intra-frame prediction or inter-frame prediction to predict a block, but can also apply intra-frame prediction and inter-frame prediction simultaneously. This can be referred to as the Inter-Frame Intra-Frame Combined Prediction (CIIP) mode. Alternatively, the predictor can predict blocks based on the Intra-Frame Block Copy (IBC) prediction mode, or it can predict blocks based on a palette mode. The IBC prediction mode or palette mode can be used for content image / video coding such as Screen Content Coding (SCC) in games, etc. IBC essentially performs prediction within the current frame, but it can be performed similarly to inter-frame prediction because it derives a reference block within the current frame. In other words, IBC can use at least one of the inter-frame prediction techniques described herein. The palette mode can be considered an example of intra-frame coding or intra-frame prediction. When the palette mode is applied, information about the palette table and palette index can be included in the video / image information and signaled.

[0093] Intra-predictor 331 can predict the current block by referencing samples within the current frame. Depending on the prediction mode, the referenced samples can be located near the current block or at a specific distance away. In intra-prediction, the prediction mode can include at least one non-directional mode and multiple directional modes. Intra-predictor 331 can determine the prediction mode applied to the current block by using prediction modes applied to neighboring blocks.

[0094] Inter-frame predictor 332 can deduce the predicted block of the current block based on a reference block (reference sample array) specified by motion vectors on a reference frame. In this case, to reduce the amount of motion information transmitted in inter-frame prediction mode, motion information can be predicted on a block, sub-block, or sample basis based on the correlation of motion information between neighboring blocks and the current block. Motion information may include motion vectors and reference frame indices. Motion information may also include inter-frame prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter-frame prediction, neighboring blocks may include spatially neighboring blocks existing in the current frame and temporally neighboring blocks existing in the reference frame. For example, inter-frame predictor 332 can configure a motion information candidate list based on neighboring blocks and deduce the motion vector and / or reference frame index of the current block based on the received candidate selection information. Inter-frame prediction can be performed based on various prediction modes, and the information about the prediction may include information indicating the inter-frame prediction mode of the current block.

[0095] Adder 340 can add the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the predictor (including inter-frame predictor 332 and / or intra-frame predictor 331) to generate a reconstruction signal (reconstructed frame, reconstruction block, reconstruction sample array). When there is no residual for the block to be processed (similar to when a skip mode is applied), the prediction block can be used as a reconstruction block.

[0096] Adder 340 can be referred to as a reconstructor or reconstruction block generator. The generated reconstructed signal can be used for intra-frame prediction of the next block to be processed in the current frame, can be output through filtering as described later, or can be used for inter-frame prediction of the next frame. In addition, luminance mapping and chroma scaling (LMCS) can be applied in the frame decoding process.

[0097] Filter 350 can improve subjective / objective image quality by applying filtering to the reconstructed signal. For example, filter 350 can generate a modified reconstructed image by applying various filtering methods to the reconstructed image and send the modified reconstructed image to memory 360 (specifically, the DPB of memory 360). Various filtering methods may include deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.

[0098] The (modified) reconstructed frame stored in the DPB of memory 360 can be used as a reference frame in inter-frame predictor 332. Memory 360 can store motion information of blocks in the current frame from which motion information is derived (or decoded) and / or motion information of blocks in previously reconstructed frames. The stored motion information can be sent to inter-frame predictor 332 as motion information of spatially or temporally neighboring blocks. Memory 360 can store reconstructed samples of reconstructed blocks in the current frame and send them to intra-frame predictor 331.

[0099] The embodiments described in this document in the filter 260, inter-frame predictor 221 and intra-frame predictor 222 of the encoding device 200 can also be applied equivalently or correspondingly to the filter 350, inter-frame predictor 332 and intra-frame predictor 331 of the decoding device 300, respectively.

[0100] Figure 4 An inter-frame prediction method is shown, performed by a decoding device 300 as an embodiment of the present disclosure.

[0101] Reference Figure 4 The current block can be divided into multiple partitions S400.

[0102] The current block can be divided into two or more partitions based on one or more dividing lines. As an example, the current block can be divided into two or more partitions based on geometric division. Any one of the two or more partitions can be a triangle. Alternatively, the two or more partitions can be quadrilaterals.

[0103] Reference Figure 4 It can derive the predicted block S410 for each partition of the current block.

[0104] For ease of description, this disclosure assumes that the current block is divided into two partitions. In the following text, either of the two partitions is referred to as the first partition, and the other of the two partitions is referred to as the second partition.

[0105] The first predicted block (P0) can be derived for the first partition of the current block, and the second predicted block (P1) can be derived for the second partition of the current block.

[0106] The first prediction block of the first partition can be derived through unidirectional prediction. As an example, the first prediction block can be a prediction block derived through inter-frame prediction in the L0 direction (hereinafter referred to as the L0 prediction block). The L0 prediction block can be defined as a prediction block derived by performing inter-frame prediction based on an L0 reference frame. Alternatively, the first prediction block can be a prediction block derived through inter-frame prediction in the L1 direction (hereinafter referred to as the L1 prediction block). The L1 prediction block can be defined as a prediction block derived by performing inter-frame prediction based on an L1 reference frame.

[0107] The first predicted block of the first partition can be derived through bidirectional prediction. As an example, the L0 and L1 predicted blocks can be derived separately for the first partition, and the first predicted block can be derived based on the L0 and L1 predicted blocks.

[0108] Similarly, the second predicted block for the second partition can be derived through unidirectional prediction. As an example, the second predicted block could be an L0 predicted block. Alternatively, the second predicted block could be an L1 predicted block. Alternatively, the second predicted block for the second partition can be derived through bidirectional prediction. As an example, L0 and L1 predicted blocks can be derived separately for the second partition, and the second predicted block can be derived based on the L0 and L1 predicted blocks.

[0109] The following section describes in detail the method for deriving the first and second predicted blocks of the current block.

[0110] Implementation Method 1

[0111] When the first partition performs bidirectional prediction (i.e., when the first partition has motion information for bidirectional prediction), L0 and L1 prediction blocks can be derived for the first partition. The first prediction block of the first partition can be derived based on the weighted sum of the L0 and L1 prediction blocks. As an example, the first prediction block can be derived as shown in Equation 1 below.

[0112] [Formula 1]

[0113]

[0114] In Equation 1, P0 represents the first prediction block. 00 P represents the L0 prediction block of the first partition. 01 This represents the L1 prediction block of the first partition. 00 and w 01 This represents the weights used for bidirectional prediction in the first partition. `round` represents the rounding offset used for rounding, and `shift` represents the parameters used for the weighted average (i.e., the shrinking parameters). Here, `w` 00 and w 01 They can be set to the value (2) equally. shift-1 In this case, P0 can be derived as P 00 and P 01 The average value.

[0115] When the second partition performs bidirectional prediction (i.e., when the second partition has motion information for bidirectional prediction), L0 and L1 prediction blocks can be derived for the second partition. The second prediction block of the second partition can be derived based on the weighted sum of the L0 and L1 prediction blocks. As an example, the second prediction block can be derived as shown in Equation 2 below.

[0116] [Equation 2]

[0117]

[0118] In Equation 2, P1 represents the second prediction block. 10 P represents the L0 prediction block of the second partition. 11 This represents the L1 prediction block of the second partition. 10 and w 11 This represents the weights used for bidirectional prediction in the second partition. `round` represents the rounding offset used for rounding, and `shift` represents the parameters used for the weighted average (i.e., the shrinking parameters). Here, `w` 10 and w 11 They can be set to the value (2) equally. shift-1 In this case, P1 can be derived as P. 10 and P 11 The average value.

[0119] Implementation Method 2

[0120] When bidirectional prediction is performed on the first partition, the L0 and L1 prediction blocks can be derived for the first partition. The first prediction block of the first partition can be derived by applying BCW (bidirectional prediction with CU-level weights) to the L0 and L1 prediction blocks of the first partition. In other words, the first prediction block can be derived based on the weighted average of the L0 and L1 prediction blocks of the first partition.

[0121] The weights for the weighted average can be determined based on a predefined set of weights equally applicable to both the encoding and decoding devices. This set can include multiple weight candidates. The number of weight candidates belonging to the set can be an integer of 2, 3, 4, 5, or greater. At least one of the weight candidates can be negative. As an example, the weight set could be defined as {-2, 3, 4, 5, 10}.

[0122] The weights of the weighted average can be determined based on any one of several weight candidates belonging to the weight set. For this purpose, an index specifying any one of the several weight candidates (hereinafter referred to as the BCW index) can be used. As an example, the weights of the weighted average may include the weights of the L0 prediction blocks applied to the first partition (w... 00 ) and the weights (w) applied to the L1 prediction block of the first partition 01 ). w 00 It can be deduced to be the weight candidate specified by the BCW index among multiple weight candidates. 01 It can be derived as the value (1-w) 00 Alternatively, w 01 It can be set as a weight candidate specified by the BCW index among multiple weight candidates.00 It can be derived as the value (1-w) 01 ).

[0123] On the other hand, when the first partition performs unidirectional prediction, the above-mentioned BCW may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block.

[0124] Similarly, when bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. The second prediction block for the second partition can be derived by applying BCW to the L0 and L1 prediction blocks. In other words, the second prediction block can be derived based on a weighted average of the L0 and L1 prediction blocks for the second partition.

[0125] The weights of the weighted average can be derived in the same way as for the first partition. Specifically, the weights of the weighted average can be determined based on any one of several weight candidates belonging to the weight set. For this purpose, a BCW index representing any one of the several weight candidates can be used. As an example, the weights of the weighted average may include the weights of the L0 prediction blocks applied to the second partition (w 10 ) and the weights (w) applied to the L1 prediction block of the second partition 11 ). w 10 It can be deduced to be the weight candidate specified by the BCW index among multiple weight candidates. 11 It can be derived as the value (1-w) 10 Alternatively, w 11 It can be deduced to be the weight candidate specified by the BCW index among multiple weight candidates. 10 It can be derived as the value (1-w) 11 ).

[0126] On the other hand, when the second partition performs unidirectional prediction, the aforementioned BCW may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block.

[0127] When the BCW index of the first partition is different from that of the second partition, the weights used in deriving the first predicted block of the first partition can be different from those used in deriving the second predicted block of the second partition. Conversely, when the BCW index of the first partition is the same as that of the second partition, the weights used in deriving the first predicted block of the first partition can be the same as those used in deriving the second predicted block of the second partition.

[0128] Implementation Method 3

[0129] When bidirectional prediction is performed in the first partition, the first prediction block of the first partition can be derived based on decoder-side motion vector refinement (DMVR).

[0130] Specifically, the predetermined search range can be determined based on the motion vector of the first partition. The search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N can be an integer of 1, 2, or larger. As an example, when N is 2, the search range can be defined as a 5×5 area centered on the position indicated by the motion vector of the first partition. In this case, the number of search positions within the search range can be 25.

[0131] Costs can be calculated for each search location within the search range. Here, the cost can be calculated as the sum of absolute differences (SAD) between the L0 and L1 blocks at the corresponding search location.

[0132] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the first partition can be modified to indicate the search position with the minimum cost. The L0 block and L1 block at the search position indicated by the modified motion vector can be set as the L0 prediction block and L1 prediction block of the first partition, respectively. The first prediction block of the first partition can be derived based on the weighted sum of the L0 prediction block and L1 prediction block derived in the above manner.

[0133] On the other hand, when the first partition performs unidirectional prediction, the aforementioned DMVR may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block.

[0134] When the second partition performs bidirectional prediction, the second prediction block of the second partition can be derived based on DMVR as described above.

[0135] Specifically, the predetermined search range can be determined based on the motion vector of the second partition. This search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the second partition, as described above.

[0136] Costs can be calculated for each search location within the search range. Here, the cost can be calculated as the sum of absolute differences (SAD) between the L0 and L1 blocks at the corresponding search location.

[0137] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the second partition can be modified to indicate the search position with the minimum cost. The L0 and L1 blocks at the search position indicated by the modified motion vector can be set as the L0 and L1 prediction blocks of the second partition. The second prediction block of the second partition can be derived based on the weighted sum of the L0 and L1 prediction blocks derived in the above manner.

[0138] On the other hand, when the second partition performs unidirectional prediction, the aforementioned DMVR may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block.

[0139] The DMVR described above can divide the current block into sub-blocks of a predetermined size and perform motion vector modifications on a sub-block basis. Here, the size of the sub-block can be 16×16. However, it is not limited to this; the size of the sub-block can be 8×8 or 4×4. Alternatively, the shape of the sub-block is not limited to a square shape; it can be a non-square shape such as 16×8 or 8×4. Alternatively, the DMVR described above can perform motion vector modifications on a 1×1 sample unit.

[0140] Implementation Method 4

[0141] When bidirectional prediction is performed in the first partition, the first prediction block of the first partition can be derived based on decoder-side motion vector refinement (DMVR).

[0142] Specifically, a predetermined search range can be determined based on the motion vector of the first partition. This search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N can be an integer of 1, 2, or larger. As an example, when N is 2, the search range can be defined as a 5×5 region centered on the position indicated by the motion vector of the first partition. In this case, the number of search positions within the search range can be 25.

[0143] Costs can be calculated for each search position within the search range. Predetermined weights of BCW (Bilateral Prediction with CU-level weights) can be applied separately to the L0 and L1 blocks at the search positions. In this case, the cost can be calculated as the sum of absolute differences (SAD) between the weighted L0 and L1 blocks. Here, weights can be determined based on a predefined set of weights equally defined for both the encoding and decoding devices. The weight set can include multiple weight candidates. The number of weight candidates belonging to the weight set can be an integer of 2, 3, 4, 5, or greater. At least one of the multiple weight candidates can be negative. As an example, the weight set can be defined as {-2, 3, 4, 5, 10}. Weights can be determined based on any one of the multiple weight candidates belonging to the weight set. For this purpose, a BCW index specifying any one of the multiple weight candidates can be used. As an example, the weights can include the weights applied to the L0 block (w 00 ) and the weights applied to the L1 block (w 01 ). w 00 It can be deduced to be the weight candidate specified by the BCW index among multiple weight candidates. 01 It can be derived as the value (1-w) 00 Alternatively, w 01 It can be set as a weight candidate specified by the BCW index among multiple weight candidates. 00 It can be derived as the value (1-w) 01 ).

[0144] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the first partition can be modified to indicate the search position with the minimum cost. The L0 and L1 blocks at the search position indicated by the modified motion vector can be set as the L0 and L1 prediction blocks of the first partition.

[0145] The weights derived based on the BCW index (w) can be applied to the L0 and L1 prediction blocks derived in the above manner, respectively. 00 ) and weights (w 01 To derive the first prediction block of the first partition.

[0146] On the other hand, when the first partition performs unidirectional prediction, the aforementioned DMVR may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block.

[0147] When the second partition performs bidirectional prediction, the second prediction block of the second partition can be derived based on DMVR as described above.

[0148] Specifically, the predetermined search range can be determined based on the motion vector of the second partition. This search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the second partition, as described above.

[0149] Costs can be calculated for each search position within the search range. Predetermined weights of BCW can be applied to the L0 and L1 blocks at the search positions separately. In this case, the cost can be calculated as the sum of absolute differences (SAD) between the weighted L0 and L1 blocks. Here, weights can be determined based on a predefined set of weights equally defined for both the encoding and decoding devices. The weight set can include multiple weight candidates. The number of weight candidates belonging to the weight set can be an integer of 2, 3, 4, 5, or greater. At least one of the multiple weight candidates can be negative. As an example, the weight set can be defined as {-2, 3, 4, 5, 10}. Weights can be determined based on any one of the multiple weight candidates belonging to the weight set. For this purpose, a BCW index specifying any one of the multiple weight candidates can be used. As an example, the weights can include the weights applied to the L0 block (w 10 ) and the weights applied to the L1 block (w 11 ). w 10 It can be deduced to be the weight candidate specified by the BCW index among multiple weight candidates. 11 It can be derived as the value (1-w) 10 Alternatively, w 11 It can be set as a weight candidate specified by the BCW index among multiple weight candidates. 10 It can be derived as the value (1-w) 11 ).

[0150] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the second partition can be modified to indicate the motion vector of the search position with the minimum cost. The L0 and L1 blocks at the search position indicated by the modified motion vector can be set as the L0 and L1 prediction blocks of the second partition.

[0151] The weights derived based on the BCW index (w) can be applied to the L0 and L1 prediction blocks derived in the above manner, respectively. 10 ) and weights (w 11 This is used to derive the second prediction block of the second partition.

[0152] On the other hand, when the second partition performs unidirectional prediction, the aforementioned DMVR may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block.

[0153] The DMVR described above can divide the current block into sub-blocks of a predetermined size and perform motion vector modifications on a sub-block basis. Here, the size of the sub-block can be 16×16. However, it is not limited to this; the size of the sub-block can be 8×8 or 4×4. Alternatively, the shape of the sub-block is not limited to a square shape; it can be a non-square shape such as 16×8 or 8×4. Alternatively, the DMVR described above can perform motion vector modifications on a 1×1 sample unit.

[0154] Implementation Method 5

[0155] The illumination compensation method according to this disclosure can represent a method for generating a final predicted block of the current block by applying predetermined illumination compensation parameters to a reference block of the current block. Specifically, the illumination compensation parameters can be derived based on the neighboring regions of the current block and the neighboring regions of the reference block. In other words, the illumination compensation parameters of the linear model can be derived based on the brightness difference (or variation) between the neighboring regions of the current block and the neighboring regions of the reference block. As a pre-reconstructed region, the neighboring regions can include at least one of the top neighboring region, left neighboring region, upper left neighboring region, lower left neighboring region, or upper right neighboring region. The reference block can be specified based on the motion vector of the current block. The illumination compensation parameters of the linear model can be applied to the reference block to generate the final predicted block of the current block.

[0156] The relational expression used to compensate for the brightness difference between the current block and the reference block can be defined as shown in Equation 3 below.

[0157] [Formula 3]

[0158]

[0159] In Equation 3, α and β represent the lighting compensation parameters. Ref N (x,y) can refer to the neighboring region of the reference block, Cur N (x, y) can refer to the neighboring region of the current block. Lighting compensation parameters can include those that make the Ref... N (x,y) and Cur N The weights (α) and offsets (β) that minimize the brightness difference between (x, y) are used. The values ​​of α and β can be applied to a reference block of the current block to generate a prediction block that provides illumination compensation for the current block.

[0160] The illumination compensation parameters according to this disclosure can be derived from at least one unit of a frame, tile, slice, coding tree unit (CTU), or coding unit (CU). Illumination compensation can be applied adaptively based on illumination compensation flags. Illumination compensation flags can indicate whether illumination compensation is applied to a reference block of the current block. Alternatively, illumination compensation flags can indicate whether the predicted block of the current block is modified by illumination compensation. Illumination compensation flags can be signaled via a bitstream or derived from encoding and decoding devices.

[0161] When bidirectional prediction is performed on the first partition, L0 and L1 prediction blocks can be derived for the first partition. Illumination compensation can be applied to the L0 and L1 prediction blocks of the first partition separately. The first prediction block of the first partition can be derived based on the weighted sum of the illumination-compensated L0 and L1 prediction blocks.

[0162] Specifically, the illumination compensation parameters for the L0 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction block in the first partition. The derived illumination compensation parameters can be applied to the L0 prediction block to generate an illumination-compensated L0 prediction block. Similarly, the illumination compensation parameters for the L1 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the L1 prediction block in the first partition. The derived illumination compensation parameters can be applied to the L1 prediction block to generate an illumination-compensated L1 prediction block. The first prediction block of the first partition can be derived based on the weighted sum of the illumination-compensated L0 prediction blocks and the illumination-compensated L1 prediction blocks.

[0163] On the other hand, when the first partition performs unidirectional prediction, an L0 prediction block or an L1 prediction block can be derived for the first partition. Illumination compensation can be applied to the L0 prediction block or L1 prediction block of the first partition. In other words, illumination compensation parameters can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction block or L1 prediction block, and illumination compensation parameters can be applied to the L0 prediction block or L1 prediction block. The illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the first prediction block of the first partition.

[0164] When bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. Illumination compensation can be applied to the L0 and L1 prediction blocks of the second partition separately. The first prediction block of the first partition can be derived based on the weighted sum of the illumination-compensated L0 and L1 prediction blocks.

[0165] Specifically, the illumination compensation parameters for the L0 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction blocks in the second partition. The derived illumination compensation parameters can be applied to the L0 prediction blocks to generate illumination-compensated L0 prediction blocks. Similarly, the illumination compensation parameters for the L1 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the L1 prediction blocks in the second partition. The derived illumination compensation parameters can be applied to the L1 prediction blocks to generate illumination-compensated L1 prediction blocks. The second prediction block for the second partition can be derived based on the weighted sum of the illumination-compensated L0 prediction blocks and the illumination-compensated L1 prediction blocks.

[0166] On the other hand, when the second partition performs unidirectional prediction, an L0 prediction block or an L1 prediction block can be derived for the second partition. Illumination compensation can be applied to the L0 prediction block or L1 prediction block of the second partition. In other words, illumination compensation parameters can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction block or L1 prediction block, and illumination compensation parameters can be applied to the L0 prediction block or L1 prediction block. The illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the second prediction block of the second partition.

[0167] Implementation Method 6

[0168] When bidirectional prediction is performed on the first partition, L0 and L1 prediction blocks can be derived for the first partition. Illumination compensation can be applied to the L0 and L1 prediction blocks of the first partition, respectively. The first prediction block of the first partition can be derived by applying BCW (Bidirectional Prediction with CU-level Weights) to the L0 and L1 prediction blocks with illumination compensation. The illumination compensation according to this disclosure is the same as that described in Embodiment 5, and will be omitted here as a repetition.

[0169] Specifically, the lighting compensation parameters for the L0 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction block in the first partition. The derived lighting compensation parameters can be applied to the L0 prediction block to generate a lighting-compensated L0 prediction block. Similarly, the lighting compensation parameters for the L1 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the L1 prediction block in the first partition. The derived lighting compensation parameters can be applied to the L1 prediction block to generate a lighting-compensated L1 prediction block. The first prediction block of the first partition can be derived based on a weighted average of the lighting-compensated L0 prediction blocks and the lighting-compensated L1 prediction blocks. The weights of the weighted average are the same as those described in Implementation 2, and will be omitted here.

[0170] On the other hand, when the first partition performs unidirectional prediction, an L0 prediction block or an L1 prediction block can be derived for the first partition. Illumination compensation can be applied to the L0 prediction block or L1 prediction block of the first partition. In other words, illumination compensation parameters can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction block or L1 prediction block, and illumination compensation parameters can be applied to the L0 prediction block or L1 prediction block. The illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the first prediction block of the first partition. Since it is the case that the first partition performs unidirectional prediction, the above-mentioned BCW does not need to be applied when deriving the first prediction block of the first partition.

[0171] When bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. Illumination compensation can be applied to the L0 and L1 prediction blocks of the second partition separately. The second prediction block of the second partition can be derived by applying BCW to the illumination-compensated L0 and L1 prediction blocks.

[0172] Specifically, the lighting compensation parameters for the L0 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction blocks in the second partition. The derived lighting compensation parameters can be applied to the L0 prediction blocks to generate lighting-compensated L0 prediction blocks. Similarly, the lighting compensation parameters for the L1 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the L1 prediction blocks in the second partition. The derived lighting compensation parameters can be applied to the L1 prediction blocks to generate lighting-compensated L1 prediction blocks. The second prediction block for the second partition can be derived based on a weighted average of the lighting-compensated L0 prediction blocks and the lighting-compensated L1 prediction blocks. The weights of the weighted average are the same as described in Implementation 2, and will be omitted here.

[0173] On the other hand, when the second partition performs unidirectional prediction, an L0 prediction block or an L1 prediction block can be derived for the second partition. Illumination compensation can be applied to the L0 prediction block or L1 prediction block of the second partition. In other words, illumination compensation parameters can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction block or L1 prediction block, and illumination compensation parameters can be applied to the L0 prediction block or L1 prediction block. The illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the second prediction block of the second partition. Since this is the case where the second partition performs unidirectional prediction, the above-mentioned BCW does not need to be applied when deriving the second prediction block of the second partition.

[0174] Implementation Method 7

[0175] When bidirectional prediction is performed in the first partition, the first prediction block of the first partition can be derived based on decoder-side motion vector refinement (DMVR).

[0176] Specifically, a predetermined search range can be determined based on the motion vector of the first partition. This search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N can be an integer of 1, 2, or larger. As an example, when N is 2, the search range can be defined as a 5×5 region centered on the position indicated by the motion vector of the first partition. In this case, the number of search positions within the search range can be 25.

[0177] Costs can be calculated for each search location within the search range. Here, the cost can be calculated as the sum of absolute differences (SAD) between the L0 and L1 blocks at the corresponding search location.

[0178] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the first partition can be modified to indicate the search position with the minimum cost. The L0 block and L1 block at the search position indicated by the modified motion vector can be set as the L0 prediction block and L1 prediction block of the first partition, respectively.

[0179] Illumination compensation can be applied to the L0 and L1 prediction blocks derived in the above manner. The illumination compensation parameters for the L0 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the derived L0 prediction block. The derived illumination compensation parameters can be applied to the L0 prediction block to generate an illumination-compensated L0 prediction block. Similarly, the illumination compensation parameters for the L1 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the derived L1 prediction block. The derived illumination compensation parameters can be applied to the L1 prediction block to generate an illumination-compensated L1 prediction block. The first prediction block of the first partition can be derived based on the weighted sum of the illumination-compensated L0 and L1 prediction blocks.

[0180] On the other hand, when the first partition performs unidirectional prediction, the aforementioned DMVR may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, the first prediction block of the first partition can be derived as either an illumination compensation L0 prediction block or an illumination compensation L1 prediction block.

[0181] When the second partition performs bidirectional prediction, the second prediction block of the second partition can be derived based on DMVR as described above.

[0182] Specifically, the predetermined search range can be determined based on the motion vector of the second partition. This search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the second partition, as described above.

[0183] Costs can be calculated for each search location within the search range. Here, the cost can be calculated as the sum of absolute differences (SAD) between the L0 and L1 blocks at the corresponding search location.

[0184] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the second partition can be modified to indicate the search position with the minimum cost. The L0 block and L1 block at the search position indicated by the modified motion vector can be set as the L0 prediction block and L1 prediction block of the second partition, respectively.

[0185] Illumination compensation can be applied to the L0 and L1 prediction blocks derived in the above manner. The illumination compensation parameters for the L0 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the derived L0 prediction block. The derived illumination compensation parameters can be applied to the L0 prediction block to generate an illumination-compensated L0 prediction block. Similarly, the illumination compensation parameters for the L1 prediction block can be derived based on the neighboring regions of the current block and the neighboring regions of the derived L1 prediction block. The derived illumination compensation parameters can be applied to the L1 prediction block to generate an illumination-compensated L1 prediction block. The first prediction block of the first partition can be derived based on the weighted sum of the illumination-compensated L0 and L1 prediction blocks.

[0186] On the other hand, when the second partition performs unidirectional prediction, the aforementioned DMVR may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, the second prediction block of the second partition can be derived as either an illumination compensation L0 prediction block or an illumination compensation L1 prediction block.

[0187] The DMVR described above can divide the current block into sub-blocks of a predetermined size and perform motion vector modifications on a sub-block basis. Here, the size of the sub-block can be 16×16. However, it is not limited to this; the size of the sub-block can be 8×8 or 4×4. Alternatively, the shape of the sub-block is not limited to a square shape; it can be a non-square shape such as 16×8 or 8×4. Alternatively, the DMVR described above can perform motion vector modifications on a 1×1 sample unit.

[0188] Implementation Method 8

[0189] When bidirectional prediction is performed in the first partition, the first prediction block of the first partition can be derived based on decoder-side motion vector refinement (DMVR).

[0190] Specifically, a predetermined search range can be determined based on the motion vector of the first partition. This search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N can be an integer of 1, 2, or larger. As an example, when N is 2, the search range can be defined as a 5×5 region centered on the position indicated by the motion vector of the first partition. In this case, the number of search positions within the search range can be 25.

[0191] Costs can be calculated for each search location within the search range. Illumination compensation can be applied separately to blocks L0 and L1 at the search location. In this case, the cost can be calculated as the sum of absolute differences (SAD) between the illuminated compensated blocks L0 and L1.

[0192] In other words, the lighting compensation parameters for block L0 can be derived based on the neighboring regions of the current block and the neighboring regions of block L0 at the corresponding search position. The derived lighting compensation parameters can then be applied to block L0 to generate a lighting-compensated block L0. Similarly, the lighting compensation parameters for block L1 can be derived based on the neighboring regions of the current block and the neighboring regions of block L1 at the corresponding search position. The derived lighting compensation parameters can then be applied to block L1 to generate a lighting-compensated block L1. The SAD (Super Aspect-Adjusted Dimension) between the lighting-compensated block L0 and the lighting-compensated block L1 can be calculated as a cost.

[0193] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the first partition can be modified to indicate the search position with the minimum cost. The L0 block and L1 block at the search position indicated by the modified motion vector can be set as the L0 prediction block and L1 prediction block of the first partition, respectively.

[0194] Illumination compensation can be applied to the L0 and L1 prediction blocks derived in the manner described above. An illumination-compensated L0 prediction block can be generated by applying pre-derived illumination compensation parameters to the L0 prediction block at the search position indicated by the modified motion vector. Similarly, an illumination-compensated L1 prediction block can be generated by applying pre-derived illumination compensation parameters to the L1 prediction block at the search position indicated by the modified motion vector. The first prediction block for the first partition can be derived based on the weighted sum of the illumination-compensated L0 and L1 prediction blocks.

[0195] On the other hand, when the first partition performs unidirectional prediction, the aforementioned DMVR may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, the first prediction block of the first partition can be derived as either an illumination compensation L0 prediction block or an illumination compensation L1 prediction block.

[0196] When the second partition performs bidirectional prediction, the second prediction block of the second partition can be derived based on DMVR as described above.

[0197] Specifically, the predetermined search range can be determined based on the motion vector of the second partition. This search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the second partition, as described above.

[0198] Costs can be calculated for each search location within the search range. Illumination compensation can be applied separately to blocks L0 and L1 at the search location. In this case, the cost can be calculated as the SAD between the illumination-compensated L0 block and the illumination-compensated L1 block.

[0199] In other words, the lighting compensation parameters for block L0 can be derived based on the neighboring regions of the current block and the neighboring regions of block L0 at the corresponding search position. The derived lighting compensation parameters can then be applied to block L0 to generate a lighting-compensated block L0. Similarly, the lighting compensation parameters for block L1 can be derived based on the neighboring regions of the current block and the neighboring regions of block L1 at the corresponding search position. The derived lighting compensation parameters can then be applied to block L1 to generate a lighting-compensated block L1. The SAD (Super Aspect-Adjusted Dimension) between the lighting-compensated block L0 and the lighting-compensated block L1 can be calculated as a cost.

[0200] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the second partition can be modified to indicate the search position with the minimum cost. The L0 block and L1 block at the search position indicated by the modified motion vector can be set as the L0 prediction block and L1 prediction block of the second partition, respectively.

[0201] Illumination compensation can be applied to the L0 and L1 prediction blocks derived in the manner described above. An illumination-compensated L0 prediction block can be generated by applying pre-derived illumination compensation parameters to the L0 prediction block at the search position indicated by the modified motion vector. Similarly, an illumination-compensated L1 prediction block can be generated by applying pre-derived illumination compensation parameters to the L1 prediction block at the search position indicated by the modified motion vector. A second prediction block for the second partition can be derived based on a weighted sum of the illumination-compensated L0 and L1 prediction blocks.

[0202] On the other hand, when the second partition performs unidirectional prediction, the aforementioned DMVR may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, the second prediction block of the second partition can be derived as either an illumination compensation L0 prediction block or an illumination compensation L1 prediction block.

[0203] The DMVR described above can divide the current block into sub-blocks of a predetermined size and perform motion vector modifications on a sub-block basis. Here, the size of the sub-block can be 16×16. However, it is not limited to this; the size of the sub-block can be 8×8 or 4×4. Alternatively, the shape of the sub-block is not limited to a square shape; it can be a non-square shape such as 16×8 or 8×4. Alternatively, the DMVR described above can perform motion vector modifications on a 1×1 sample unit.

[0204] Implementation Method 9

[0205] When bidirectional prediction is performed in the first partition, the first prediction block of the first partition can be derived based on decoder-side motion vector refinement (DMVR).

[0206] Specifically, a predetermined search range can be determined based on the motion vector of the first partition. This search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N can be an integer of 1, 2, or larger. As an example, when N is 2, the search range can be defined as a 5×5 region centered on the position indicated by the motion vector of the first partition. In this case, the number of search positions within the search range can be 25.

[0207] Costs can be calculated for each search location within the search range. Illumination compensation can be applied to the L0 and L1 blocks at the search locations separately. Predetermined weights of BCW (double prediction with CU-level weights) can be applied to the illumination-compensated L0 and L1 blocks separately. In this case, the cost can be calculated as the sum of absolute differences (SAD) between the weighted L0 and weighted L1 blocks. The BCW weights are the same as those described in Implementation 2, and will be omitted here.

[0208] In other words, the illumination compensation parameters for the L0 block can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 block at the corresponding search position. The derived illumination compensation parameters can be applied to the L0 block to generate an illumination-compensated L0 block. Similarly, the illumination compensation parameters for the L1 block can be derived based on the neighboring regions of the current block and the neighboring regions of the L1 block at the corresponding search position. The derived illumination compensation parameters can be applied to the L1 block to generate an illumination-compensated L1 block. Weighted L0 blocks and weighted L1 blocks can be generated by applying weights derived based on the BCW index to the illumination-compensated L0 blocks and the illumination-compensated L1 blocks respectively. The SAD between the weighted L0 blocks and the weighted L1 blocks can be calculated as a cost.

[0209] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the first partition can be modified to indicate the search position with the minimum cost. The L0 block and L1 block at the search position indicated by the modified motion vector can be set as the L0 prediction block and L1 prediction block of the first partition, respectively.

[0210] Illumination compensation can be applied to the L0 and L1 prediction blocks derived in the above manner. An illumination-compensated L0 prediction block can be generated by applying pre-derived illumination compensation parameters to the L0 prediction block at the search position indicated by the modified motion vector. Similarly, an illumination-compensated L1 prediction block can be generated by applying pre-derived illumination compensation parameters to the L1 prediction block at the search position indicated by the modified motion vector. The first prediction block can be derived based on a weighted average of the illumination-compensated L0 and L1 prediction blocks. In other words, the illumination-compensated L0 and L1 prediction blocks can be derived by applying weights derived based on the BCW index (w...) to each of them. 00 ) and weights (w 01 To derive the first prediction block of the first partition.

[0211] On the other hand, when the first partition performs unidirectional prediction, the aforementioned DMVR and BCW may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, the first prediction block of the first partition can be derived as either an illumination compensation L0 prediction block or an illumination compensation L1 prediction block.

[0212] When the second partition performs bidirectional prediction, the second prediction block of the second partition can be derived based on DMVR as described above.

[0213] Specifically, the predetermined search range can be determined based on the motion vector of the second partition. This search range can be limited to ±N sample sizes in both the horizontal and vertical directions, centered on the position indicated by the motion vector of the second partition, as described above.

[0214] Costs can be calculated for each search location within the search range. Illumination compensation can be applied to the L0 and L1 blocks at the search locations separately. Predetermined weights of BCW can be applied to the illumination-compensated L0 and L1 blocks separately. In this case, the cost can be calculated as the SAD between the weighted L0 and L1 blocks. The BCW weights are the same as described in Implementation 2, and will be omitted here.

[0215] In other words, the illumination compensation parameters for the L0 block can be derived based on the neighboring regions of the current block and the neighboring regions of the L0 block at the corresponding search position. The derived illumination compensation parameters can be applied to the L0 block to generate an illumination-compensated L0 block. Similarly, the illumination compensation parameters for the L1 block can be derived based on the neighboring regions of the current block and the neighboring regions of the L1 block at the corresponding search position. The derived illumination compensation parameters can be applied to the L1 block to generate an illumination-compensated L1 block. Weighted L0 blocks and weighted L1 blocks can be generated by applying weights derived based on the BCW index to the illumination-compensated L0 blocks and the illumination-compensated L1 blocks respectively. The SAD between the weighted L0 blocks and the weighted L1 blocks can be calculated as a cost.

[0216] The search position with the minimum cost among the calculated costs can be determined. The motion vector of the second partition can be modified to indicate the search position with the minimum cost. The L0 block and L1 block at the search position indicated by the modified motion vector can be set as the L0 prediction block and L1 prediction block of the second partition, respectively.

[0217] Illumination compensation can be applied to the L0 and L1 prediction blocks derived in the above manner. An illumination-compensated L0 prediction block can be generated by applying pre-derived illumination compensation parameters to the L0 prediction block at the search position indicated by the modified motion vector. Similarly, an illumination-compensated L1 prediction block can be generated by applying pre-derived illumination compensation parameters to the L1 prediction block at the search position indicated by the modified motion vector. A second prediction block can be derived based on a weighted average of the illumination-compensated L0 and L1 prediction blocks. In other words, the illumination-compensated L0 and L1 prediction blocks can be derived by applying weights (w) derived based on the BCW index to each of the two blocks. 10 ) and weights (w 11 This is used to derive the second prediction block of the second partition.

[0218] On the other hand, when the second partition performs unidirectional prediction, the aforementioned DMVR and BCW may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, the second prediction block of the second partition can be derived as either an illumination compensation L0 prediction block or an illumination compensation L1 prediction block.

[0219] The DMVR described above can divide the current block into sub-blocks of a predetermined size and perform motion vector modifications on a sub-block basis. Here, the size of the sub-block can be 16×16. However, it is not limited to this; the size of the sub-block can be 8×8 or 4×4. Alternatively, the shape of the sub-block is not limited to a square shape; it can be a non-square shape such as 16×8 or 8×4. Alternatively, the DMVR described above can perform motion vector modifications on a 1×1 sample unit.

[0220] Implementation Method 10

[0221] According to the BDOF (Bidirectional Optical Flow) disclosed herein, the optimal motion vector can be found in predetermined sub-blocks based on bidirectional motion vectors obtained in units of coding blocks, and the final prediction block can be derived by estimating the sample value changes at each sample position within the coding block based on the optimal motion vector. The sub-block is a 4×4 block, but is not limited to this.

[0222] When bidirectional prediction is performed on the first partition, L0 and L1 prediction blocks can be derived for the first partition. When the first prediction block of the first partition is derived based on the L0 and L1 prediction blocks of the first partition, BDOF can be applied.

[0223] When applying BDOF, it can be based on the sample values ​​(pred00) of the L0 prediction block of the first partition, the sample values ​​(pred01) of the L1 prediction block of the first partition, and the predetermined offset (Offset0) of the BDOF of the first partition. BDOF To derive the sample value (pred0) of the first prediction block. BDOF Here, the predetermined offset can be derived based on at least one of the horizontal / vertical gradient at the sample position of pred00 or the horizontal / vertical gradient at the sample position of pred01. As an example, the predetermined offset can be derived as shown in Equation 4 below.

[0224] [Formula 4]

[0225]

[0226] In Equation 4, offset0 BDOF (i,j) represents the offset corresponding to the sample position (i,j). x and v0 y This can be a modified motion vector that minimizes the distortion between the L0 and L1 prediction blocks in the first partition. v0 x and v0 y The gradient can be derived on a sub-block basis within the current block. `gradH00(i,j)` represents the horizontal gradient at sample position (i,j) within the L0 prediction block of the first partition. `gradH01(i,j)` represents the horizontal gradient at sample position (i,j) within the L1 prediction block of the first partition. `gradV00(i,j)` represents the vertical gradient at sample position (i,j) within the L0 prediction block of the first partition. `gradV01(i,j)` represents the vertical gradient at sample position (i,j) within the L1 prediction block of the first partition. The horizontal gradient can be the variation in at least two samples horizontally adjacent to sample position (i,j). The vertical gradient can be the variation in at least two samples vertically adjacent to sample position (i,j).

[0227] On the other hand, when the first partition performs unidirectional prediction, the aforementioned BDOF may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block.

[0228] When bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. When the second prediction block of the second partition is derived based on the L0 and L1 prediction blocks of the second partition, BDOF can be applied.

[0229] When applying BDOF, it can be based on the sample values ​​(pred10) of the L0 prediction block of the second partition, the sample values ​​(pred11) of the L1 prediction block of the second partition, and the predetermined offset (Offset1) of the BDOF of the second partition. BDOF To derive the sample values ​​of the second prediction block (pred1) BDOF Here, the predetermined offset can be derived based on at least one of the horizontal / vertical gradient at the sample position of pred10 or the horizontal / vertical gradient at the sample position of pred11. As an example, the predetermined offset can be derived as shown in Equation 5 below.

[0230] [Formula 5]

[0231]

[0232] In Equation 5, Offset1 BDOF (i,j) represents the offset corresponding to the sample position (i,j). v1 x and v1 y This can be a modified motion vector that minimizes the distortion between the L0 and L1 prediction blocks in the second partition. v1 x and v1 y The gradient can be derived on a sub-block basis within the current block. `gradH10(i,j)` represents the horizontal gradient at sample position (i,j) within the L0 prediction block of the second partition. `gradH11(i,j)` represents the horizontal gradient at sample position (i,j) within the L1 prediction block of the second partition. `gradV10(i,j)` represents the vertical gradient at sample position (i,j) within the L0 prediction block of the second partition. `gradV11(i,j)` represents the vertical gradient at sample position (i,j) within the L1 prediction block of the second partition. The horizontal gradient can be the variation in at least two samples horizontally adjacent to sample position (i,j). The vertical gradient can be the variation in at least two samples vertically adjacent to sample position (i,j).

[0233] On the other hand, when the second partition performs unidirectional prediction, the aforementioned BDOF may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block.

[0234] Implementation Method 11

[0235] When bidirectional prediction is performed on the first partition, the L0 and L1 prediction blocks can be derived for the first partition. The first prediction block of the first partition can be derived by applying BCW (bidirectional prediction with CU-level weights) and BDOF (bidirectional optical flow) to the L0 and L1 prediction blocks of the first partition.

[0236] In other words, the sample values ​​of the first prediction block can be derived based on at least one of the values ​​derived from the weighted average of the sample values ​​of the L0 prediction block and the L1 prediction block of the first partition, or the offset of the BDOF of the first partition. The weights of the weighted average can be derived based on the BCW index of the first partition, which is the same as described in Implementation 2. In addition, the offset of the BDOF of the first partition is the same as described in Implementation 10.

[0237] On the other hand, when the first partition performs unidirectional prediction, the aforementioned BCW and BDOF may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block.

[0238] When bidirectional prediction is performed on the second partition, the L0 and L1 prediction blocks can be derived for the second partition. The second prediction block of the second partition can be derived by applying BCW and BDOF to the L0 and L1 prediction blocks of the second partition.

[0239] In other words, the sample values ​​of the second prediction block can be derived based on at least one of the values ​​derived from the weighted average of the sample values ​​of the L0 prediction block and the L1 prediction block of the second partition, or the offset of the BDOF of the second partition. The weights of the weighted average can be derived based on the BCW index of the second partition, which is the same as described in Implementation 2. In addition, the offset of the BDOF of the second partition is the same as described in Implementation 10.

[0240] On the other hand, when the second partition performs unidirectional prediction, the aforementioned BCW and BDOF may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block.

[0241] Implementation Method 12

[0242] When bidirectional prediction is performed on the first partition, L0 and L1 prediction blocks can be derived for the first partition. In this case, the L0 and L1 prediction blocks of the first partition can be derived based on DMVR (decoder-side motion vector refinement). The method for deriving L0 / L1 prediction blocks based on DMVR is the same as that described in Implementation 3, and will be omitted here.

[0243] The first prediction block of the first partition can be derived by applying BDOF (bidirectional optical flow) to the L0 and L1 prediction blocks of the first partition derived based on DMVR. In other words, the L0 and L1 prediction blocks of the first partition can be derived based on DMVR. The sample values ​​of the first prediction block of the first partition can be derived based on at least one of the weighted sum of the sample values ​​of the derived L0 prediction block and the sample values ​​of the L1 prediction block, or the offset of the BDOF of the first partition. The offset of the BDOF of the first partition is the same as that described in Implementation 10.

[0244] On the other hand, when the first partition performs unidirectional prediction, the aforementioned DMVR and BDOF may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block.

[0245] When bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. In this case, the L0 and L1 prediction blocks of the second partition can be derived based on DMVR. The method for deriving L0 / L1 prediction blocks based on DMVR is the same as that described in Implementation 3, and will be omitted here.

[0246] The second prediction block of the second partition can be derived by applying BDOF to the L0 and L1 prediction blocks of the second partition derived based on DMVR. In other words, the L0 and L1 prediction blocks of the first partition can be derived based on DMVR. The sample values ​​of the second prediction block of the second partition can be derived based on at least one of the weighted sum of the sample values ​​of the derived L0 prediction block and the sample values ​​of the L1 prediction block, or the offset of the BDOF of the second partition. The offset of the BDOF of the second partition is the same as that described in Implementation 10.

[0247] On the other hand, when the second partition performs unidirectional prediction, the aforementioned BDOF may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block.

[0248] Implementation Method 13

[0249] When bidirectional prediction is performed on the first partition, L0 and L1 prediction blocks can be derived for the first partition. In this case, the L0 and L1 prediction blocks of the first partition can be derived based on DMVR (decoder-side motion vector refinement). Here, the method for deriving L0 / L1 prediction blocks based on DMVR is the same as that described in Implementation 4, and will be omitted here.

[0250] The first prediction block of the first partition can be derived by applying BDOF (Bidirectional Optical Flow) to the L0 and L1 prediction blocks derived in the manner described above. In other words, the sample values ​​of the first prediction block can be derived based on at least one of the values ​​derived from a weighted average of the sample values ​​of the L0 and L1 prediction blocks of the first partition, or the offset of the BDOF of the first partition. The weights of the weighted average can be derived based on the BCW index of the first partition, which is the same as described in Embodiment 2. Furthermore, the offset of the BDOF of the first partition is the same as described in Embodiment 10.

[0251] On the other hand, when the first partition performs unidirectional prediction, the aforementioned DMVR and BDOF may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block.

[0252] When bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. In this case, the L0 and L1 prediction blocks of the second partition can be derived based on DMVR (decoder-side motion vector refinement). Here, the method for deriving L0 / L1 prediction blocks based on DMVR is the same as that described in Implementation 4, and will be omitted here.

[0253] The second prediction block of the second partition can be derived by applying BDOF to the L0 and L1 prediction blocks derived in the manner described above. In other words, the sample values ​​of the second prediction block can be derived based on at least one of the values ​​derived from the weighted average of the sample values ​​of the L0 and L1 prediction blocks of the second partition, or the offset of the BDOF of the second partition. The weights of the weighted average can be derived based on the BCW index of the second partition, which is the same as described in Embodiment 2. In addition, the offset of the BDOF of the second partition is the same as described in Embodiment 10.

[0254] On the other hand, when the second partition performs unidirectional prediction, the aforementioned DMVR and BDOF may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block.

[0255] Implementation Method 14

[0256] When bidirectional prediction is performed on the first partition, L0 and L1 prediction blocks can be derived for the first partition. Illumination compensation can be applied to the L0 and L1 prediction blocks of the first partition respectively. The method for generating the illumination compensation L0 / L1 prediction blocks is the same as described in Implementation 5, and will be omitted here.

[0257] The first prediction block of the first partition can be derived by applying BDOF (bidirectional optical flow) to the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the first partition. In other words, the sample values ​​of the first prediction block of the first partition can be derived based on at least one of the weighted sum of the sample values ​​of the illumination compensation L0 prediction block and the illumination compensation L1 prediction block, or the offset of the BDOF of the first partition. The offset of the BDOF of the first partition is the same as that described in Implementation 10.

[0258] On the other hand, when the first partition performs unidirectional prediction, the aforementioned BDOF may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, illumination compensation can be applied to the L0 or L1 prediction block of the first partition, and the illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the first prediction block of the first partition.

[0259] When bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. Illumination compensation can be applied to the L0 and L1 prediction blocks of the second partition respectively. The method for generating the illumination compensation L0 / L1 prediction blocks is the same as described in Implementation 5, and will be omitted here.

[0260] The second prediction block of the second partition can be derived by applying BDOF to the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the second partition. In other words, the sample values ​​of the second prediction block of the second partition can be derived based on at least one of the weighted sum of the sample values ​​of the illumination compensation L0 prediction block and the sample values ​​of the illumination compensation L1 prediction block, or the offset of the BDOF of the second partition. The offset of the BDOF of the second partition is the same as that described in Implementation 10.

[0261] On the other hand, when the second partition performs unidirectional prediction, the aforementioned BDOF may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, illumination compensation can be applied to the L0 or L1 prediction block of the second partition, and the illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the second prediction block of the second partition.

[0262] Implementation Method 15

[0263] When bidirectional prediction is performed on the first partition, L0 and L1 prediction blocks can be derived for the first partition. Illumination compensation can be applied to the L0 and L1 prediction blocks of the first partition respectively. The method for generating the illumination compensation L0 / L1 prediction blocks is the same as described in Implementation 5, and will be omitted here.

[0264] The first prediction block of the first partition can be derived by applying BCW (double prediction with CU-level weights) and BDOF (bidirectional optical flow) to the illumination compensation L0 prediction block and illumination compensation L1 prediction block of the first partition.

[0265] In other words, the sample values ​​of the first prediction block can be derived based on at least one of the values ​​derived from a weighted average of the sample values ​​of the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the first partition, or the offset of the BDOF of the first partition. The weights of the weighted average can be derived based on the BCW index of the second partition, which is the same as described in Implementation 1. In addition, the offset of the BDOF of the first partition is the same as described in Implementation 10.

[0266] On the other hand, when the first partition performs unidirectional prediction, the aforementioned BCW and BDOF may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, illumination compensation can be applied to the L0 or L1 prediction block of the first partition, and the illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the first prediction block of the first partition.

[0267] When bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. Illumination compensation can be applied to the L0 and L1 prediction blocks of the second partition respectively. The method for generating the illumination compensation L0 / L1 prediction blocks is the same as described in Implementation 5, and will be omitted here.

[0268] The second prediction block for the second partition can be derived by applying BCW and BDOF to the lighting compensation L0 prediction block and the lighting compensation L1 prediction block for the second partition.

[0269] In other words, the sample values ​​of the second prediction block can be derived based on at least one of the values ​​derived from a weighted average of the sample values ​​of the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the second partition, or the offset of the BDOF of the second partition. The weights of the weighted average can be derived based on the BCW index of the second partition, which is the same as described in Implementation 2. In addition, the offset of the BDOF of the second partition is the same as described in Implementation 10.

[0270] On the other hand, when the second partition performs unidirectional prediction, the aforementioned BCW and BDOF may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, illumination compensation can be applied to the L0 or L1 prediction block of the second partition, and the illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the second prediction block of the second partition.

[0271] Implementation Method 16

[0272] When bidirectional prediction is performed on the first partition, L0 and L1 prediction blocks can be derived for the first partition. In this case, the L0 and L1 prediction blocks of the first partition can be derived based on DMVR (decoder-side motion vector refinement). Here, the method for deriving L0 / L1 prediction blocks based on DMVR is the same as that described in Implementation 8, and will be omitted here.

[0273] Illumination compensation can be applied to the L0 prediction block and L1 prediction block derived in the above manner to generate illumination-compensated L0 prediction block and illumination-compensated L1 prediction block, which are the same as those described in Implementation 8.

[0274] The first prediction block of the first partition can be derived by applying BDOF (bidirectional optical flow) to the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the first partition.

[0275] In other words, the sample values ​​of the first prediction block can be derived based on at least one of the weighted sum of the sample values ​​of the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the first partition, or the offset of the BDOF of the first partition. The offset of the BDOF of the first partition is the same as that described in Implementation 10.

[0276] On the other hand, when the first partition performs unidirectional prediction, the aforementioned DMVR and BDOF may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, illumination compensation can be applied to the L0 or L1 prediction block of the first partition, and the illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the first prediction block of the first partition.

[0277] When bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. In this case, the L0 and L1 prediction blocks of the first partition can be derived based on DMVR (decoder-side motion vector refinement). Here, the method for deriving L0 / L1 prediction blocks based on DMVR is the same as that described in Implementation 8, and will be omitted here.

[0278] Illumination compensation can be applied to the L0 prediction block and L1 prediction block derived in the above manner to generate illumination-compensated L0 prediction block and illumination-compensated L1 prediction block, which are the same as those described in Implementation 8.

[0279] The second prediction block of the second partition can be derived by applying BDOF to the lighting compensation L0 prediction block and the lighting compensation L1 prediction block of the second partition.

[0280] In other words, the sample values ​​of the second prediction block can be derived based on at least one of the weighted sum of the sample values ​​of the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the second partition, or the offset of the BDOF of the second partition. The offset of the BDOF of the second partition is the same as that described in Implementation 10.

[0281] On the other hand, when the second partition performs unidirectional prediction, the aforementioned DMVR and BDOF may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, illumination compensation can be applied to the L0 or L1 prediction block of the second partition, and the illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the second prediction block of the second partition.

[0282] Implementation Method 17

[0283] When bidirectional prediction is performed on the first partition, L0 and L1 prediction blocks can be derived for the first partition. In this case, the L0 and L1 prediction blocks of the first partition can be derived based on DMVR (decoder-side motion vector refinement). Here, the method for deriving L0 / L1 prediction blocks based on DMVR is the same as that described in Implementation 9, and will be omitted here.

[0284] Illumination compensation can be applied to the L0 prediction block and L1 prediction block derived in the above manner to generate illumination-compensated L0 prediction block and illumination-compensated L1 prediction block, which are the same as those described in Implementation 9.

[0285] The first prediction block of the first partition can be derived by applying BDOF (bidirectional optical flow) to the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the first partition.

[0286] In other words, the sample values ​​of the first prediction block can be derived based on at least one of the values ​​derived from a weighted average of the sample values ​​of the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the first partition, or the offset of the BDOF of the first partition. The weights of the weighted average can be derived based on the BCW index of the second partition, which is the same as described in Implementation 1. In addition, the offset of the BDOF of the first partition is the same as described in Implementation 10.

[0287] On the other hand, when the first partition performs unidirectional prediction, the aforementioned DMVR and BDOF may not be applied when deriving the first prediction block of the first partition. In this case, the first prediction block of the first partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, illumination compensation can be applied to the L0 or L1 prediction block of the first partition, and the illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the first prediction block of the first partition.

[0288] When bidirectional prediction is performed on the second partition, L0 and L1 prediction blocks can be derived for the second partition. In this case, the L0 and L1 prediction blocks of the second partition can be derived based on DMVR. Here, the method for deriving L0 / L1 prediction blocks based on DMVR is the same as that described in Implementation 9, and will be omitted here.

[0289] Illumination compensation can be applied to the L0 prediction block and L1 prediction block derived in the above manner to generate illumination-compensated L0 prediction block and illumination-compensated L1 prediction block, which are the same as those described in Implementation 9.

[0290] The second prediction block of the second partition can be derived by applying BDOF to the lighting compensation L0 prediction block and the lighting compensation L1 prediction block of the second partition.

[0291] In other words, the sample values ​​of the second prediction block can be derived based on at least one of the values ​​derived from a weighted average of the sample values ​​of the illumination compensation L0 prediction block and the illumination compensation L1 prediction block of the second partition, or the offset of the BDOF of the second partition. The weights of the weighted average can be derived based on the BCW index of the second partition, which is the same as described in Implementation 2. In addition, the offset of the BDOF of the second partition is the same as described in Implementation 10.

[0292] On the other hand, when the second partition performs unidirectional prediction, the aforementioned DMVR and BDOF may not be applied when deriving the second prediction block of the second partition. In this case, the second prediction block of the second partition can be derived as either an L0 prediction block or an L1 prediction block. Alternatively, illumination compensation can be applied to the L0 or L1 prediction block of the second partition, and the illumination-compensated L0 prediction block or the illumination-compensated L1 prediction block can be set as the second prediction block of the second partition.

[0293] The same or different prediction modes can be applied to multiple partitions belonging to the current block. The prediction modes for each partition can be any of the following: merge mode, AMVP mode, intra-block copy (IBC) mode, template-match-based prediction (TMP) mode, or intra-prediction mode. Even when multiple partitions use different prediction modes, one-way or bi-way prediction corresponding to the corresponding prediction mode can be performed for each partition. The following describes the method for deriving L0 / L1 prediction blocks for each prediction mode of each partition.

[0294] Derivation Method 1

[0295] The first and second partitions of the current block can be blocks encoded in a merge mode. In this case, in embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the first and second partitions can be derived based on the merge mode.

[0296] Specifically, a merge candidate list for the current block can be configured. The merge candidate list can include one or more merge candidates. Merge candidates for the first partition can be selected from the merge candidate list. The motion vectors for the first partition can be derived based on the motion vectors of the selected merge candidates. When the selected merge candidate performs unidirectional prediction, the motion vectors for the first partition can be either L0 or L1 motion vectors. When the selected merge candidate performs bidirectional prediction, the motion vectors for the first partition can include both L0 and L1 motion vectors. Based on the L0 and L1 motion vectors of the first partition, the L0 prediction block and L1 prediction block for the first partition can be derived separately.

[0297] Furthermore, merge candidates for the second partition can be selected from the merge candidate list of the current block. The motion vectors for the second partition can be derived based on the motion vectors of the selected merge candidate. When the selected merge candidate performs unidirectional prediction, the motion vectors for the second partition can be either L0 or L1 motion vectors. When the selected merge candidate performs bidirectional prediction, the motion vectors for the second partition can include both L0 and L1 motion vectors. Based on the L0 and L1 motion vectors of the second partition, the L0 prediction block and L1 prediction block of the second partition can be derived separately.

[0298] Derivation Method 2

[0299] The first partition of the current block can be a block encoded in merge mode, and the second partition of the current block can be a block encoded in IBC mode. In this case, in embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the first partition can be derived based on the merge mode. In embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the second partition can be derived based on the IBC mode.

[0300] Specifically, a merge candidate list for the first partition of the current block can be configured, and the L0 and / or L1 predicted blocks for the first partition can be derived based on the merge candidate list. This is the same as described in Implementation 1, and will be omitted here.

[0301] A candidate IBC list for the second partition of the current block can be configured. The IBC candidate list can include one or more IBC candidates. Candidates for the second partition can be selected from the IBC candidate list. Motion vectors for the second partition can be derived based on the motion vectors of the selected IBC candidate. When the selected IBC candidate performs unidirectional prediction, the motion vector for the second partition can be either an L0 motion vector or an L1 motion vector. When the selected IBC candidate performs bidirectional prediction, the motion vector for the second partition can include both L0 and L1 motion vectors. The L0 and L1 prediction blocks for the second partition can be derived separately by performing intra-block copying based on the L0 and L1 motion vectors of the second partition.

[0302] Derivation Method 3

[0303] The first and second partitions of the current block can be blocks encoded in IBC mode. In this case, in embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the first and second partitions can be derived based on the IBC mode.

[0304] Specifically, an IBC candidate list for the current block can be configured. The IBC candidate list can include one or more IBC candidates. An IBC candidate for the first partition can be selected from the IBC candidate list. The motion vector of the first partition can be derived based on the motion vector of the selected IBC candidate. When the selected IBC candidate performs unidirectional prediction, the motion vector of the first partition can be either an L0 motion vector or an L1 motion vector. When the selected IBC candidate performs bidirectional prediction, the motion vector of the first partition can include both L0 and L1 motion vectors. The L0 and L1 predicted blocks for the first partition can be derived separately by performing intra-block copying based on the L0 and L1 motion vectors of the first partition.

[0305] Alternatively, IBC candidates for the second partition can be selected from the IBC candidate list of the current block, and the L0 and / or L1 prediction blocks for the second partition can be derived based on the selected IBC candidates. This is the same as described in Implementation 2, and will be omitted here as a repetition.

[0306] Derivation Method 4

[0307] The first partition of the current block can be a block encoded in merge mode, and the second partition of the current block can be a block encoded in TMP mode. In this case, in embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the first partition can be derived based on the merge mode. In embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the second partition can be derived based on the TMP mode.

[0308] Specifically, a merge candidate list for the first partition of the current block can be configured, and the L0 and / or L1 predicted blocks for the first partition can be derived based on the merge candidate list. This is the same as described in Implementation 1, and will be omitted here.

[0309] Additionally, a TMP candidate list for the second partition of the current block can be configured. The TMP candidate list can include one or more TMP candidates. A TMP candidate for the second partition can be selected from the TMP candidate list. As an example, for each of the one or more TMP candidates belonging to the TMP candidate list, the difference between the template region of the current block and the template region of the reference block can be calculated. Here, the reference block can be specified based on the corresponding TMP candidate. Among the one or more TMP candidates belonging to the TMP candidate list, the TMP candidate with the smallest difference value can be selected as the TMP candidate for the second partition.

[0310] Motion vectors for the second partition can be derived based on selected TMP candidates. A predetermined search range for template matching can be determined based on the motion vectors of the second partition, and template matching can be performed within this search range to derive L0 and / or L1 predicted blocks for the second partition. As an example, a search range within an L0 reference frame can be determined based on the L0 motion vectors of the second partition, and the difference between the template region of the current block and the template region of the reference block at the corresponding search position can be calculated for each search position within the search range. Among the search positions within the search range, the search position with the smallest difference can be determined. The reference block at the determined search position can be derived as an L0 predicted block for the second partition. Similarly, a search range within an L1 reference frame can be determined based on the L1 motion vectors of the second partition, and the difference between the template region of the current block and the template region of the reference block at the corresponding search position can be calculated for each search position within the search range. Among the search positions within the search range, the search position with the smallest difference can be determined. The reference block at the determined search position can be derived as an L1 predicted block for the second partition.

[0311] Derivation Method 5

[0312] The first partition of the current block can be a block encoded in IBC mode, and the second partition of the current block can be a block encoded in TMP mode. In this case, in embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the first partition can be derived based on the IBC mode. In embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the second partition can be derived based on the TMP mode.

[0313] Specifically, an IBC candidate list for the first partition of the current block can be configured, and the L0 and / or L1 predicted blocks for the first partition can be derived based on the IBC candidate list. This is the same as described in Implementation 3, and will be omitted here.

[0314] Additionally, a TMP candidate list for the second partition of the current block can be configured, and the L0 and / or L1 predicted blocks for the second partition can be derived based on the TMP candidate list. This is the same as described in Implementation 4, and will be omitted here.

[0315] Derivation Method 6

[0316] The first and second partitions of the current block can be blocks encoded in TMP mode. In this case, in embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the first partition can be derived based on the TMP mode. In embodiments 1 to 17 described above, the L0 and / or L1 predicted blocks of the second partition can be derived based on the TMP mode.

[0317] Specifically, a TMP candidate list for the current block can be configured. The TMP candidate list can include one or more TMP candidates. A TMP candidate for the first partition can be selected from the TMP candidate list. As an example, for each of the one or more TMP candidates belonging to the TMP candidate list, the difference between the template region of the current block and the template region of the reference block can be calculated. Here, the reference block can be specified based on the corresponding TMP candidate. Among the one or more TMP candidates belonging to the TMP candidate list, the TMP candidate with the smallest difference value can be selected as the TMP candidate for the first partition.

[0318] Motion vectors for the first partition can be derived based on selected TMP candidates. A predetermined search range for template matching can be determined based on the motion vectors of the first partition, and template matching can be performed within this search range to derive L0 and / or L1 predicted blocks for the first partition. As an example, a search range within an L0 reference frame can be determined based on the L0 motion vectors of the first partition, and the difference between the template region of the current block and the template region of the reference block at the corresponding search position can be calculated for each search position within the search range. Among the search positions within the search range, the search position with the smallest difference can be determined. The reference block at the determined search position can be derived as an L0 predicted block for the first partition. Similarly, a search range within an L1 reference frame can be determined based on the L1 motion vectors of the first partition, and the difference between the template region of the current block and the template region of the reference block at the corresponding search position can be calculated for each search position within the search range. Among the search positions within the search range, the search position with the smallest difference can be determined. The reference block at the determined search position can be derived as an L1 predicted block for the first partition.

[0319] Alternatively, the L0 and / or L1 predicted blocks for the second partition can be derived based on the TMP candidate list of the current block. This is the same as described in Implementation 4, and will be omitted here as a repetition.

[0320] The BCW index in the above embodiments can be signaled via a bitstream, or it can be derived from the encoding / decoding device.

[0321] As an example, when the current block is encoded in merge mode, the BCW index can be derived from the merge candidate list of the current block. The BCW index can be derived for the first and second partitions of the current block respectively.

[0322] Specifically, the merge candidate for the first partition of the current block can be determined from the merge candidate list, and the BCW index value of the first partition can be derived based on the BCW index value of the corresponding merge candidate. The BCW index value of the first partition can be set to the same value as the BCW index of the merge candidate for the first partition. Similarly, the merge candidate for the second partition of the current block can be determined from the merge candidate list, and the BCW index value of the second partition can be derived based on the BCW index value of the corresponding merge candidate. The BCW index value of the second partition can be set to the same value as the BCW index of the merge candidate for the second partition.

[0323] The illumination compensation flag in the above embodiments can be signaled via a bitstream, or it can be derived from the encoding / decoding device.

[0324] As an example, when the current block is encoded in merge mode, the illumination compensation flag can be derived from the merge candidate list of the current block. The illumination compensation flag can be derived for the first and second partitions of the current block, respectively.

[0325] Specifically, the merge candidate for the first partition of the current block can be determined from the merge candidate list, and the value of the lighting compensation flag for the first partition can be derived based on the value of the lighting compensation flag for the corresponding merge candidate. The value of the lighting compensation flag for the first partition can be set to the same value as the lighting compensation flag for the merge candidate of the first partition. Similarly, the merge candidate for the second partition of the current block can be determined from the merge candidate list, and the value of the lighting compensation flag for the second partition can be derived based on the value of the lighting compensation flag for the corresponding merge candidate. The value of the lighting compensation flag for the second partition can be set to the same value as the lighting compensation flag for the merge candidate of the second partition.

[0326] The BCW index can be stored as the application of each partition of the current block in response to the split shape of the current block.

[0327] When a geometric segmentation pattern is applied to the current block, motion information for both the first and second partitions can exist simultaneously within the current block, which is treated as a single encoding unit. Therefore, the motion information for both the first and second partitions can be stored in response to the segmentation shape of the current block. In this case, the BCW index can be stored concurrently with the storage of motion information in response to the segmentation shape of the current block.

[0328] Specifically, the current block can be divided into a first region, a second region, and a mixed region. Here, the first region belongs to the first partition and can be defined as the region within the current block that is not crossed by the partition boundaries. The second region belongs to the second partition and can be defined as the region within the current block that is not crossed by the partition boundaries. The mixed region can be defined as the region within the current block that is crossed by the partition boundaries.

[0329] Motion information from the first partition can be stored in the first region. Motion information from the second partition can be stored in the second region. New motion information, a combination of the motion information from the first and second partitions based on predefined conditions, can be stored in the mixed region. As an example, a bidirectional motion vector can be generated based on a combination of either the L0 or L1 motion vector from the first partition and either the L0 or L1 motion vector from the second partition, and the generated bidirectional motion vector can be stored in the mixed region. Alternatively, either the motion information from the first or second partition can be selected based on predefined conditions, and the selected motion information can be stored in the mixed region.

[0330] Furthermore, the BCW index of the first partition can be stored in the first region. The BCW index of the second partition can be stored in the second region. BCW indexes based on predefined conditions can be stored in the mixed region. As an example, when the first and second partitions have different BCW indexes, the BCW index of either partition can be selectively stored in the mixed region. In this case, among the BCW indexes of the first and second partitions, the index that is not BCW_DEFAULT can be stored preferentially. Here, BCW_DEFAULT can be a BCW index that indicates the same weight applied to the L0 prediction block and the L1 prediction block. On the other hand, when the BCW indexes of the first and second partitions are the same, the corresponding BCW index can be stored in the mixed region.

[0331] Additionally, lighting compensation flags can be stored during the process of storing motion information in response to the segmentation shape of the current block.

[0332] Specifically, the illumination compensation flag (LIC flag) for the first partition can be stored in the first region. The illumination compensation flag for the second partition can be stored in the second region. Illumination compensation flags based on predefined conditions can be stored in a mixed region. As an example, when the first and second partitions have different illumination compensation flags, the illumination compensation flag of either partition can be selectively stored in the mixed region. In this case, the illumination compensation flag with the minimum value among the illumination compensation flags of the first and second partitions can be stored in the mixed region. In other words, when the illumination compensation flags of the first and second partitions are different, the illumination compensation flag indicating that illumination compensation is not performed can be preferentially stored in the mixed region. Alternatively, the illumination compensation flag with the maximum value among the illumination compensation flags of the first and second partitions can be stored in the mixed region. In other words, when the illumination compensation flags of the first and second partitions are different, the illumination compensation flag indicating that illumination compensation is performed can be preferentially stored in the mixed region. On the other hand, when the illumination compensation flags of the first and second partitions are the same, the corresponding illumination compensation flag can be stored in the mixed region.

[0333] Reference Figure 4 The prediction block S420 of the current block can be derived based on the first prediction block of the first partition and the second prediction block of the second partition.

[0334] A merging process can be performed where the first predicted block of the first partition and the second predicted block of the second partition are weighted and averaged in the form of geometric partitions. The final predicted block of the current block can be derived through this merging process between the first and second predicted blocks.

[0335] When performing bidirectional prediction for each partition of the current block, bit precision can be increased or decreased by taking into account the internal bit depth and the output bit depth.

[0336] As described above, the first prediction block (P0) of the first partition and the second prediction block (P1) of the second partition can be derived separately. In this case, the first prediction block (P0) of the first partition and the second prediction block (P1) of the second partition can be derived by bidirectional prediction.

[0337] When the internal bit depth and the output bit depth are different, the bit precision of P0 and P1 can be reduced in response to the output bit depth.

[0338] As an example, when the output bit depth is 10 bits and the internal bit depth is greater than or equal to 10 bits, in deriving the L0 prediction block (P) of the first partition... 00 ) and L1 prediction block (P 01During the process, it can maintain the same bit precision as the internal bit depth, and in the L0 prediction block (P) based on the first partition, 00 ) and L1 prediction block (P 01 During the derivation of the first prediction block for the first partition, a reduction process can be performed to derive a first prediction block with the same bit precision as the output bit depth. Similarly, in deriving the L0 prediction block (P) for the second partition... 10 ) and L1 prediction block (P 11 During the process, it can maintain the same bit precision as the internal bit depth, and in the L0 prediction block (P) based on the second partition, 10 ) and L1 prediction block (P 11 During the process of deriving the second prediction block of the second partition, a reduction can be performed to derive a second prediction block with the same bit precision as the output bit depth.

[0339] Alternatively, when the output bit depth is 10 bits and the internal bit depth is greater than or equal to 10 bits, the same bit precision as the internal bit depth can be maintained during the derivation of the first prediction block (P0) of the first partition and the second prediction block (P1) of the second partition. Furthermore, during the derivation of the prediction block of the current block based on the first prediction block of the first partition and the second prediction block of the second partition, a reduction process can be performed to derive a prediction block with the same bit precision as the output bit depth. In other words, by maintaining a high degree of bit precision in the first prediction block of the first partition and the second prediction block of the second partition before deriving the final prediction block of the current block, the performance of the final prediction block generation can be improved.

[0340] The internal bit depth can be 14 bits, 16 bits, 20 bits or higher, and the output bit depth can be 10 bits, 12 bits, 16 bits or higher.

[0341] Figure 5 A schematic configuration of an inter-frame predictor 332 performing the inter-frame prediction method according to this disclosure is shown.

[0342] Reference Figure 5 The inter-frame predictor 332 may include a block segmenter 500 and a prediction block deducer 510.

[0343] Block splitter 500 can divide the current block into multiple partitions. In this case, the current block can be divided into two or more partitions based on one or more split lines. As an example, the current block can be divided into two or more partitions based on geometric partitioning.

[0344] The prediction block derivator 510 may include at least one of a first prediction block derivator (not shown) that derives prediction blocks for each partition of the current block, or a second prediction block derivator (not shown) that derives the final prediction block of the current block based on the prediction blocks for each partition output from the first prediction block derivator.

[0345] The first prediction block deducer can derive the first prediction block (P0) of the first partition of the current block. In this case, the first prediction block of the first partition can be derived by one-way or two-way prediction. Additionally, the first prediction block deducer can derive the second prediction block (P1) of the second partition of the current block. In this case, the second prediction block of the second partition can be derived by one-way or two-way prediction.

[0346] The first prediction block derivator can be based on a reference. Figure 4 At least one of the described embodiments 1 to 17 is used to derive the first and second prediction blocks of the current block.

[0347] The same or different prediction modes can be applied to multiple partitions belonging to the current block. The method for deriving the L0 / L1 prediction blocks for each prediction mode of each partition is the same as described in derivation methods 1 to 6 above.

[0348] The BCW index and / or illumination compensation flags according to this disclosure can be signaled via a bitstream, or deduced from the encoding / decoding device. This is consistent with reference to... Figure 4 Since the descriptions are the same, repeated descriptions will be omitted here.

[0349] It can store at least one of motion information, BCW index, or lighting compensation flags applied to each partition of the current block in response to the segmentation shape of the current block, which is consistent with the reference. Figure 4 The description is the same.

[0350] Figure 6 An inter-frame prediction method is shown as performed by an encoding device 200 according to an embodiment of the present disclosure.

[0351] Reference Figure 6 The current block can be divided into multiple partitions S600. In this case, the current block can be divided into two or more partitions based on one or more dividing lines. As an example, the current block can be divided into two or more partitions based on geometric partitioning.

[0352] Reference Figure 6 It can derive the prediction block S610 for each partition of the current block.

[0353] The first predicted block (P0) can be derived for the first partition of the current block. In this case, the first predicted block of the first partition can be derived through one-way or two-way prediction. Additionally, the first predicted block deriver can derive the second predicted block (P1) for the second partition of the current block. In this case, the second predicted block of the second partition can be derived through one-way or two-way prediction.

[0354] The first and second predicted blocks of the current block can be based on a reference. Figure 4 The description is derived from at least one of the described embodiments 1 to 17, and repeated descriptions will be omitted here.

[0355] The same or different prediction modes can be applied to multiple partitions belonging to the current block. The method for deriving the L0 / L1 prediction blocks for each prediction mode of each partition is the same as described in derivation methods 1 to 6 above.

[0356] The BCW index and / or illumination compensation flags according to this disclosure can be signaled via a bitstream, or deduced from the encoding / decoding device. This is consistent with reference to... Figure 4 Since the descriptions are the same, repeated descriptions will be omitted here.

[0357] It can store at least one of motion information, BCW index, or lighting compensation flags applied to each partition of the current block in response to the segmentation shape of the current block, which is consistent with the reference. Figure 4 The description is the same.

[0358] Reference Figure 6 The prediction block S620 of the current block can be derived based on the first prediction block of the first partition and the second prediction block of the second partition.

[0359] A blending process can be performed, in which a weighted average is taken from the first predicted block of the first partition and the second predicted block of the second partition in the form of geometric division. The final predicted block of the current block can be derived from this blending process between the first and second predicted blocks.

[0360] When performing bidirectional prediction for each partition of the current block, bit precision can be increased or decreased by considering the internal bit depth and the output bit depth, which are related to the reference. Figure 4 The description is the same.

[0361] Figure 7 A schematic configuration of an inter-frame predictor 221 performing the inter-frame prediction method according to this disclosure is shown.

[0362] Reference Figure 7 The inter-frame predictor 221 may include a block segmenter 700 and a predictive block deducer 710.

[0363] Block splitter 700 can divide the current block into multiple partitions. In this case, the current block can be divided into two or more partitions based on one or more dividing lines. As an example, the current block can be divided into two or more partitions based on geometric partitioning.

[0364] The prediction block derivator 710 may include at least one of a first prediction block derivator (not shown) that derives prediction blocks for each partition of the current block, or a second prediction block derivator (not shown) that derives the final prediction block of the current block based on the prediction blocks for each partition output from the first prediction block derivator.

[0365] The first prediction block deducer can derive the first prediction block (P0) of the first partition of the current block. In this case, the first prediction block of the first partition can be derived by one-way or two-way prediction. Additionally, the first prediction block deducer can derive the second prediction block (P1) of the second partition of the current block. In this case, the second prediction block of the second partition can be derived by one-way or two-way prediction.

[0366] The first prediction block derivator can be based on a reference. Figure 4 At least one of the described embodiments 1 to 17 is used to derive the first and second prediction blocks of the current block.

[0367] The same or different prediction modes can be applied to multiple partitions belonging to the current block. The method for deriving the L0 / L1 prediction blocks for each prediction mode of each partition is the same as described in derivation methods 1 to 6 above.

[0368] The BCW index and / or illumination compensation flags according to this disclosure can be signaled via a bitstream, or deduced from the encoding / decoding device. This is consistent with reference to... Figure 4 Since the descriptions are the same, repeated descriptions will be omitted here.

[0369] It can store at least one of motion information, BCW index, or lighting compensation flags applied to each partition of the current block in response to the segmentation shape of the current block, which is consistent with the reference. Figure 4 The description is the same.

[0370] In the above embodiments, the method is described based on a flowchart as a series of steps or blocks. However, the corresponding embodiments are not limited to this order of steps. Some steps may occur simultaneously with other steps or in a different order, as described above. In addition, those skilled in the art will understand that the steps shown in the flowchart are not exclusive. Other steps may be included, or one or more steps in the flowchart may be deleted, without affecting the scope of the embodiments of this disclosure.

[0371] The methods described above according to embodiments of the present disclosure can be implemented in software, and the encoding and / or decoding devices according to the present disclosure can be included in an apparatus for performing image processing, such as a TV, computer, smartphone, set-top box, display device, etc.

[0372] In this disclosure, when the implementation is implemented as software, the above-described method can be implemented as a module (process, function, etc.) performing the above-described functions. The module can be stored in memory and can be executed by a processor. The memory can be internal or external to the processor and can be connected to the processor by various well-known means. The processor may include an application-specific integrated circuit (ASIC), another chipset, logic circuitry, and / or data processing devices. The memory may include read-only memory (ROM), random access memory (RAM), flash memory, memory cards, storage media, and / or other storage devices. In other words, the implementations described herein can be executed by implementation on a processor, microprocessor, controller, or chip. For example, the functional units shown in the various figures can be executed by implementation on a computer, processor, microprocessor, controller, or chip. In this case, information for implementation (e.g., information about instructions) or algorithms can be stored in a digital storage medium.

[0373] Furthermore, decoding and encoding devices employing embodiments of this disclosure can be included in multimedia broadcasting transmitting and receiving devices, mobile communication terminals, home theater video devices, digital cinema video devices, surveillance cameras, video conferencing devices, real-time communication devices similar to video communication, mobile streaming devices, storage media, cameras, devices for providing video-on-demand (VOD) services, OTT (over-the-top) video devices, devices for providing internet streaming services, three-dimensional (3D) video devices, virtual reality (VR) devices, augmented reality (AR) devices, video telephony devices, transportation terminals (e.g., vehicle (including autonomous vehicle) terminals, aircraft terminals, ship terminals, etc.), and medical video devices, and can be used to process video signals or data signals. For example, OTT (over-the-top) video devices can include game consoles, Blu-ray players, internet-connected televisions, home theater systems, smartphones, tablet PCs, digital video recorders (DVRs), etc.

[0374] Furthermore, the processing methods applying the embodiments of this disclosure can be generated in the form of a computer-executable program and can be stored in a computer-readable recording medium. Multimedia data with data structures according to the embodiments of this disclosure can also be stored in a computer-readable recording medium. Computer-readable recording media include all types of storage devices and distributed storage devices that store computer-readable data. Computer-readable recording media can include, for example, Blu-ray discs (BD), Universal Serial Bus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, magnetic tape, floppy disks, and optical media storage devices. Additionally, computer-readable recording media include media implemented in the form of carrier waves (e.g., transmission via the Internet). Furthermore, bitstreams generated by encoding methods can be stored in computer-readable recording media or transmitted via wired / wireless communication networks.

[0375] Furthermore, the embodiments of this disclosure can be implemented by a computer program product using program code, and the program code can be executed on a computer using the embodiments of this disclosure. The program code can be stored on a computer-readable medium.

[0376] Figure 8 Examples of content streaming systems to which embodiments of this disclosure can be applied are shown.

[0377] Reference Figure 8 A content streaming system that applies embodiments of the present disclosure may generally include an encoding server, a streaming server, a network server, a media storage device, a user device, and a multimedia input device.

[0378] An encoding server generates a bitstream by compressing content input from multimedia input devices such as smartphones, cameras, and camcorders into digital data and then sends it to a streaming server. As another example, when multimedia input devices such as smartphones, cameras, and camcorders directly generate bitstreams, the encoding server can be omitted.

[0379] A bitstream can be generated by an encoding method or bitstream generation method that applies the embodiments of this disclosure, and the stream server can temporarily store the bitstream during the sending or receiving of the bitstream.

[0380] A streaming server sends multimedia data to a user device via a web server based on a user request, and the web server acts as a medium to inform the user what services are available. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server sends the multimedia data to the user. In this scenario, the content streaming system may include a separate control server, which controls the commands / responses between the various devices in the content streaming system.

[0381] A streaming server can receive content from media storage and / or encoding servers. For example, when receiving content from an encoding server, content can be received in real time. In this case, to provide a smooth streaming service, the streaming server can store the bitstream for a specific time period.

[0382] Examples of user devices may include mobile phones, smartphones, laptops, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigators, touchscreen PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, head-mounted displays (HMDs)), digital TVs, desktop computers, digital signage, etc.

[0383] In a content streaming system, each server can operate as a distributed server, and in this case, the data received from each server can be distributed and processed.

[0384] The claims set forth herein can be combined in various ways. For example, the technical features of the method claims of this disclosure can be combined and implemented as an apparatus, and the technical features of the apparatus claims of this disclosure can be combined and implemented as a method. Furthermore, the technical features of the method claims and the apparatus claims of this disclosure can be combined and implemented as an apparatus, and the technical features of the method claims and the apparatus claims of this disclosure can be combined and implemented as a method.

Claims

1. An image decoding method, comprising the following steps: The current block is divided into multiple partitions, wherein the multiple partitions include a first partition and a second partition; Derive the first prediction block of the first partition; Derive the second prediction block of the second partition; and The prediction block for the current block is derived based on the first prediction block and the second prediction block. Specifically, at least one of the first prediction block or the second prediction block is derived through bidirectional prediction.

2. The image decoding method according to claim 1, wherein, When the first partition performs the bidirectional prediction, L0 prediction blocks and L1 prediction blocks are derived for the first partition, and The first prediction block is derived based on the weighted sum of the L0 prediction block and the L1 prediction block.

3. The image decoding method according to claim 2, wherein, The weights for the weighted sum are determined based on any one of a plurality of weight candidates belonging to a predefined set of weights.

4. The image decoding method according to claim 1, wherein, The steps for deriving the first prediction block include the following: The predetermined search range is determined based on the motion vector of the first partition; Calculate the cost for each search location within the search range; and The L0 and L1 prediction blocks of the first partition are derived based on the search position with the minimum cost among the calculated costs.

5. The image decoding method according to claim 4, wherein, The cost is calculated as the absolute difference between the weighted L0 block at the search location and the weighted L1 block corresponding to the weighted L0 block, and the sum of SAD.

6. The image decoding method according to claim 1, wherein, The steps for deriving the first prediction block include the following: A first lighting compensation parameter is applied to the L0 prediction block of the first partition to generate a lighting compensated L0 prediction block, wherein the first lighting compensation parameter is derived based on the neighboring regions of the current block and the neighboring regions of the L0 prediction block. A second lighting compensation parameter is applied to the L1 prediction block of the first partition to generate a lighting compensated L1 prediction block, wherein the second lighting compensation parameter is derived based on the neighboring region of the current block and the neighboring region of the L1 prediction block; and The first prediction block is derived based on the weighted sum of the lighting compensation L0 prediction block and the lighting compensation L1 prediction block.

7. The image decoding method according to claim 6, wherein, The weights for the weighted sum are determined based on any one of a plurality of weight candidates belonging to a predefined set of weights.

8. The image decoding method according to claim 1, wherein, The value of the sample in the first prediction block is derived based on at least one of the values ​​of samples belonging to the L0 prediction block of the first partition, the values ​​of samples belonging to the L1 prediction block of the first partition, or a predetermined offset. The offset is derived based on at least one of the horizontal and vertical gradients at the location of the sample belonging to the L0 prediction block or the horizontal and vertical gradients at the location of the sample belonging to the L1 prediction block.

9. The image decoding method according to claim 1, wherein, Each of the first and second partitions is a block encoded in any of the following modes: merge mode, intra-block copy (IBC) mode, or template matching-based prediction (TMP) mode.

10. The image decoding method according to claim 1, wherein, For each of the first and second partitions, obtain the BCW index, and The BCW index specifies any one of a set of weight candidates belonging to a predefined weight set.

11. The image decoding method according to claim 10, wherein, The current block is divided into a first region, a second region, and a mixed region, and Either the BCW index of the first partition or the BCW index of the second partition is selectively stored in the mixed region.

12. The image decoding method according to claim 1, wherein, The first prediction block and the second prediction block have a bit precision equal to the internal bit depth, and The prediction block of the current block has a bit precision equal to the output bit depth.

13. An image encoding method, comprising the following steps: The current block is divided into multiple partitions, wherein the multiple partitions include a first partition and a second partition; Derive the first prediction block of the first partition; Derive the second prediction block of the second partition; and The prediction block for the current block is derived based on the first prediction block and the second prediction block. Specifically, at least one of the first prediction block or the second prediction block is derived through bidirectional prediction.

14. A computer-readable storage medium storing a bitstream generated by an image encoding method, the image encoding method comprising the following steps: The current block is divided into multiple partitions, wherein the multiple partitions include a first partition and a second partition; Derive the first prediction block of the first partition; Derive the second prediction block of the second partition; and The prediction block for the current block is derived based on the first prediction block and the second prediction block. Specifically, at least one of the first prediction block or the second prediction block is derived through bidirectional prediction.

15. A method for sending data, the method comprising the following steps: Obtain a bitstream for image information, wherein the bitstream is generated based on the following steps: dividing the current block into multiple partitions including a first partition and a second partition; deriving a first prediction block for the first partition; deriving a second prediction block for the second partition; and deriving a prediction block for the current block based on the first prediction block and the second prediction block; and Send the data including the bit stream. Specifically, at least one of the first prediction block or the second prediction block is derived through bidirectional prediction.