Method and device for encoding / decoding image, and recording medium storing bitstream

The method enhances video encoding and decoding by employing bidirectional prediction and weighted sums within block partitions, along with lighting compensation, to improve compression efficiency and accuracy for high-definition and ultra-high-definition images.

WO2024219878A1PCT designated stage expired Publication Date: 2024-10-24LG ELECTRONICS INC
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/KR2024/005302
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-22
Filing Date
2024-04-19
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

Current video encoding and decoding technologies face challenges in efficiently compressing high-resolution images, particularly in achieving optimal compression efficiency and prediction accuracy for high-definition and ultra-high-definition images, due to limitations in bidirectional prediction methods and bit precision adjustment.

Method used

The proposed method involves dividing blocks into partitions for bidirectional prediction, using weighted sums of L0 and L1 prediction blocks, and applying lighting compensation, with weights determined from pre-defined sets and motion vector refinement, to enhance prediction accuracy and bit precision adjustment.

Benefits of technology

This approach improves compression efficiency and prediction performance by allowing for accurate weighted prediction and lighting compensation, leading to better compression of high-resolution video data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024005302_24102024_PF_FP_ABST
    Figure KR2024005302_24102024_PF_FP_ABST
Patent Text Reader

Abstract

A method and a device 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 on the basis of 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 by using bidirectional prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Video encoding / decoding method and device, and recording medium storing bitstream

[0001] The present invention relates to a video encoding / decoding method and device, and a recording medium storing a bitstream.

[0002] Recently, the demand for high-resolution, high-quality images, such as HD (High Definition) images and UHD (Ultra High Definition) images, is increasing in various application fields, and accordingly, high-efficiency image compression technologies are being discussed.

[0003] There are various technologies for image compression, such as inter prediction technology that predicts pixel values ​​included in the current picture from pictures before or after the current picture, intra prediction technology that predicts pixel values ​​included in the current picture using pixel information within the current picture, and entropy encoding technology that assigns short codes to values ​​with high frequency of appearance and long codes to values ​​with low frequency of appearance, and these technologies can be used to effectively compress and transmit or store image data.

[0004] The present disclosure seeks to provide a bidirectional prediction method and device for each partition of a current block.

[0005] The present disclosure seeks to provide a method and device for adjusting bit precision by considering internal / output bit depth.

[0006] The present disclosure seeks to provide a method and device for effectively deriving information for weighted prediction and storing the same.

[0007] The video decoding method and device according to the present disclosure can divide a current block into a plurality of partitions including a first partition and a second partition, derive a first prediction block of the first partition, derive a second prediction block of the second partition, and derive 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 can be derived through bidirectional prediction.

[0008] In the video decoding method and device according to the present disclosure, when the first partition performs the bidirectional prediction, an L0 prediction block and an L1 prediction block are derived for the first partition, and the first prediction block can be derived based on a weighted sum of the L0 prediction block and the L1 prediction block.

[0009] In the image decoding method and device according to the present disclosure, the weight for the weighted sum can be determined based on any one of a plurality of weight candidates belonging to a pre-defined weight set.

[0010] In the video decoding method and device according to the present disclosure, the step of deriving the first prediction block may include the step of determining a predetermined search area based on a motion vector of the first partition, the step of calculating a cost for each search position within the search area, and the step of deriving an L0 prediction block and an L1 prediction block of the first partition based on a search position having a minimum cost among the calculated costs.

[0011] In the video decoding method and device according to the present disclosure, the cost can be calculated as the sum of absolute difference (SAD) between the weighted L0 block of the search position and the weighted L1 block corresponding to the weighted L0 block.

[0012] In the image decoding method and device according to the present disclosure, the step of deriving the first prediction block may include the step of applying a first lighting compensation parameter to an L0 prediction block of the first partition to generate an illumination-compensated L0 prediction block, the step of applying a second lighting compensation parameter to an L1 prediction block of the first partition to generate an illumination-compensated L1 prediction block, and the step of deriving the first prediction block based on a weighted sum of the illumination-compensated L0 prediction block and the illumination-compensated L1 prediction block.

[0013] In the image decoding method and device according to the present disclosure, the first illumination compensation parameter may be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 prediction block, and the second illumination compensation parameter may be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L1 prediction block.

[0014] In the image decoding method and device according to the present disclosure, the weight for the weighted sum can be determined based on any one of a plurality of weight candidates belonging to a pre-defined weight set.

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

[0016] In the image decoding method and device according to the present disclosure, the offset may be derived based on at least one of horizontal and vertical slopes at the position of a sample belonging to the L0 prediction block or horizontal and vertical slopes at the position of a sample belonging to the L1 prediction block.

[0017] In the video decoding method and device according to the present disclosure, each of the first partition and the second partition may be a block encoded in any one of merge mode, intra block copy (IBC) mode, or template matching-based prediction (TMP) mode.

[0018] In the video decoding method and device according to the present disclosure, a BCW index can be obtained for each of the first partition and the second partition. The BCW index can specify any one of a plurality of weight candidates belonging to a pre-defined weight set.

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

[0020] In the video decoding method and device according to the present disclosure, the first prediction block and the second prediction block may have a bit precision equal to an internal bit depth, and the prediction block of the current block may have a bit precision equal to an output bit depth.

[0021] In the video decoding method and device according to the present disclosure, the L0 prediction block or the L1 prediction block for the first partition and the second partition may have a bit precision equal to an internal bit depth, and the first prediction block of the first partition and the second prediction block of the second partition may have a bit precision equal to an output bit depth.

[0022] The video encoding method and device according to the present disclosure can divide a current block into a plurality of partitions including a first partition and a second partition, derive a first prediction block of the first partition, derive a second prediction block of the second partition, and derive 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 can be derived through bidirectional prediction.

[0023] A computer-readable digital storage medium is provided, which stores encoded video / image information that causes a decoding device according to the present disclosure to perform a video decoding method.

[0024] A computer-readable digital storage medium storing video / image information generated by a video encoding method according to the present disclosure is provided.

[0025] A method and device for transmitting video / image information generated by a video encoding method according to the present disclosure are provided.

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

[0027] According to the present disclosure, when performing bidirectional prediction for each partition of a current block, prediction performance can be improved by adjusting bit precision in consideration of internal / output bit depth.

[0028] According to the present disclosure, by applying weighted prediction, lighting compensation, motion vector correction, etc. when performing bidirectional prediction, the accuracy of bidirectional prediction can be increased and the compression efficiency can be improved.

[0029] According to the present disclosure, information for weighted prediction can be effectively derived and stored.

[0030] FIG. 1 illustrates a video / image coding system according to the present disclosure.

[0031] FIG. 2 is a schematic block diagram of an encoding device to which an embodiment of the present disclosure can be applied and in which encoding of a video / image signal is performed.

[0032] FIG. 3 is a schematic block diagram of a decoding device to which an embodiment of the present disclosure can be applied and in which decoding of a video / image signal is performed.

[0033] FIG. 4 illustrates an inter prediction method performed by a decoding device (300) as an embodiment according to the present disclosure.

[0034] FIG. 5 illustrates a schematic configuration of an inter prediction unit (332) that performs an inter prediction method according to the present disclosure.

[0035] FIG. 6 illustrates an inter prediction method performed by an encoding device (200) as an embodiment according to the present disclosure.

[0036] Fig. 7 illustrates a schematic configuration of an inter prediction unit (221) that performs an inter prediction method according to the present disclosure.

[0037] FIG. 8 illustrates an example of a content streaming system to which embodiments of the present disclosure can be applied.

[0038] The present disclosure may be modified in various ways and encompasses numerous embodiments. Specific embodiments are illustrated in the drawings and described in detail in the detailed description. However, this is not intended to limit the present disclosure to specific embodiments, but rather to encompass all modifications, equivalents, and alternatives falling within the spirit and technical scope of the present disclosure. Similar reference numerals have been used to designate similar components throughout the description of each drawing.

[0039] While terms such as "first" and "second" may be used to describe various components, these components should not be limited by these terms. These terms are used solely to distinguish one component from another. For example, without departing from the scope of the present disclosure, a first component could be referred to as a "second component," and similarly, a second component could also be referred to as a "first component." The term "and / or" includes a combination of multiple related items described herein or any of multiple related items described herein.

[0040] When a component is referred to as being "connected" or "connected" to another component, it should be understood that it may be directly connected or connected to that other component, but that there may be other components intervening. Conversely, when a component is referred to as being "directly connected" or "connected" to another component, it should be understood that there are no other components intervening.

[0041] The terminology used in this application is only used to describe specific embodiments and is not intended to limit the present disclosure. The singular expression includes the plural expression unless the context clearly indicates otherwise. In this application, it should be understood that the terms "comprise" or "have" indicate the presence of a feature, number, step, operation, component, part, or combination thereof described in the specification, but do not preclude the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.

[0042] The present disclosure relates to video / image coding. For example, the methods / embodiments disclosed in this specification can be applied to methods disclosed in the versatile video coding (VVC) standard. In addition, the methods / embodiments disclosed in this specification can be applied to methods disclosed in the essential video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the second generation of audio video coding standard (AVS2), or the next generation of video / image coding standards (e.g., H.267 or H.268).

[0043] This specification presents various embodiments of video / image coding, and unless otherwise stated, the embodiments may be performed in combination with each other.

[0044] In this specification, a video may refer to a set of images over time. A picture generally refers to a unit representing one image at a specific time point, and a slice / tile is a unit that constitutes part of a picture in coding. A slice / tile may include one or more coding tree units (CTUs). A picture may be composed of one or more slices / tiles. A tile is a rectangular area consisting of multiple CTUs within a specific tile column and a specific tile row of a picture. A tile column is a rectangular area of ​​CTUs that has a height equal to the height of the picture and a width specified by the syntax requirements of the picture parameter set. A tile row is a rectangular area of ​​CTUs that has a height specified by the picture parameter set and a width equal to the width of the picture. CTUs within a tile are arranged consecutively according to the CTU raster scan, while tiles within a picture may be arranged consecutively according to the tile raster scan. A slice may contain an integer number of complete tiles or an integer number of contiguous complete CTU rows within a picture, which may be exclusively contained within a single NAL unit. Meanwhile, a picture may be divided into two or more subpictures. A subpicture may be a rectangular region of one or more slices within a picture.

[0045] A pixel, or pel, can refer to the smallest unit that constitutes a picture (or image). Additionally, the term "sample" can be used as a counterpart to a pixel. A sample can generally 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.

[0046] A unit may represent a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. One unit may include one luma block and two chroma (e.g., cb, cr) blocks. In some cases, the term "unit" may be used interchangeably with terms such as "block" or "area." In general, an MxN block may include a set (or array) of samples (or sample array) or transform coefficients consisting of M columns and N rows.

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

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

[0049] In this specification, "at least one of A and B" may mean "only A", "only B" or "both A and B". Additionally, in this specification, the expressions "at least one of A or B" or "at least one of A and / or B" may be interpreted identically to "at least one of A and B".

[0050] Additionally, in this specification, “at least one of A, B and C” can mean “only A,” “only B,” “only C,” or “any combination of A, B and C.” Additionally, “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.”

[0051] Additionally, parentheses used herein may mean "for example." Specifically, when "prediction (intra-prediction)" is indicated, "intra-prediction" may be suggested as an example of "prediction." In other words, "prediction" in this specification is not limited to "intra-prediction," and "intra-prediction" may be suggested as an example of "prediction." Furthermore, even when "prediction (i.e., intra-prediction)" is indicated, "intra-prediction" may be suggested as an example of "prediction."

[0052] Technical features individually described in a single drawing in this specification may be implemented individually or simultaneously.

[0053] FIG. 1 illustrates a video / image coding system according to the present disclosure.

[0054] Referring to FIG. 1, a video / image coding system may include a first device (source device) and a second device (receiving device).

[0055] A source device can transmit encoded video / image information or data to a receiving device via a digital storage medium or a network in the form of a file or streaming. The source device may include a video source, an encoding device, and a transmitting device. The receiving device may include a receiving device, 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 be configured as a separate device or an external component.

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

[0057] An encoding device can encode input video / images. The encoding device can perform a series of procedures, such as prediction, transformation, and quantization, to improve compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

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

[0059] The decoding device can decode the video / image by performing a series of procedures such as inverse quantization, inverse transformation, and prediction corresponding to the operation of the encoding device.

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

[0061] FIG. 2 is a schematic block diagram of an encoding device to which an embodiment of the present disclosure can be applied and in which encoding of a video / image signal is performed.

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

[0063] The image segmentation unit (210) can segment an input image (or picture, frame) input to the encoding device (200) into one or more processing units. For example, the processing unit may be called a coding unit (CU). In this case, the coding unit may be recursively segmented from a coding tree unit (CTU) or a largest coding unit (LCU) according to a QTBTTT (Quad-tree binary-tree ternary-tree) structure.

[0064] For example, a single coding unit may be split into multiple coding units with deeper depths based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure and / or the ternary structure may be applied later. Alternatively, the binary tree structure may be applied before the quad-tree structure. The coding procedure according to the present specification may be performed based on the final coding unit that is no longer split. In this case, based on coding efficiency according to image characteristics, etc., the largest coding unit may be used directly as the final coding unit, or, if necessary, the coding unit may be recursively split into coding units of lower depths, and the coding unit with the optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later.

[0065] As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may each be split or partitioned from the final coding unit described above. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving a transform coefficient and / or a unit for deriving a residual signal from a transform coefficient.

[0066] The term "unit" may be used interchangeably with terms such as "block" or "area" depending on the case. In general, an MxN block can represent a set of samples or transform coefficients consisting of M columns and N rows. A sample can generally 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. A sample can be used as a term corresponding to a pixel or pel in a picture (or image).

[0067] The encoding device (200) can generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (prediction block, prediction sample array) output from an inter prediction unit (221) or an intra prediction unit (222) from an input video signal (original block, original sample array), and the generated residual signal is transmitted to a conversion unit (232). In this case, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input video signal (original block, original sample array) within the encoding device (200) may be called a subtraction unit (231).

[0068] The prediction unit (220) can perform a prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including prediction samples for the current block. The prediction unit (220) can determine whether intra prediction or inter prediction is applied on a current block or CU basis. The prediction unit (220) can generate various information related to prediction, such as prediction mode information, as described later in the description of each prediction mode, and transmit the information to the entropy encoding unit (240). The information related to prediction can be encoded by the entropy encoding unit (240) and output in the form of a bitstream.

[0069] The intra prediction unit (222) can predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block, or may be located a certain distance away from the current block, depending on the prediction mode. In intra prediction, the prediction modes may include one or more non-directional modes and multiple directional modes. The non-directional mode may include at least one of a DC mode or a planar mode. The directional mode may include 33 directional modes or 65 directional modes depending on the degree of detail in the prediction direction. However, this is only an example, and a greater or lesser number of directional modes may be used depending on the settings. The intra prediction unit (222) may also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

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

[0071] The prediction unit (220) can generate a prediction signal based on various prediction methods described below. For example, the prediction unit can apply intra prediction or inter prediction for prediction of a single block, and can also apply intra prediction and inter prediction simultaneously. This can be called combined inter and intra prediction (CIIP) mode. In addition, the prediction unit can be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode can be used for content image / video coding such as games, such as screen content coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC can utilize at least one of the inter prediction techniques described herein. Palette mode can be viewed as an example of intra coding or intra prediction. When the palette mode is applied, sample values ​​within a picture can be signaled based on information about the palette table and palette index. The prediction signal generated through the prediction unit (220) can be used to generate a restoration signal or a residual signal.

[0072] The transform unit (232) can apply a transform technique to the residual signal to generate transform coefficients. For example, the transform technique can include at least one of a Discrete Cosine Transform (DCT), a Discrete Sine Transform (DST), a Karhunen-Loeve Transform (KLT), a Graph-Based Transform (GBT), or a Conditionally Non-linear Transform (CNT). Here, GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. CNT refers to a transform obtained based on generating a prediction signal using all previously restored pixels. In addition, the transform process can be applied to a pixel block having a square size and the same size, or can be applied to a block of a non-square variable size.

[0073] The quantization unit (233) quantizes the transform coefficients and transmits them to the entropy encoding unit (240), and the entropy encoding unit (240) can encode the quantized signal (information about the quantized transform coefficients) and output it as a bitstream. The information about the quantized transform coefficients can be called residual information. The quantization unit (233) can rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on the coefficient scan order, and can also generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form.

[0074] The entropy encoding unit (240) can perform various encoding methods such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoding unit (240) can also encode information necessary for video / image restoration (e.g., values ​​of syntax elements, etc.) together or separately from quantized transform coefficients.

[0075] Encoded information (e.g., encoded video / image information) can be transmitted or stored in the form of a bitstream in units of NAL (network abstraction layer) units. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. In the present specification, information and / or syntax elements transmitted / signaled from an encoding device to a decoding device may be included in the video / image information. The video / image information may be encoded through the above-described encoding procedure and included in the bitstream. The bitstream may be transmitted via a network or stored in a digital storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media, such as a USB, SD, CD, DVD, Blu-ray, HDD, or SSD. The signal output from the entropy encoding unit (240) may be configured as an internal / external element of the encoding device (200) by a transmitting unit (not shown) and / or a storing unit (not shown), or the transmitting unit may be included in the entropy encoding unit (240).

[0076] The quantized transform coefficients output from the quantization unit (233) can be used to generate a prediction signal. For example, by applying inverse quantization and inverse transformation to the quantized transform coefficients through the inverse quantization unit (234) and the inverse transform unit (235), a residual signal (residual block or residual samples) can be restored. The addition unit (250) can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit (221) or the intra prediction unit (222). When there is no residual for the block to be processed, such as when skip mode is applied, the predicted block can be used as a reconstructed block. The addition unit (250) may be called a restoration unit or a reconstructed block generation unit. The generated restoration signal can be used for intra prediction of the next processing target block within the current picture, and can also be used for inter prediction of the next picture after filtering as described below. Meanwhile, LMCS (luma mapping with chroma scaling) may be applied during the picture encoding and / or restoration process.

[0077] The filtering unit (260) can improve subjective / objective picture quality by applying filtering to the restoration signal. For example, the filtering unit (260) can apply various filtering methods to the restoration picture to generate a modified restoration picture, and store the modified restoration picture in the memory (270), specifically, in the DPB of the memory (270). The various filtering methods can include deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. The filtering unit (260) can generate various information regarding filtering and transmit it to the entropy encoding unit (240). The information regarding filtering can be encoded by the entropy encoding unit (240) and output in the form of a bitstream.

[0078] The modified restored picture transmitted to the memory (270) can be used as a reference picture in the inter prediction unit (221). Through this, when inter prediction is applied, the encoding device can avoid prediction mismatch between the encoding device (200) and the decoding device, and can also improve encoding efficiency.

[0079] The DPB of the memory (270) can store the modified restored picture to be used as a reference picture in the inter prediction unit (221). The memory (270) can store motion information of a block from which motion information is derived (or encoded) within the current picture and / or motion information of blocks within a picture that has already been restored. The stored motion information can be transferred to the inter prediction unit (221) to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory (270) can store restored samples of restored blocks within the current picture and transfer them to the intra prediction unit (222).

[0080] FIG. 3 is a schematic block diagram of a decoding device to which an embodiment of the present disclosure can be applied and in which decoding of a video / image signal is performed.

[0081] Referring to FIG. 3, the decoding device (300) may be configured to include an entropy decoder (310), a residual processor (320), a predictor (330), an adder (340), a filter (350), and a memory (360). The predictor (330) may include an inter-prediction unit (332) and an intra-prediction unit (331). The residual processor (320) may include a dequantizer (321) and an inverse transformer (321).

[0082] The entropy decoding unit (310), residual processing unit (320), prediction unit (330), addition unit (340), and filtering unit (350) described above may be configured by a single hardware component (e.g., a decoding device chipset or processor) depending on the embodiment. In addition, the memory (360) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory (360) as an internal / external component.

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

[0084] The decoding device (300) can receive a signal output from the encoding device of FIG. 2 in the form of a bitstream, and the received signal can be decoded through the entropy decoding unit (310). For example, the entropy decoding unit (310) can parse the bitstream to derive information (e.g., video / image information) necessary for image restoration (or picture restoration). The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. The decoding device can decode the picture further based on the information on the parameter set and / or the general constraint information. The signaling / received information and / or syntax elements described later in this specification can be decoded through the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit (310) can decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values ​​of syntax elements required for image restoration and the quantized values ​​of transform coefficients for residuals. More specifically, the CABAC entropy decoding method receives a bin corresponding to each syntax element in the bitstream, determines a context model using information of the syntax element to be decoded and decoding information of the surrounding and decoding target blocks or information of symbols / bins decoded in the previous step, and predicts the occurrence probability of the bin according to the determined context model to perform arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element.At this time, the CABAC entropy decoding method can update the context model using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. Information regarding prediction among the information decoded by the entropy decoding unit (310) is provided to the prediction unit (inter prediction unit (332) and intra prediction unit (331)), and residual values ​​on which entropy decoding is performed by the entropy decoding unit (310), i.e., quantized transform coefficients and related parameter information, can be input to the residual processing unit (320). The residual processing unit (320) can derive a residual signal (residual block, residual samples, residual sample array). In addition, information regarding filtering among the information decoded by the entropy decoding unit (310) can be provided to the filtering unit (350). Meanwhile, a receiving unit (not shown) that receives a signal output from an encoding device may be further configured as an internal / external element of a decoding device (300), or the receiving unit may be a component of an entropy decoding unit (310).

[0085] Meanwhile, a decoding device according to the present specification may be called a video / video / picture decoding device, and the decoding device may be divided into an information decoding device (video / video / picture information decoding device) and a sample decoding device (video / video / picture sample decoding device). The information decoding device may include the entropy decoding unit (310), and the sample decoding device may include at least one of the inverse quantization unit (321), the inverse transformation unit (322), the addition unit (340), the filtering unit (350), the memory (360), the inter prediction unit (332), and the intra prediction unit (331).

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

[0087] In the inverse transform unit (322), the transform coefficients are inversely transformed to obtain a residual signal (residual block, residual sample array).

[0088] The prediction unit (320) can perform a prediction on the current block and generate a predicted block including prediction samples for the current block. The prediction unit (320) can determine whether intra-prediction or inter-prediction is applied to the current block based on the information regarding the prediction output from the entropy decoding unit (310), and can determine a specific intra / inter-prediction mode.

[0089] The prediction unit (320) can generate a prediction signal based on various prediction methods described below. For example, the prediction unit (320) can apply intra prediction or inter prediction for prediction of a single block, and can also apply intra prediction and inter prediction simultaneously. This can be called combined inter and intra prediction (CIIP) mode. In addition, the prediction unit can be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode can be used for content image / video coding such as games, such as screen content coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC can utilize at least one of the inter prediction techniques described herein. Palette mode can be viewed as an example of intra coding or intra prediction. When palette mode is applied, information about the palette table and palette index may be included and signaled in the video / image information.

[0090] The intra prediction unit (331) can predict the current block by referring to samples within the current picture. The referenced samples may be located in the neighborhood of the current block, or may be located a certain distance away from the current block, depending on the prediction mode. In intra prediction, the prediction modes may include one or more non-directional modes and multiple directional modes. The intra prediction unit (331) may also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0091] The inter prediction unit (332) can derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information can be predicted in units of blocks, subblocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include inter prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks can include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. For example, the inter prediction unit (332) can construct a motion information candidate list based on the neighboring blocks, and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Inter prediction can be performed based on various prediction modes, and information about the prediction can include information indicating an inter prediction mode for the current block.

[0092] The addition unit (340) can generate a restoration signal (restored picture, restoration block, restoration sample array) by adding the acquired residual signal to the prediction signal (prediction block, prediction sample array) output from the prediction unit (including the inter-prediction unit (332) and / or intra-prediction unit (331)). When there is no residual for the block to be processed, such as when skip mode is applied, the prediction block can be used as the restoration block.

[0093] The addition unit (340) may be referred to as a restoration unit or restoration block generation unit. The generated restoration signal may be used for intra prediction of the next processing target block within the current picture, may be output after filtering as described below, or may be used for inter prediction of the next picture. Meanwhile, LMCS (luma mapping with chroma scaling) may be applied during the picture decoding process.

[0094] The filtering unit (350) can improve subjective / objective image quality by applying filtering to the restored signal. For example, the filtering unit (350) can apply various filtering methods to the restored picture to generate a modified restored picture, and transmit the modified restored picture to the memory (360), specifically, to the DPB of the memory (360). The various filtering methods can include deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.

[0095] The (corrected) reconstructed picture stored in the DPB of the memory (360) can be used as a reference picture in the inter prediction unit (332). The memory (360) can store motion information of a block from which motion information is derived (or decoded) in the current picture and / or motion information of blocks in a picture that has already been reconstructed. The stored motion information can be transferred to the inter prediction unit (332) to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory (360) can store reconstructed samples of reconstructed blocks in the current picture and transfer them to the intra prediction unit (331).

[0096] In this specification, the embodiments described in the filtering unit (260), the inter prediction unit (221), and the intra prediction unit (222) of the encoding device (200) can be applied to the filtering unit (350), the inter prediction unit (332), and the intra prediction unit (331) of the decoding device (300) in the same or corresponding manner, respectively.

[0097] FIG. 4 illustrates an inter prediction method performed by a decoding device (300) as an embodiment according to the present disclosure.

[0098] Referring to FIG. 4, the current block can be divided into multiple partitions (S400).

[0099] The current block may be divided into two or more partitions based on one or more dividing lines. For example, the current block may be divided into two or more partitions based on geometric partitioning. The shape of one of the two or more partitions may be triangular. Alternatively, the shape of the two or more partitions may be rectangular.

[0100] Referring to Fig. 4, a prediction block can be derived for each partition of the current block (S410).

[0101] For convenience of explanation, this disclosure assumes that the current block is divided into two partitions. Hereinafter, one of the two partitions will be referred to as the first partition, and the other of the two partitions will be referred to as the second partition.

[0102] A first prediction block (P0) can be derived for the first partition of the current block, and a second prediction block (P1) can be derived for the second partition of the current block.

[0103] The first prediction block of the first partition may be derived by unidirectional prediction. For example, the first prediction block may be a prediction block derived by inter prediction in the L0 direction (hereinafter, referred to as an L0 prediction block). The L0 prediction block may be defined as a prediction block derived by performing inter prediction based on an L0 reference picture. Alternatively, the first prediction block may be a prediction block derived by inter prediction in the L1 direction (hereinafter, referred to as an L1 prediction block). The L1 prediction block may be defined as a prediction block derived by performing inter prediction based on an L1 reference picture.

[0104] The first prediction block of the first partition may also be derived by bidirectional prediction. For example, an L0 prediction block and an L1 prediction block may be derived for the first partition, and the first prediction block may be derived based on the L0 prediction block and the L1 prediction block.

[0105] Similarly, the second prediction block of the second partition can be derived by unidirectional prediction. For example, the second prediction block can be an L0 prediction block. Alternatively, the second prediction block can be an L1 prediction block. Alternatively, the second prediction block of the second partition can be derived by bidirectional prediction. For example, an L0 prediction block and an L1 prediction block can be derived for the second partition, and the second prediction block can be derived based on the L0 prediction block and the L1 prediction block.

[0106] Below, we will examine in detail the method for deriving the first prediction block and the second prediction block of the current block.

[0107] Example 1

[0108] If the first partition performs bidirectional prediction (i.e., if the first partition has motion information for bidirectional prediction), an L0 prediction block and an L1 prediction block can be derived for the first partition. The first prediction block of the first partition can be derived based on a weighted sum of the L0 prediction block and the L1 prediction block. For example, the first prediction block can be derived as shown in the following mathematical expression 1.

[0109] [Mathematical Formula 1]

[0110] P0= (w 00 * P 00 + w 01 * P 01 + round) >> shift

[0111] In mathematical expression 1, P0 represents the first prediction block. P 00 represents the L0 prediction block of the first partition, and P 01 represents the L1 prediction block of the first partition. w 00 Wow w 01 represents the weights for bidirectional prediction of the first partition. round represents the rounding offset for rounding, and shift represents the parameter for the weighted average (i.e., the scale down parameter). Here, w 00 Wow w 01 Silver (2 shift-1 ) can be set to the same value. In this case, P0 is P 00 Wow P 01 can be derived as the average value.

[0112] If the second partition performs bidirectional prediction (i.e., if the second partition has motion information for bidirectional prediction), an L0 prediction block and an L1 prediction block can be derived for the second partition. The second prediction block of the second partition can be derived based on a weighted sum of the L0 prediction block and the L1 prediction block. For example, the second prediction block can be derived as shown in the following mathematical expression 2.

[0113] [Equation 2]

[0114] P1= (w 10 * P 10 + w 11 * P 11 + round) >> shift

[0115] In mathematical expression 2, P1 represents the second prediction block. P 10 represents the L0 prediction block of the second partition, and P 11 represents the L1 prediction block of the second partition. w 10 Wow w 11 represents the weights for bidirectional prediction of the second partition. round represents the rounding offset for rounding, and shift represents the parameter for the weighted average (i.e., the scale down parameter). Here, w 10 Wow w 11 Silver (2 shift-1 ) can be set to the same value. In this case, P1 is P 10 Wow P 11 can be derived as the average value.

[0116] Example 2

[0117] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. The first prediction block of the first partition can be derived by applying BCW (bi-prediction with CU-level weight) to the L0 prediction block and the L1 prediction block of the first partition. That is, the first prediction block can be derived based on a weighted average of the L0 prediction block and the L1 prediction block of the first partition.

[0118] The weights for the above weighted average may be determined based on a weight set that is identically predefined for the encoding device and the decoding device. The weight set may include multiple weight candidates. The number of weight candidates belonging to the weight set may be an integer of 2, 3, 4, 5, or more. At least one of the multiple weight candidates may be a negative number. For example, the weight set may be defined as {-2, 3, 4, 5, 10}.

[0119] The weight for the above weighted average can be determined based on any one of the multiple weight candidates belonging to the weight set. For this purpose, an index (hereinafter referred to as a BCW index) that specifies any one of the multiple weight candidates can be used. For example, the weight for the weighted average can be a weight (w) applied to the L0 prediction block of the first partition. 00 ) and the weights (w) applied to the L1 prediction block of the first partition 01 ) may be included. w 00 can be derived from among multiple weight candidates by selecting a weight candidate specified by the BCW index. w 01 is (1-w 00 ) can be derived as the value of w. Or, w 01 can be set as a weight candidate specified by the BCW index among multiple weight candidates. w 00 is (1-w 01 ) can be derived from the value of .

[0120] On the other hand, if the first partition performs unidirectional prediction, the aforementioned 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 may be derived as either an L0 or L1 prediction block.

[0121] Similarly, if the second partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the second partition. The second prediction block of the second partition can be derived by applying BCW to the L0 prediction block and the L1 prediction block of the second partition. In other words, the second prediction block can be derived based on a weighted average of the L0 prediction block and the L1 prediction block of the second partition.

[0122] The weights for the above weighted average can be derived in the same manner as the first partition. Specifically, the weights for the weighted average can be determined based on any one of a plurality of weight candidates belonging to a weight set. For this purpose, a BCW index indicating any one of the plurality of weight candidates can be used. For example, the weights for the weighted average can be weights (w) applied to the L0 prediction block of the second partition. 10 ) and the weights (w) applied to the L1 prediction blocks of the second partition 11 ) may be included. w 10 can be derived from among multiple weight candidates by selecting a weight candidate specified by the BCW index. w 11 is (1-w 10 ) can be derived as the value of w. Or, w 11 can be derived from among multiple weight candidates by selecting a weight candidate specified by the BCW index. w 10 is (1-w 11 ) can be derived from the value of .

[0123] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0124] If the BCW index of the first partition and the BCW index of the second partition are different, the weight used to derive the first prediction block of the first partition and the weight used to derive the second prediction block of the second partition may be different. On the other hand, if the BCW index of the first partition and the BCW index of the second partition are the same, the weight used to derive the first prediction block of the first partition and the weight used to derive the second prediction block of the second partition may be the same.

[0125] Example 3

[0126] If the first partition performs bidirectional prediction, the first prediction block of the first partition can be derived based on decoder side motion vector refinement (DMVR).

[0127] Specifically, a predetermined search area may be determined based on the motion vector of the first partition. The search area may be limited to ±N sample sizes in the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N may be an integer of 1, 2, or a greater number. For example, when N is 2, the search area may be defined as a 5x5 area with the position indicated by the motion vector of the first partition as the center position. In this case, the number of search positions within the search area may be 25.

[0128] A cost can be calculated for each search location within the above search area. Here, the cost can be calculated as the sum of absolute difference (SAD) between the L0 block and the L1 block of the corresponding search location.

[0129] Among the calculated costs, a search position with a minimum cost can be determined. The motion vector of the first partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected 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 the L1 prediction block derived in the above-described manner.

[0130] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

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

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

[0133] A cost can be calculated for each search location within the above search area. Here, the cost can be calculated as the sum of absolute difference (SAD) between the L0 block and the L1 block of the corresponding search location.

[0134] Among the calculated costs, a search position with the minimum cost can be determined. The motion vector of the second partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected motion vector can be set as the L0 prediction block and L1 prediction block of the second partition. The second prediction block of the second partition can be derived based on the weighted sum of the L0 prediction block and the L1 prediction block derived in the above-described manner.

[0135] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0136] The aforementioned DMVR can divide the current block into sub-blocks of a predetermined size and perform motion vector correction in units of sub-blocks. Here, the size of the sub-block can be 16x16. However, it is not limited thereto, and the size of the sub-block can be 8x8 or 4x4. Alternatively, the shape of the sub-block is not limited to a square shape, and can be a non-square shape such as 16x8 or 8x4. Alternatively, the aforementioned DMVR can perform motion vector correction in units of 1x1 samples.

[0137] Example 4

[0138] If the first partition performs bidirectional prediction, the first prediction block of the first partition can be derived based on decoder side motion vector refinement (DMVR).

[0139] Specifically, a predetermined search area may be determined based on the motion vector of the first partition. The search area may be limited to ±N sample sizes in the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N may be an integer of 1, 2, or a greater number. For example, when N is 2, the search area may be defined as a 5x5 area with the position indicated by the motion vector of the first partition as the center position. In this case, the number of search positions within the search area may be 25.

[0140] A cost may be calculated for each search position within the search area. A predetermined weight for BCW (bi-prediction with CU-level weight) may be applied to each L0 block and L1 block of the search position. In this case, the cost may be calculated as the sum of absolute difference (SAD) between the weighted L0 block and L1 block. Here, the weight may be determined based on a weight set that is identically predefined for the encoding device and the decoding device. The weight set may include a plurality of weight candidates. The number of weight candidates belonging to the weight set may be an integer of 2, 3, 4, 5, or more. At least one of the plurality of weight candidates may be a negative number. For example, the weight set may be defined as {-2, 3, 4, 5, 10}. The weight may be determined based on any one of the plurality of weight candidates belonging to the weight set. For this purpose, a BCW index that specifies any one of the plurality of weight candidates may be used. For example, the above weights are weights (w) applied to the L0 block. 00 ) and the weights (w) applied to the L1 block 01 ) may be included. w 00 can be derived from among multiple weight candidates by selecting a weight candidate specified by the BCW index. w01 is (1-w 00 ) can be derived as the value of w. Or, w 01 can be set as a weight candidate specified by the BCW index among multiple weight candidates. w 00 is (1-w 01 ) can be derived from the value of .

[0141] Among the calculated costs, a search position with the minimum cost can be determined. The motion vector of the first partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected motion vector can be set as the L0 prediction block and L1 prediction block of the first partition.

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

[0143] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

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

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

[0146] A cost may be calculated for each search position within the search area. A predetermined weight for BCW may be applied to each of the L0 block and L1 block of the search position. In this case, the cost may be calculated as the sum of absolute difference (SAD) between the weighted L0 block and L1 block. Here, the weight may be determined based on a weight set that is identically pre-defined for the encoding device and the decoding device. The weight set may include a plurality of weight candidates. The number of weight candidates belonging to the weight set may be an integer of 2, 3, 4, 5, or more. At least one of the plurality of weight candidates may be a negative number. For example, the weight set may be defined as {-2, 3, 4, 5, 10}. The weight may be determined based on any one of the plurality of weight candidates belonging to the weight set. For this purpose, a BCW index that specifies any one of the plurality of weight candidates may be used. For example, the above weights are weights (w) applied to the L0 block. 10 ) and the weights (w) applied to the L1 block 11 ) may be included. w 10 can be derived from among multiple weight candidates by selecting a weight candidate specified by the BCW index. w 11 is (1-w 10 ) can be derived as the value of w. Or, w 11 can be set as a weight candidate specified by the BCW index among multiple weight candidates. w 10 is (1-w 11 ) can be derived from the value of .

[0147] Among the calculated costs, a search position with the minimum cost can be determined. The motion vector of the second partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected motion vector can be set as the L0 prediction block and L1 prediction block of the second partition.

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

[0149] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0150] The aforementioned DMVR can divide the current block into sub-blocks of a predetermined size and perform motion vector correction in units of sub-blocks. Here, the size of the sub-block can be 16x16. However, it is not limited thereto, and the size of the sub-block can be 8x8 or 4x4. Alternatively, the shape of the sub-block is not limited to a square shape, and can be a non-square shape such as 16x8 or 8x4. Alternatively, the aforementioned DMVR can perform motion vector correction in units of 1x1 samples.

[0151] Example 5

[0152] Lighting compensation according to the present disclosure may refer to a method of generating a final prediction block of a current block by applying a predetermined lighting compensation parameter to a reference block of a current block. Specifically, the lighting compensation parameter may be derived based on a peripheral area of ​​a current block and a peripheral area of ​​a reference block. That is, the lighting compensation parameter of a linear model may be derived based on a luminance difference (or change amount) between the peripheral area of ​​a current block and a peripheral area of ​​a reference block. The peripheral area may be a pre-restored area and may include at least one of an upper peripheral area, a left peripheral area, an upper-left peripheral area, a lower-left peripheral area, or an upper-right peripheral area. The reference block may be specified based on a motion vector of the current block. The final prediction block of the current block may be generated by applying the lighting compensation parameter of the linear model to the reference block.

[0153] The relationship for compensating for the luminance difference between the current block and the reference block can be defined as in the following mathematical expression 3.

[0154] [Equation 3]

[0155] Cur N (x,y) = α* Ref N (x,y) + β

[0156] In Equation 3, α and β represent lighting compensation parameters. Ref. N (x,y) can mean the surrounding area of ​​the reference block, and Cur N (x,y) can mean the surrounding area of ​​the current block. The lighting compensation parameter is Ref N (x,y) and Cur N It may include weights (α) and offsets (β) that minimize the luminance difference between (x, y). The values ​​of α and β may be applied to the reference block of the current block to generate a lighting-compensated prediction block for the current block.

[0157] The illumination compensation parameter according to the present disclosure can be derived from at least one unit among a picture, a tile, a slice, a coding tree unit (CTU), or a coding unit (CU). The illumination compensation can be adaptively applied based on an illumination compensation flag. The illumination compensation flag can indicate whether illumination compensation is applied to a reference block of a current block. Alternatively, the illumination compensation flag can indicate whether a prediction block of the current block is corrected through illumination compensation. The illumination compensation flag can be signaled through a bitstream or can be derived from an encoding device and a decoding device.

[0158] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. Illumination compensation can be applied to each of the L0 prediction block and the L1 prediction block of the first partition. The first prediction block of the first partition can be derived based on a weighted sum of the illumination-compensated L0 and L1 prediction blocks.

[0159] Specifically, lighting compensation parameters for an L0 prediction block can be derived based on the surrounding area of ​​a current block and the surrounding area of ​​an L0 prediction block for a first partition. The derived lighting compensation parameters can be applied to the L0 prediction block to generate a lighting-compensated L0 prediction block. Similarly, lighting compensation parameters for an L1 prediction block can be derived based on the surrounding area of ​​a current block and the surrounding area of ​​an L1 prediction block for a 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 sum of the lighting-compensated L0 and L1 prediction blocks.

[0160] On the other hand, if the first partition performs unidirectional prediction, an L0 or L1 prediction block can be derived for the first partition. Lighting compensation can be applied to the L0 or L1 prediction block of the first partition. That is, lighting compensation parameters can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 or L1 prediction block, and the lighting compensation parameters can be applied to the L0 or L1 prediction block. The lighting-compensated L0 or L1 prediction block can be set as the first prediction block of the first partition.

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

[0162] Specifically, lighting compensation parameters for an L0 prediction block can be derived based on the surrounding area of ​​a current block and the surrounding area of ​​an L0 prediction block for a second partition. The derived lighting compensation parameters can be applied to the L0 prediction block to generate a lighting-compensated L0 prediction block. Similarly, lighting compensation parameters for an L1 prediction block can be derived based on the surrounding area of ​​a current block and the surrounding area of ​​an L1 prediction block for a second partition. The derived lighting compensation parameters can be applied to the L1 prediction block to generate a lighting-compensated L1 prediction block. A second prediction block for a second partition can be derived based on a weighted sum of the lighting-compensated L0 and L1 prediction blocks.

[0163] On the other hand, if the second partition performs unidirectional prediction, an L0 or L1 prediction block can be derived for the second partition. Lighting compensation can be applied to the L0 or L1 prediction block of the second partition. That is, lighting compensation parameters can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 or L1 prediction block, and the lighting compensation parameters can be applied to the L0 or L1 prediction block. The lighting-compensated L0 or L1 prediction block can be set as the second prediction block of the second partition.

[0164] Example 6

[0165] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. Illumination compensation can be applied to each of the L0 prediction block and the L1 prediction block of the first partition. The first prediction block of the first partition can be derived by applying BCW (bi-prediction with CU-level weight) to the illumination-compensated L0 and L1 prediction blocks. Illumination compensation according to the present disclosure is as described in Example 5, and a duplicate description will be omitted here.

[0166] Specifically, lighting compensation parameters for an L0 prediction block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 prediction block for 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, lighting compensation parameters for an L1 prediction block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L1 prediction block for 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 and L1 prediction blocks. The weights for the weighted average are as described in Embodiment 2, and a redundant description thereof will be omitted here.

[0167] On the other hand, if the first partition performs unidirectional prediction, an L0 or L1 prediction block can be derived for the first partition. Lighting compensation can be applied to the L0 or L1 prediction block of the first partition. That is, lighting compensation parameters can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 or L1 prediction block, and the lighting compensation parameters can be applied to the L0 or L1 prediction block. The lighting-compensated L0 or L1 prediction block can be set as the first prediction block of the first partition. Since the first partition performs unidirectional prediction, the BCW described above may not be applied when deriving the first prediction block of the first partition.

[0168] When the second partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the second partition. Illumination compensation can be applied to each of the L0 prediction block and the L1 prediction block of the second partition. The second prediction block of the second partition can be derived by applying BCW to the illumination-compensated L0 and L1 prediction blocks.

[0169] Specifically, lighting compensation parameters for an L0 prediction block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​an L0 prediction block for the second partition. The derived lighting compensation parameters can be applied to the L0 prediction block to generate a lighting-compensated L0 prediction block. Similarly, lighting compensation parameters for an L1 prediction block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​an L1 prediction block for the second partition. The derived lighting compensation parameters can be applied to the L1 prediction block to generate a lighting-compensated L1 prediction block. A second prediction block for the second partition can be derived based on a weighted average of the lighting-compensated L0 and L1 prediction blocks. The weights for the weighted average are as described in Embodiment 2, and a redundant description thereof will be omitted here.

[0170] On the other hand, if the second partition performs unidirectional prediction, an L0 or L1 prediction block can be derived for the second partition. Lighting compensation can be applied to the L0 or L1 prediction block of the second partition. That is, lighting compensation parameters can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 or L1 prediction block, and the lighting compensation parameters can be applied to the L0 or L1 prediction block. The lighting-compensated L0 or L1 prediction block can be set as the second prediction block of the second partition. Since the second partition performs unidirectional prediction, the BCW described above may not be applied when deriving the second prediction block of the second partition.

[0171] Example 7

[0172] If the first partition performs bidirectional prediction, the first prediction block of the first partition can be derived based on decoder side motion vector refinement (DMVR).

[0173] Specifically, a predetermined search area may be determined based on the motion vector of the first partition. The search area may be limited to ±N sample sizes in the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N may be an integer of 1, 2, or a greater number. For example, when N is 2, the search area may be defined as a 5x5 area with the position indicated by the motion vector of the first partition as the center position. In this case, the number of search positions within the search area may be 25.

[0174] A cost can be calculated for each search location within the above search area. Here, the cost can be calculated as the sum of absolute difference (SAD) between the L0 block and the L1 block of the corresponding search location.

[0175] Among the calculated costs, a search position with the minimum cost can be determined. The motion vector of the first partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected motion vector can be set as the L0 prediction block and L1 prediction block of the first partition, respectively.

[0176] Lighting compensation can be applied to the L0 prediction block and the L1 prediction block derived in the above-described manner. Lighting compensation parameters for the L0 prediction block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the derived L0 prediction block. The derived lighting compensation parameters can be applied to the L0 prediction block to generate a lighting-compensated L0 prediction block. Similarly, lighting compensation parameters for the L1 prediction block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the derived L1 prediction block. The derived lighting compensation parameters can be applied to the L1 prediction block to generate a lighting-compensated L1 prediction block. A first prediction block of a first partition can be derived based on a weighted sum of the lighting-compensated L0 and L1 prediction blocks.

[0177] On the other hand, if 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 may be derived as either an L0 or L1 prediction block. Alternatively, the first prediction block of the first partition may be derived as either an illumination-compensated L0 or L1 prediction block.

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

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

[0180] A cost can be calculated for each search location within the above search area. Here, the cost can be calculated as the sum of absolute difference (SAD) between the L0 block and the L1 block of the corresponding search location.

[0181] Among the calculated costs, a search position with the minimum cost can be determined. The motion vector of the second partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected motion vector can be set as the L0 prediction block and L1 prediction block of the second partition, respectively.

[0182] Lighting compensation can be applied to the L0 prediction block and the L1 prediction block derived in the above-described manner. Lighting compensation parameters for the L0 prediction block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the derived L0 prediction block. The derived lighting compensation parameters can be applied to the L0 prediction block to generate a lighting-compensated L0 prediction block. Similarly, lighting compensation parameters for the L1 prediction block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the derived L1 prediction block. The derived lighting compensation parameters can be applied to the L1 prediction block to generate a lighting-compensated L1 prediction block. A first prediction block of a first partition can be derived based on a weighted sum of the lighting-compensated L0 and L1 prediction blocks.

[0183] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, the second prediction block of the second partition may be derived from either an illumination-compensated L0 or L1 prediction block.

[0184] The aforementioned DMVR can divide the current block into sub-blocks of a predetermined size and perform motion vector correction in units of sub-blocks. Here, the size of the sub-block can be 16x16. However, it is not limited thereto, and the size of the sub-block can be 8x8 or 4x4. Alternatively, the shape of the sub-block is not limited to a square shape, and can be a non-square shape such as 16x8 or 8x4. Alternatively, the aforementioned DMVR can perform motion vector correction in units of 1x1 samples.

[0185] Example 8

[0186] If the first partition performs bidirectional prediction, the first prediction block of the first partition can be derived based on decoder side motion vector refinement (DMVR).

[0187] Specifically, a predetermined search area may be determined based on the motion vector of the first partition. The search area may be limited to ±N sample sizes in the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N may be an integer of 1, 2, or a greater number. For example, when N is 2, the search area may be defined as a 5x5 area with the position indicated by the motion vector of the first partition as the center position. In this case, the number of search positions within the search area may be 25.

[0188] A cost can be calculated for each search location within the above search area. Illumination compensation can be applied to each of the L0 and L1 blocks of the search location. In this case, the cost can be calculated as the sum of absolute differences (SAD) between the illumination-compensated L0 and L1 blocks.

[0189] In other words, lighting compensation parameters for the L0 block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 block at the corresponding search position. The derived lighting compensation parameters can be applied to the L0 block to generate a lighting-compensated L0 block. Similarly, lighting compensation parameters for the L1 block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L1 block at the corresponding search position. The derived lighting compensation parameters can be applied to the L1 block to generate a lighting-compensated L1 block. The SAD between the lighting-compensated L0 and L1 blocks can be calculated as a cost.

[0190] Among the calculated costs, a search position with the minimum cost can be determined. The motion vector of the first partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected motion vector can be set as the L0 prediction block and L1 prediction block of the first partition, respectively.

[0191] Lighting compensation can be applied to the L0 prediction block and L1 prediction block derived in the above-described manner. A lighting-compensated L0 prediction block can be generated by applying a pre-derived lighting compensation parameter to the L0 prediction block for the L0 block of the search position pointed to by the compensated motion vector. In addition, a lighting-compensated L1 prediction block can be generated by applying a pre-derived lighting compensation parameter to the L1 prediction block for the L1 block of the search position pointed to by the compensated motion vector. A first prediction block of a first partition can be derived based on a weighted sum of the lighting-compensated L0 and L1 prediction blocks.

[0192] On the other hand, if 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 may be derived as either an L0 or L1 prediction block. Alternatively, the first prediction block of the first partition may be derived as either an illumination-compensated L0 or L1 prediction block.

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

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

[0195] A cost can be calculated for each search location within the above search area. Lighting compensation can be applied to each of the L0 and L1 blocks of the search location. In this case, the cost can be calculated as the SAD between the L0 and L1 blocks subject to lighting compensation.

[0196] In other words, lighting compensation parameters for the L0 block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 block at the corresponding search position. The derived lighting compensation parameters can be applied to the L0 block to generate a lighting-compensated L0 block. Similarly, lighting compensation parameters for the L1 block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L1 block at the corresponding search position. The derived lighting compensation parameters can be applied to the L1 block to generate a lighting-compensated L1 block. The SAD between the lighting-compensated L0 and L1 blocks can be calculated as a cost.

[0197] Among the calculated costs, a search position with the minimum cost can be determined. The motion vector of the second partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected motion vector can be set as the L0 prediction block and L1 prediction block of the second partition, respectively.

[0198] Lighting compensation can be applied to the L0 prediction block and L1 prediction block derived in the above-described manner. A lighting-compensated L0 prediction block can be generated by applying a pre-derived lighting compensation parameter to the L0 prediction block for the L0 block of the search position pointed to by the compensated motion vector. In addition, a lighting-compensated L1 prediction block can be generated by applying a pre-derived lighting compensation parameter to the L1 prediction block for the L1 block of the search position pointed to by the compensated motion vector. A second prediction block of a second partition can be derived based on a weighted sum of the lighting-compensated L0 and L1 prediction blocks.

[0199] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, the second prediction block of the second partition may be derived from either an illumination-compensated L0 or L1 prediction block.

[0200] The aforementioned DMVR can divide the current block into sub-blocks of a predetermined size and perform motion vector correction in units of sub-blocks. Here, the size of the sub-block can be 16x16. However, it is not limited thereto, and the size of the sub-block can be 8x8 or 4x4. Alternatively, the shape of the sub-block is not limited to a square shape, and can be a non-square shape such as 16x8 or 8x4. Alternatively, the aforementioned DMVR can perform motion vector correction in units of 1x1 samples.

[0201] Example 9

[0202] If the first partition performs bidirectional prediction, the first prediction block of the first partition can be derived based on decoder side motion vector refinement (DMVR).

[0203] Specifically, a predetermined search area may be determined based on the motion vector of the first partition. The search area may be limited to ±N sample sizes in the horizontal and vertical directions, centered on the position indicated by the motion vector of the first partition. N may be an integer of 1, 2, or a greater number. For example, when N is 2, the search area may be defined as a 5x5 area with the position indicated by the motion vector of the first partition as the center position. In this case, the number of search positions within the search area may be 25.

[0204] A cost can be calculated for each search position within the above search area. Illumination compensation can be applied to each of the L0 and L1 blocks of the search position. A predetermined weight for BCW (bi-prediction with CU-level weight) can be applied to each of the illumination-compensated L0 and L1 blocks. In this case, the cost can be calculated as the sum of absolute difference (SAD) between the weighted L0 and L1 blocks. The weight for BCW is the same as that discussed in Example 2, and a duplicate description will be omitted here.

[0205] In other words, lighting compensation parameters for the L0 block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 block at the corresponding search position. The derived lighting compensation parameters can be applied to the L0 block to generate a lighting-compensated L0 block. Similarly, lighting compensation parameters for the L1 block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L1 block at the corresponding search position. The derived lighting compensation parameters can be applied to the L1 block to generate a lighting-compensated L1 block. Weights derived based on the BCW index can be applied to the lighting-compensated L0 block and L1 block, respectively, to generate weighted L0 blocks and L1 blocks. The SAD between the weighted L0 block and L1 block can be calculated as a cost.

[0206] Among the calculated costs, a search position with the minimum cost can be determined. The motion vector of the first partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected motion vector can be set as the L0 prediction block and L1 prediction block of the first partition, respectively.

[0207] Lighting compensation can be applied to the L0 prediction block and L1 prediction block derived in the above-described manner. A lighting-compensated L0 prediction block can be generated by applying a pre-derived lighting compensation parameter to the L0 prediction block for the L0 block of the search position pointed to by the compensated motion vector. In addition, a lighting-compensated L1 prediction block can be generated by applying a pre-derived lighting compensation parameter to the L1 prediction block for the L1 block of the search position pointed to by the compensated motion vector. A first prediction block can be derived based on a weighted average of the lighting-compensated L0 and L1 prediction blocks. That is, a weight (w) derived based on the BCW index is applied to the lighting-compensated L0 and L1 prediction blocks. 00 ) and weights (w 01 ) can be applied respectively to derive the first prediction block of the first partition.

[0208] On the other hand, if 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 may be derived as either an L0 or L1 prediction block. Alternatively, the first prediction block of the first partition may be derived as either an illumination-compensated L0 or L1 prediction block.

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

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

[0211] A cost can be calculated for each search position within the above search area. Lighting compensation can be applied to each of the L0 and L1 blocks of the search position. A predetermined weight for BCW can be applied to each of the light-compensated L0 and L1 blocks. In this case, the cost can be calculated as the SAD between the weighted L0 and L1 blocks. The weight for BCW is the same as that discussed in Example 2, and a duplicate description will be omitted here.

[0212] In other words, lighting compensation parameters for the L0 block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L0 block at the corresponding search position. The derived lighting compensation parameters can be applied to the L0 block to generate a lighting-compensated L0 block. Similarly, lighting compensation parameters for the L1 block can be derived based on the surrounding area of ​​the current block and the surrounding area of ​​the L1 block at the corresponding search position. The derived lighting compensation parameters can be applied to the L1 block to generate a lighting-compensated L1 block. Weights derived based on the BCW index can be applied to the lighting-compensated L0 block and L1 block, respectively, to generate weighted L0 blocks and L1 blocks. The SAD between the weighted L0 block and L1 block can be calculated as a cost.

[0213] Among the calculated costs, a search position with the minimum cost can be determined. The motion vector of the second partition can be corrected to a motion vector pointing to the search position with the minimum cost. The L0 block and L1 block of the search position pointed to by the corrected motion vector can be set as the L0 prediction block and L1 prediction block of the second partition, respectively.

[0214] Lighting compensation can be applied to the L0 prediction block and L1 prediction block derived in the above-described manner. A lighting-compensated L0 prediction block can be generated by applying a pre-derived lighting compensation parameter to the L0 prediction block for the L0 block of the search position pointed to by the compensated motion vector. In addition, a lighting-compensated L1 prediction block can be generated by applying a pre-derived lighting compensation parameter to the L1 prediction block for the L1 block of the search position pointed to by the compensated motion vector. A second prediction block can be derived based on a weighted average of the lighting-compensated L0 and L1 prediction blocks. That is, a weight (w) derived based on the BCW index is applied to the lighting-compensated L0 and L1 prediction blocks. 10 ) and weights (w 11 ) can be applied respectively to derive the second prediction block of the second partition.

[0215] On the other hand, if 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 may be derived as either an L0 or L1 prediction block. Alternatively, the second prediction block of the second partition may be derived as either an illumination-compensated L0 or L1 prediction block.

[0216] The aforementioned DMVR can divide the current block into sub-blocks of a predetermined size and perform motion vector correction in units of sub-blocks. Here, the size of the sub-block can be 16x16. However, it is not limited thereto, and the size of the sub-block can be 8x8 or 4x4. Alternatively, the shape of the sub-block is not limited to a square shape, and can be a non-square shape such as 16x8 or 8x4. Alternatively, the aforementioned DMVR can perform motion vector correction in units of 1x1 samples.

[0217] Example 10

[0218] The BDOF (Bi-directional optical flow) according to the present disclosure can find an optimal motion vector for each sub-block based on a bidirectional motion vector obtained in units of coding blocks, and derive a final prediction block by estimating the amount of change in sample values ​​at each sample location within the coding block based on the optimal motion vector. The sub-block is a 4x4 block, but is not limited thereto.

[0219] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. BDOF can be applied when deriving the first prediction block of the first partition based on the L0 prediction block and the L1 prediction block of the first partition.

[0220] When the above BDOF is applied, the sample value of the first prediction block (pred0 BDOF ) is a sample value (pred00) of the L0 prediction block of the first partition, a sample value (pred01) of the L1 prediction block of the first partition, and a predetermined offset (Offset0) for the BDOF of the first partition. BDOF ) can be derived based on. Here, the predetermined offset can be derived based on at least one of the horizontal / vertical slope at the sample position of pred00 or the horizontal / vertical slope at the sample position of pred01. For example, the predetermined offset can be derived as in the following mathematical expression 4.

[0221] [Equation 4]

[0222] Offset0 BDOF (i,j)=v0 x *(gradH00(i,j)-gradH01(i,j))+v0 y *(gradV00(i,j)-gradV01(i,j))

[0223] In equation 4, offset0 BDOF (i,j) represents the offset corresponding to the sample position of (i,j). v0 xWow v0 y may mean a corrected motion vector that minimizes the distortion between the L0 prediction block and the L1 prediction block of the first partition. v0 x Wow v0 y can be derived in units of sub-blocks within the current block. gradH00(i,j) represents a horizontal gradient at a sample position of (i,j) within an L0 prediction block of the first partition. gradH01(i,j) represents a horizontal gradient at a sample position of (i,j) within an L1 prediction block of the first partition. gradV00(i,j) represents a vertical gradient at a sample position of (i,j) within an L0 prediction block of the first partition. gradV01(i,j) represents a vertical gradient at a sample position of (i,j) within an L1 prediction block of the first partition. The horizontal gradient may be a change amount of two or more samples horizontally adjacent to the sample position of (i,j). The vertical gradient may be a change amount of two or more samples vertically adjacent to the sample position of (i,j).

[0224] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0225] When the second partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the second partition. BDOF can be applied when deriving the second prediction block of the second partition based on the L0 prediction block and the L1 prediction block of the second partition.

[0226] When the above BDOF is applied, the sample value of the second prediction block (pred1 BDOF) is a sample value (pred10) of the L0 prediction block of the second partition, a sample value (pred11) of the L1 prediction block of the second partition, and a predetermined offset (Offset1) for the BDOF of the second partition. BDOF ) can be derived based on. Here, the predetermined offset can be derived based on at least one of the horizontal / vertical slope at the sample position of pred10 or the horizontal / vertical slope at the sample position of pred11. For example, the predetermined offset can be derived as in the following mathematical expression 5.

[0227] [Equation 5]

[0228] Offset1 BDOF (i,j)=v1 x *(gradH10(i,j)-gradH11(i,j))+v1 y *(gradV10(i,j)-gradV11(i,j))

[0229] In Equation 5, Offset1 BDOF (i,j) represents the offset corresponding to the sample position of (i,j). v1 x Wow v1 y may mean a corrected motion vector that minimizes the distortion between the L0 prediction block and the L1 prediction block of the second partition. v1 x Wow v1 ycan be derived in units of sub-blocks within the current block. gradH10(i,j) represents a horizontal gradient at a sample position of (i,j) within an L0 prediction block of the second partition. gradH11(i,j) represents a horizontal gradient at a sample position of (i,j) within an L1 prediction block of the second partition. gradV10(i,j) represents a vertical gradient at a sample position of (i,j) within an L0 prediction block of the second partition. gradV11(i,j) represents a vertical gradient at a sample position of (i,j) within an L1 prediction block of the second partition. The horizontal gradient may be a change amount of two or more samples horizontally adjacent to the sample position of (i,j). The vertical gradient may be a change amount of two or more samples vertically adjacent to the sample position of (i,j).

[0230] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0231] Example 11

[0232] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. The first prediction block of the first partition can be derived by applying BCW (bi-prediction with CU-level weight) and BDOF (bi-directional optical flow) to the L0 prediction block and the L1 prediction block of the first partition.

[0233] That is, the sample value of the first prediction block can be derived based on at least one of a value derived through a weighted average of the sample value of the L0 prediction block of the first partition and the sample value of the L1 prediction block, or an offset for the BDOF of the first partition. The weight for the weighted average can be derived based on the BCW index of the first partition, as discussed in Example 2. In addition, the offset for the BDOF of the first partition is as discussed in Example 10.

[0234] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0235] When the second partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the second partition. The second prediction block of the second partition can be derived by applying the BCW and BDOF to the L0 prediction block and the L1 prediction block of the second partition.

[0236] That is, the sample value of the second prediction block can be derived based on at least one of a value derived through a weighted average of the sample value of the L0 prediction block of the second partition and the sample value of the L1 prediction block, or an offset for the BDOF of the second partition. The weight for the weighted average can be derived based on the BCW index of the second partition, as discussed in Example 2. In addition, the offset for the BDOF of the second partition is as discussed in Example 10.

[0237] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0238] Example 12

[0239] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. At this time, the L0 prediction block and the L1 prediction block of the first partition may be derived based on decoder-side motion vector refinement (DMVR). The method for deriving the L0 / L1 prediction block based on the DMVR is the same as that discussed in Example 3, and a duplicate description will be omitted here.

[0240] The first prediction block of the first partition can be derived by applying BDOF (Bi-directional optical flow) to the L0 prediction block and L1 prediction block of the first partition derived based on the above DMVR. That is, the L0 and L1 prediction blocks of the first partition can be derived based on the DMVR. The sample value of the first prediction block of the first partition can be derived based on at least one of a weighted sum of the sample values ​​of the derived L0 prediction block and the sample values ​​of the L1 prediction block or an offset for the BDOF of the first partition. The offset for the BDOF of the first partition is as described in Example 10.

[0241] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0242] When the second partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the second partition. In this case, the L0 prediction block and the L1 prediction block of the second partition can be derived based on DMVR. The method for deriving the L0 / L1 prediction block based on the DMVR is the same as that discussed in Example 3, and a duplicate description will be omitted here.

[0243] The second prediction block of the second partition can be derived by applying BDOF to the L0 prediction block and L1 prediction block of the second partition derived based on the above DMVR. That is, the L0 and L1 prediction blocks of the first partition can be derived based on the DMVR. The sample value of the second prediction block of the second partition can be derived based on at least one of a weighted sum of the sample values ​​of the derived L0 prediction block and the sample values ​​of the L1 prediction block or an offset for the BDOF of the second partition. The offset for the BDOF of the second partition is as described in Example 10.

[0244] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0245] Example 13

[0246] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. At this time, the L0 prediction block and the L1 prediction block of the first partition can be derived based on decoder-side motion vector refinement (DMVR). Here, the method for deriving the L0 / L1 prediction block based on DMVR is the same as that discussed in Example 4, and a duplicate description will be omitted here.

[0247] The first prediction block of the first partition can be derived by applying BDOF (Bi-directional optical flow) to the L0 prediction block and L1 prediction block derived in the above-described manner. That is, the sample value of the first prediction block can be derived based on at least one of a value derived through a weighted average of the sample value of the L0 prediction block and the sample value of the L1 prediction block of the first partition or an offset for the BDOF of the first partition. The weight for the weighted average can be derived based on the BCW index of the first partition, as discussed in Example 2. In addition, the offset for the BDOF of the first partition is as discussed in Example 10.

[0248] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0249] When the second partition performs bidirectional prediction, L0 prediction blocks and L1 prediction blocks can be derived for the second partition. At this time, the L0 prediction blocks and L1 prediction blocks of the second partition may be derived based on decoder-side motion vector refinement (DMVR). Here, the method for deriving L0 / L1 prediction blocks based on DMVR is the same as that discussed in Example 4, and a duplicate description will be omitted here.

[0250] A second prediction block of a second partition can be derived by applying BDOF to the L0 prediction block and L1 prediction block derived in the above-described manner. That is, the sample value of the second prediction block can be derived based on at least one of a value derived through a weighted average of the sample values ​​of the L0 prediction block and the sample values ​​of the L1 prediction block of the second partition or an offset for BDOF of the second partition. The weight for the weighted average can be derived based on the BCW index of the second partition, as discussed in Example 2. In addition, the offset for BDOF of the second partition is as discussed in Example 10.

[0251] On the other hand, if 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 may be derived as either an L0 or L1 prediction block.

[0252] Example 14

[0253] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. Illumination compensation can be applied to each of the L0 prediction block and the L1 prediction block of the first partition. The method for generating the illumination-compensated L0 / L1 prediction block is the same as that described in Example 5, and a redundant description will be omitted here.

[0254] A first prediction block of the first partition can be derived by applying BDOF (Bi-directional optical flow) to the illumination-compensated L0 prediction block and L1 prediction block of the first partition. That is, the sample value of the first prediction block of the first partition can be derived based on at least one of a weighted sum of the sample value of the illumination-compensated L0 prediction block and the sample value of the illumination-compensated L1 prediction block or an offset for BDOF of the first partition. The offset for BDOF of the first partition is as described in Example 10.

[0255] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, illumination compensation may be applied to the L0 or L1 prediction block of the first partition, and the illumination-compensated L0 or L1 prediction block may be set as the first prediction block of the first partition.

[0256] When the second partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the second partition. Illumination compensation can be applied to each of the L0 prediction blocks and the L1 prediction blocks of the second partition. The method for generating the illumination-compensated L0 / L1 prediction blocks is the same as that described in Example 5, and a redundant description will be omitted here.

[0257] A second prediction block of the second partition can be derived by applying BDOF to the illumination-compensated L0 prediction block and L1 prediction block of the second partition. That is, the sample value of the second prediction block of the second partition can be derived based on at least one of a weighted sum of the sample values ​​of the illumination-compensated L0 prediction block and the sample values ​​of the illumination-compensated L1 prediction block or an offset for BDOF of the second partition. The offset for BDOF of the second partition is as described in Example 10.

[0258] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, illumination compensation may be applied to the L0 or L1 prediction block of the second partition, and the illumination-compensated L0 or L1 prediction block may be set as the second prediction block of the second partition.

[0259] Example 15

[0260] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. Illumination compensation can be applied to each of the L0 prediction block and the L1 prediction block of the first partition. The method for generating the illumination-compensated L0 / L1 prediction block is the same as that described in Example 5, and a redundant description will be omitted here.

[0261] The first prediction block of the first partition can be derived by applying BCW (bi-prediction with CU-level weight) and BDOF (bi-directional optical flow) to the light-compensated L0 prediction block and L1 prediction block of the first partition.

[0262] That is, the sample value of the first prediction block can be derived based on at least one of a value derived through a weighted average of the sample value of the illumination-compensated L0 prediction block of the first partition and the sample value of the illumination-compensated L1 prediction block, or an offset for BDOF of the first partition. The weight for the weighted average can be derived based on the BCW index of the first partition, as discussed in Example 2. In addition, the offset for BDOF of the first partition is as discussed in Example 10.

[0263] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, illumination compensation may be applied to the L0 or L1 prediction block of the first partition, and the illumination-compensated L0 or L1 prediction block may be set as the first prediction block of the first partition.

[0264] When the second partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the second partition. Illumination compensation can be applied to each of the L0 prediction blocks and the L1 prediction blocks of the second partition. The method for generating the illumination-compensated L0 / L1 prediction blocks is the same as that described in Example 5, and a redundant description will be omitted here.

[0265] A second prediction block of the second partition can be derived by applying BCW and BDOF to the light-compensated L0 prediction block and L1 prediction block of the second partition.

[0266] That is, the sample value of the second prediction block can be derived based on at least one of a value derived through a weighted average of the sample value of the illumination-compensated L0 prediction block of the second partition and the sample value of the illumination-compensated L1 prediction block, or an offset for BDOF of the second partition. The weight for the weighted average can be derived based on the BCW index of the second partition, as discussed in Example 2. In addition, the offset for BDOF of the second partition is as discussed in Example 10.

[0267] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, illumination compensation may be applied to the L0 or L1 prediction block of the second partition, and the illumination-compensated L0 or L1 prediction block may be set as the second prediction block of the second partition.

[0268] Example 16

[0269] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. At this time, the L0 prediction block and the L1 prediction block of the first partition can be derived based on decoder-side motion vector refinement (DMVR). Here, the method for deriving the L0 / L1 prediction block based on DMVR is the same as that discussed in Example 8, and a duplicate description will be omitted here.

[0270] Lighting compensation can be applied to the L0 and L1 prediction blocks derived in the above manner to generate lighting-compensated L0 and L1 prediction blocks, as discussed in Example 8.

[0271] A first prediction block of the first partition can be derived by applying BDOF (Bi-directional optical flow) to the illumination-compensated L0 prediction block and L1 prediction block of the first partition.

[0272] That is, the sample values ​​of the first prediction block can be derived based on at least one of a weighted sum of the sample values ​​of the illumination-compensated L0 prediction block of the first partition and the sample values ​​of the illumination-compensated L1 prediction block, or an offset for the BDOF of the first partition. The offset for the BDOF of the first partition is as described in Example 10.

[0273] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, illumination compensation may be applied to the L0 or L1 prediction block of the first partition, and the illumination-compensated L0 or L1 prediction block may be set as the first prediction block of the first partition.

[0274] When the second partition performs bidirectional prediction, L0 prediction blocks and L1 prediction blocks can be derived for the second partition. At this time, the L0 prediction blocks and L1 prediction blocks of the first partition may be derived based on decoder-side motion vector refinement (DMVR). Here, the method for deriving L0 / L1 prediction blocks based on DMVR is the same as that discussed in Example 8, and a duplicate description will be omitted here.

[0275] Lighting compensation can be applied to the L0 and L1 prediction blocks derived in the above manner to generate lighting-compensated L0 and L1 prediction blocks, as discussed in Example 8.

[0276] A second prediction block of the second partition can be derived by applying BDOF to the light-compensated L0 prediction block and L1 prediction block of the second partition.

[0277] That is, the sample values ​​of the second prediction block can be derived based on at least one of a weighted sum of the sample values ​​of the illumination-compensated L0 prediction block of the second partition and the sample values ​​of the illumination-compensated L1 prediction block, or an offset for the BDOF of the second partition. The offset for the BDOF of the second partition is as described in Example 10.

[0278] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, illumination compensation may be applied to the L0 or L1 prediction block of the second partition, and the illumination-compensated L0 or L1 prediction block may be set as the second prediction block of the second partition.

[0279] Example 17

[0280] When the first partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the first partition. At this time, the L0 prediction block and the L1 prediction block of the first partition can be derived based on decoder-side motion vector refinement (DMVR). Here, the method for deriving the L0 / L1 prediction block based on DMVR is the same as that discussed in Example 9, and a duplicate description will be omitted here.

[0281] Lighting compensation can be applied to the L0 and L1 prediction blocks derived in the above manner to generate lighting-compensated L0 and L1 prediction blocks, as discussed in Example 9.

[0282] A first prediction block of the first partition can be derived by applying BDOF (Bi-directional optical flow) to the illumination-compensated L0 prediction block and L1 prediction block of the first partition.

[0283] That is, the sample value of the first prediction block can be derived based on at least one of a value derived through a weighted average of the sample value of the illumination-compensated L0 prediction block of the first partition and the sample value of the illumination-compensated L1 prediction block, or an offset for BDOF of the first partition. The weight for the weighted average can be derived based on the BCW index of the first partition, as discussed in Example 2. In addition, the offset for BDOF of the first partition is as discussed in Example 10.

[0284] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, illumination compensation may be applied to the L0 or L1 prediction block of the first partition, and the illumination-compensated L0 or L1 prediction block may be set as the first prediction block of the first partition.

[0285] When the second partition performs bidirectional prediction, an L0 prediction block and an L1 prediction block can be derived for the second partition. At this time, the L0 prediction block and the L1 prediction block of the second partition can be derived based on DMVR. Here, the method for deriving the L0 / L1 prediction block based on DMVR is the same as that discussed in Example 9, and a duplicate description will be omitted here.

[0286] Lighting compensation can be applied to the L0 and L1 prediction blocks derived in the above manner to generate lighting-compensated L0 and L1 prediction blocks, as discussed in Example 9.

[0287] A second prediction block of the second partition can be derived by applying BDOF to the light-compensated L0 prediction block and L1 prediction block of the second partition.

[0288] That is, the sample value of the second prediction block can be derived based on at least one of a value derived through a weighted average of the sample value of the illumination-compensated L0 prediction block of the second partition and the sample value of the illumination-compensated L1 prediction block, or an offset for BDOF of the second partition. The weight for the weighted average can be derived based on the BCW index of the second partition, as discussed in Example 2. In addition, the offset for BDOF of the second partition is as discussed in Example 10.

[0289] On the other hand, if 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 may be derived from either an L0 or L1 prediction block. Alternatively, illumination compensation may be applied to the L0 or L1 prediction block of the second partition, and the illumination-compensated L0 or L1 prediction block may be set as the second prediction block of the second partition.

[0290] The same or different prediction modes can be applied to multiple partitions belonging to the current block. Each partition can use one of the following prediction modes: merge mode, AMVP mode, intra-block copy (IBC) mode, template matching-based prediction (TMP) mode, or intra-prediction mode. Even when multiple partitions use different prediction modes, unidirectional or bidirectional prediction corresponding to the prediction mode can be performed for each partition. Below, we will examine the method for deriving L0 / L1 prediction blocks for each prediction mode of each partition.

[0291] Induction method 1

[0292] The first and second partitions of the current block may be blocks encoded in merge mode. In this case, the L0 and / or L1 prediction blocks for the first and second partitions in the aforementioned embodiments 1 to 17 may be derived based on merge mode.

[0293] Specifically, a merge candidate list of a current block may be constructed. The merge candidate list may include one or more merge candidates. A merge candidate for a first partition may be selected from the merge candidate list. A motion vector of the first partition may be derived based on a motion vector of the selected merge candidate. If the selected merge candidate performs unidirectional prediction, the motion vector of the first partition may be either an L0 motion vector or an L1 motion vector. If the selected merge candidate performs bidirectional prediction, the motion vector of the first partition may include an L0 motion vector and an L1 motion vector. L0 and L1 prediction blocks of the first partition may be derived based on the L0 and L1 motion vectors of the first partition, respectively.

[0294] Additionally, a merge candidate for the second partition may be selected from the merge candidate list of the current block. A motion vector of the second partition may be derived based on a motion vector of the selected merge candidate. If the selected merge candidate performs unidirectional prediction, the motion vector of the second partition may be either an L0 motion vector or an L1 motion vector. If the selected merge candidate performs bidirectional prediction, the motion vector of the second partition may include an L0 motion vector and an L1 motion vector. L0 and L1 prediction blocks of the second partition may be derived based on the L0 and L1 motion vectors of the second partition, respectively.

[0295] Induction method 2

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

[0297] Specifically, a merge candidate list for the first partition of the current block can be constructed, and L0 and / or L1 prediction blocks for the first partition can be derived based on the merge candidate list. This is as discussed in Example 1, and a redundant description will be omitted here.

[0298] An IBC candidate list for a second partition of a current block may be constructed. The IBC candidate list may include one or more IBC candidates. An IBC candidate for the second partition may be selected from the IBC candidate list. A motion vector of the second partition may be derived based on a motion vector of the selected IBC candidate. If the selected IBC candidate performs unidirectional prediction, the motion vector of the second partition may be either an L0 motion vector or an L1 motion vector. If the selected IBC candidate performs bidirectional prediction, the motion vector of the second partition may include an L0 motion vector and an L1 motion vector. An intra block copy may be performed based on the L0 and L1 motion vectors of the second partition to derive L0 and L1 prediction blocks of the second partition, respectively.

[0299] Induction method 3

[0300] The first and second partitions of the current block may be blocks encoded in the IBC mode. In this case, the L0 and / or L1 prediction blocks for the first and second partitions in the aforementioned embodiments 1 to 17 may be derived based on the IBC mode.

[0301] Specifically, an IBC candidate list of a current block can be constructed. The IBC candidate list can include one or more IBC candidates. An IBC candidate for a first partition can be selected from the IBC candidate list. A motion vector of the first partition can be derived based on a motion vector of the selected IBC candidate. If 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. If the selected IBC candidate performs bidirectional prediction, the motion vector of the first partition can include an L0 motion vector and an L1 motion vector. An intra block copy can be performed based on the L0 and L1 motion vectors of the first partition to derive the L0 and L1 prediction blocks of the first partition, respectively.

[0302] Additionally, an IBC candidate for the second partition may be selected from the IBC candidate list of the current block, and an L0 and / or L1 prediction block of the second partition may be derived based on the selected IBC candidate. This is as discussed in Example 2, and a duplicate description will be omitted here.

[0303] Induction method 4

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

[0305] Specifically, a merge candidate list for the first partition of the current block can be constructed, and L0 and / or L1 prediction blocks for the first partition can be derived based on the merge candidate list. This is as discussed in Example 1, and a redundant description will be omitted here.

[0306] In addition, a TMP candidate list for a second partition of the current block may be constructed. The TMP candidate list may include one or more TMP candidates. A TMP candidate for the second partition may be selected from the TMP candidate list. For example, for each of one or more TMP candidates in the TMP candidate list, a difference between a template region of the current block and a template region of a reference block may be calculated. Here, the reference block may be specified based on the corresponding TMP candidate. Among the one or more TMP candidates in the TMP candidate list, a TMP candidate with a smallest difference value may be selected as the TMP candidate for the second partition.

[0307] Based on the selected TMP candidate, a motion vector of the second partition can be derived. A predetermined search area for template matching is determined based on the motion vector of the second partition, and template matching can be performed within the search area to derive an L0 and / or L1 prediction block of the second partition. For example, a search area within an L0 reference picture can be determined based on the L0 motion vector of the second partition, and the difference between the template area of ​​the current block and the template area of ​​the reference block at the corresponding search area can be calculated for each search position within the search area. Among the search positions within the search area, a search position with the smallest difference value can be determined. The reference block of the determined search position can be derived as an L0 prediction block of the second partition. Similarly, a search area within an L1 reference picture can be determined based on the L1 motion vector of the second partition, and the difference between the template area of ​​the current block and the template area of ​​the reference block at the corresponding search position can be calculated for each search position within the search area. Among the search positions within the search area, a search position with the smallest difference value can be determined. The reference block of the above-determined search position can be derived as the L1 prediction block of the second partition.

[0308] Induction Method 5

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

[0310] Specifically, an IBC candidate list for the first partition of the current block can be constructed, and L0 and / or L1 prediction blocks for the first partition can be derived based on the IBC candidate list. This is as discussed in Example 3, and a redundant description will be omitted here.

[0311] Additionally, a TMP candidate list for the second partition of the current block can be constructed, and L0 and / or L1 prediction blocks for the second partition can be derived based on the TMP candidate list. This is as discussed in Example 4, and a duplicate description will be omitted here.

[0312] Induction method 6

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

[0314] Specifically, a TMP candidate list of the current block can be constructed. 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. For example, for each of one or more TMP candidates in the TMP candidate list, a difference between a template region of the current block and a template region of a 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 in the TMP candidate list, a TMP candidate with a smallest difference value can be selected as the TMP candidate for the first partition.

[0315] Based on the selected TMP candidate, a motion vector of the first partition can be derived. A predetermined search area for template matching is determined based on the motion vector of the first partition, and template matching can be performed within the search area to derive an L0 and / or L1 prediction block of the first partition. For example, a search area within an L0 reference picture can be determined based on the L0 motion vector of the first partition, and the difference between the template area of ​​the current block and the template area of ​​the reference block at the corresponding search area can be calculated for each search position within the search area. Among the search positions within the search area, a search position with the smallest difference value can be determined. The reference block of the determined search position can be derived as the L0 prediction block of the first partition. Similarly, a search area within an L1 reference picture can be determined based on the L1 motion vector of the first partition, and the difference between the template area of ​​the current block and the template area of ​​the reference block at the corresponding search position can be calculated for each search position within the search area. Among the search positions within the search area, a search position with the smallest difference value can be determined. The reference block of the above-determined search position can be derived as the L1 prediction block of the first partition.

[0316] Additionally, L0 and / or L1 prediction blocks for the second partition can be derived based on the TMP candidate list of the current block. This is as discussed in Example 4, and a redundant description will be omitted here.

[0317] The BCW index in the above-described embodiment may be signaled via the bitstream or may be derived from the encoding device / decoding device.

[0318] For example, if 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 partition and the second partition of the current block, respectively.

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

[0320] The lighting compensation flag in the above-described embodiment may be signaled via the bitstream or may be derived from the encoding device / decoding device.

[0321] For example, if the current block is encoded in merge mode, the lighting compensation flag may be derived from the merge candidate list of the current block. The lighting compensation flag may be derived for the first partition and the second partition of the current block, respectively.

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

[0323] The BCW index applied to each partition of the current block can be stored corresponding to the partitioning form of the current block.

[0324] When a geometric partitioning mode is applied to the current block, motion information for the first partition and motion information for the second partition may exist simultaneously within the current block, which is a single coding unit. Accordingly, the motion information for the first partition and the motion information for the second partition may be stored in accordance with the partitioning form of the current block. At this time, the BCW index may be stored together during the process of storing the motion information in accordance with the partitioning form of the current block.

[0325] Specifically, the current block can be divided into a first region, a second region, and a blending region. Here, the first region is a region belonging to the first partition and can be defined as an region that the division boundary within the current block does not pass through. The second region is a region belonging to the second partition and can be defined as an region that the division boundary within the current block does not pass through. The blending region can be defined as an region that the division boundary within the current block passes through.

[0326] Motion information of a first partition may be stored in a first area. Motion information of a second partition may be stored in a second area. New motion information may be stored in a blending area, in which the motion information of the first partition and the motion information of the second partition are combined according to predefined conditions. For example, a bidirectional motion vector may be generated based on a combination of either an L0 or L1 motion vector of the first partition and either an L0 or L1 motion vector of the second partition, and the generated bidirectional motion vector may be stored in the blending area. Alternatively, either the motion information of the first partition or the motion information of the second partition may be selected according to predefined conditions, and the selected motion information may be stored in the blending area.

[0327] Meanwhile, the BCW index of the first partition may be stored in the first area. The BCW index of the second partition may be stored in the second area. The BCW index according to pre-defined conditions may be stored in the blending area. For example, if the first partition and the second partition have different BCW indices, either BCW index may be selectively stored in the blending area. At this time, among the BCW index of the first partition and the BCW index of the second partition, an index other than BCW_DEFAULT may be preferentially stored. Here, BCW_DEFAULT may be a BCW index indicating that the weights applied to the L0 prediction block and the L1 prediction block are the same. On the other hand, if the BCW indices for the first partition and the second partition are the same, the corresponding BCW index may be stored in the blending area.

[0328] Additionally, a lighting compensation flag may be additionally stored in the process of storing motion information corresponding to the segmentation shape of the current block.

[0329] Specifically, a lighting compensation flag (LIC flag) of a first partition may be stored in a first region. A lighting compensation flag of a second partition may be stored in a second region. A lighting compensation flag according to pre-defined conditions may be stored in a blending region. For example, if the first partition and the second partition have different lighting compensation flags, either lighting compensation flag may be selectively stored in the blending region. At this time, a lighting compensation flag having a minimum value between the lighting compensation flag value of the first partition and the lighting compensation flag value of the second partition may be stored in the blending region. In other words, if the lighting compensation flags for the first partition and the second partition are different from each other, a lighting compensation flag indicating that lighting compensation is not performed may be preferentially stored in the blending region. Alternatively, a lighting compensation flag having a maximum value between the lighting compensation flag of the first partition and the lighting compensation flag of the second partition may be stored in the blending region. In other words, if the lighting compensation flags for the first and second partitions are different, the lighting compensation flag indicating that lighting compensation is performed may be preferentially stored in the blending region. Conversely, if the lighting compensation flags for the first and second partitions are the same, the corresponding lighting compensation flag may be stored in the blending region.

[0330] Referring to FIG. 4, the prediction block 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 (S420).

[0331] A blending process can be performed to perform a weighted average on the first prediction block of the first partition and the second prediction block of the second partition in the form of geometric partitioning. Through this blending process between the first and second prediction blocks, the final prediction block of the current block can be derived.

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

[0333] 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 respectively. At this time, the first prediction block (P0) of the first partition and the second prediction block (P1) of the second partition may be derived through bidirectional prediction.

[0334] When the internal bit depth and the output bit depth are different, the bit precision of P0 and P1 can be scaled down corresponding to the output bit depth.

[0335] For example, if the output bit depth is 10-bit and the internal bit depth is greater than or equal to 10-bit, the L0 prediction block (P) of the first partition 00 ) and L1 prediction block (P 01 ) can maintain the same bit precision as the internal bit depth, and the L0 prediction block (P) of the first partition 00 ) and L1 prediction block (P 01 ) in the process of deriving the first prediction block of the first partition based on the output bit depth, a scale-down may be performed to derive the first prediction block having the same bit precision as the output bit depth. Similarly, the L0 prediction block of the second partition (P 10 ) and L1 prediction block (P 11 ) can maintain the same bit precision as the internal bit depth, and the L0 prediction block (P) of the second partition 10 ) and L1 prediction block (P 11) in the process of deriving the second prediction block of the second partition based on the second prediction block, a scale-down may be performed so that a second prediction block having the same bit precision as the output bit depth can be derived.

[0336] 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 in the process of deriving the first prediction block (P0) of the first partition and the second prediction block (P1) of the second partition, and in the process of deriving 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, scale-down can be performed so that a prediction block having the same bit precision as the output bit depth can be derived. That is, by maintaining a high bit precision for the first prediction block of the first partition and the second prediction block of the second partition until deriving the final prediction block of the current block, the performance of generating the final prediction block can be improved.

[0337] The internal bit depth may be 14-bit, 16-bit, 20-bit or more, and the output bit depth may be 10-bit, 12-bit, 16-bit or more.

[0338] FIG. 5 illustrates a schematic configuration of an inter prediction unit (332) that performs an inter prediction method according to the present disclosure.

[0339] Referring to FIG. 5, the inter prediction unit (332) may include a block division unit (500) and a prediction block derivation unit (510).

[0340] The block partitioning unit (500) can partition the current block into multiple partitions. At this time, the current block may be partitioned into two or more partitions based on one or more partitioning lines. For example, the current block may be partitioned into two or more partitions based on geometric partitioning.

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

[0342] The first prediction block derivation unit can derive a first prediction block (P0) for the first partition of the current block. At this time, the first prediction block of the first partition can be derived through unidirectional or bidirectional prediction. In addition, the first prediction block derivation unit can derive a second prediction block (P1) for the second partition of the current block. At this time, the second prediction block of the second partition can be derived through unidirectional or bidirectional prediction.

[0343] The first prediction block derivation unit can derive the first and second prediction blocks of the current block based on at least one of the embodiments 1 to 17 discussed with reference to FIG. 4.

[0344] 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 block for each prediction mode of each partition is the same as the derivation methods 1 to 6 described above.

[0345] The BCW index and / or lighting compensation flag according to the present disclosure may be signaled via a bitstream or derived from an encoding device / decoding device. This is as described with reference to FIG. 4, and a redundant description thereof will be omitted herein.

[0346] At least one of the motion information, BCW index, or lighting compensation flag applied to each partition of the current block can be stored corresponding to the partitioning form of the current block, as described with reference to FIG. 4.

[0347] FIG. 6 illustrates an inter prediction method performed by an encoding device (200) as an embodiment according to the present disclosure.

[0348] Referring to Figure 6, the current block can be divided into multiple partitions (S600). At this time, the current block can be divided into two or more partitions based on one or more partitioning lines. For example, the current block can be divided into two or more partitions based on geometric partitioning.

[0349] Referring to Fig. 6, a prediction block can be derived for each partition of the current block (S610).

[0350] A first prediction block (P0) can be derived for the first partition of the current block. At this time, the first prediction block of the first partition can be derived through unidirectional or bidirectional prediction. In addition, the first prediction block derivation unit can derive a second prediction block (P1) for the second partition of the current block. At this time, the second prediction block of the second partition can be derived through unidirectional or bidirectional prediction.

[0351] The first and second prediction blocks of the current block can be derived based on at least one of the embodiments 1 to 17 discussed with reference to FIG. 4, and any duplicate descriptions will be omitted here.

[0352] 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 block for each prediction mode of each partition is the same as the derivation methods 1 to 6 described above.

[0353] The BCW index and / or lighting compensation flag according to the present disclosure may be signaled via a bitstream or derived from an encoding device / decoding device. This is as described with reference to FIG. 4, and a redundant description thereof will be omitted herein.

[0354] At least one of the motion information, BCW index, or lighting compensation flag applied to each partition of the current block can be stored corresponding to the partitioning form of the current block, as described with reference to FIG. 4.

[0355] Referring to FIG. 6, the prediction block 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 (S620).

[0356] A blending process can be performed to perform a weighted average on the first prediction block of the first partition and the second prediction block of the second partition in the form of geometric partitioning. Through this blending process between the first and second prediction blocks, the final prediction block of the current block can be derived.

[0357] When performing bidirectional prediction for each partition of the current block, the bit precision can be increased or decreased by considering the internal bit depth and the output bit depth, as seen with reference to Fig. 4.

[0358] Fig. 7 illustrates a schematic configuration of an inter prediction unit (221) that performs an inter prediction method according to the present disclosure.

[0359] Referring to FIG. 7, the inter prediction unit (221) may include a block division unit (700) and a prediction block derivation unit (710).

[0360] The block partitioning unit (700) can partition the current block into multiple partitions. At this time, the current block may be partitioned into two or more partitions based on one or more partitioning lines. For example, the current block may be partitioned into two or more partitions based on geometric partitioning.

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

[0362] The first prediction block derivation unit can derive a first prediction block (P0) for the first partition of the current block. At this time, the first prediction block of the first partition can be derived through unidirectional or bidirectional prediction. In addition, the first prediction block derivation unit can derive a second prediction block (P1) for the second partition of the current block. At this time, the second prediction block of the second partition can be derived through unidirectional or bidirectional prediction.

[0363] The first prediction block derivation unit can derive the first and second prediction blocks of the current block based on at least one of the embodiments 1 to 17 discussed with reference to FIG. 4.

[0364] 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 block for each prediction mode of each partition is the same as the derivation methods 1 to 6 described above.

[0365] The BCW index and / or lighting compensation flag according to the present disclosure may be signaled via a bitstream or derived from an encoding device / decoding device. This is as described with reference to FIG. 4, and a redundant description thereof will be omitted herein.

[0366] At least one of the motion information, BCW index, or lighting compensation flag applied to each partition of the current block can be stored corresponding to the partitioning form of the current block, as described with reference to FIG. 4.

[0367] In the embodiments described above, the methods are described based on a flowchart as a series of steps or blocks. However, the embodiments are not limited to the order of the steps, and some steps may occur in a different order or simultaneously with other steps described above. Furthermore, those skilled in the art will understand that the steps depicted in the flowchart are not exclusive, and 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 document.

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

[0369] When the embodiments in this document are implemented as software, the above-described method can be implemented as a module (process, function, etc.) that performs the above-described function. The module can be stored in memory and 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 can include an application-specific integrated circuit (ASIC), another chipset, logic circuit, and / or data processing device. The memory can include a read-only memory (ROM), a random access memory (RAM), flash memory, a memory card, a storage medium, and / or other storage devices. That is, the embodiments described in this document can be implemented and performed on a processor, a microprocessor, a controller, or a chip. For example, the functional units illustrated in each drawing can be implemented and performed on a computer, a processor, a microprocessor, a controller, or a chip. In this case, information for implementation (e.g., information on instructions) or an algorithm can be stored on a digital storage medium.

[0370] In addition, the decoding device and encoding device to which the embodiment(s) of the present specification are applied may be included in a multimedia broadcasting transmitting and receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video conversation device, a real-time communication device such as a video communication, a mobile streaming device, a storage medium, a camcorder, a video-on-demand (VoD) service providing device, an OTT (Over the top video) device, an Internet streaming service providing device, a three-dimensional (3D) video device, a VR (virtual reality) device, an AR (argumente reality) device, a video phone video device, a transportation terminal (ex. a vehicle (including an autonomous vehicle) terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, and may be used to process a video signal or a data signal. For example, the OTT (Over the top video) device may include a game console, a Blu-ray player, an Internet-connected TV, a home theater system, a smartphone, a tablet PC, a DVR (Digital Video Recorder), etc.

[0371] In addition, the processing method to which the embodiment(s) of the present specification are applied can be produced in the form of a computer-executable program and can be stored in a computer-readable recording medium. Multimedia data having a data structure according to the embodiment(s) of the present specification can also be stored in a computer-readable recording medium. The computer-readable recording medium includes all types of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium can include, for example, a Blu-ray disc (BD), a universal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium includes a medium implemented in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bitstream generated by an encoding method can be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.

[0372] Additionally, the embodiments of the present disclosure may be implemented as a computer program product by program code, and the program code may be executed on a computer by the embodiments of the present disclosure. The program code may be stored on a computer-readable carrier.

[0373] FIG. 8 illustrates an example of a content streaming system to which embodiments of the present disclosure can be applied.

[0374] Referring to FIG. 8, a content streaming system to which the embodiment(s) of the present specification are applied may largely include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0375] The encoding server compresses content input from multimedia input devices such as smartphones, cameras, and camcorders into digital data, generates a bitstream, and transmits it to the streaming server. Alternatively, if multimedia input devices such as smartphones, cameras, and camcorders directly generate bitstreams, the encoding server may be omitted.

[0376] The above bitstream can be generated by an encoding method or a bitstream generation method to which the embodiment(s) of the present specification are applied, and the streaming server can temporarily store the bitstream during the process of transmitting or receiving the bitstream.

[0377] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server acts as an intermediary to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server transmits the multimedia data to the user. At this time, the content streaming system may include a separate control server, in which case the control server controls commands / responses between each device within the content streaming system.

[0378] The streaming server can receive content from a media repository and / or an encoding server. For example, when receiving content from the encoding server, the 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 certain period of time.

[0379] Examples of the user devices may include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation devices, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, HMDs), digital TVs, desktop computers, digital signage, etc.

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

[0381] The claims set forth in this specification may be combined in various ways. For example, the technical features of the method claims of this specification may be combined and implemented as a device, and the technical features of the device claims of this specification may be combined and implemented as a method. Furthermore, the technical features of the method claims and the technical features of the device claims of this specification may be combined and implemented as a device, and the technical features of the method claims and the technical features of the device claims of this specification may be combined and implemented as a method.

Claims

1. A step of dividing the current block into multiple partitions; wherein the multiple partitions include a first partition and a second partition. A step of deriving a first prediction block of the first partition; a step of deriving a second prediction block of the second partition; and A step of deriving a prediction block of the current block based on the first prediction block and the second prediction block, A method for decoding an image, wherein at least one of the first prediction block or the second prediction block is derived through bidirectional prediction.

2. In paragraph 1, When the first partition performs the bidirectional prediction, an L0 prediction block and an L1 prediction block are derived for the first partition, A method for decoding an image, wherein the first prediction block is derived based on a weighted sum of the L0 prediction block and the L1 prediction block.

3. In paragraph 2, A video decoding method, wherein the weights for the above weighted sum are determined based on any one of a plurality of weight candidates belonging to a pre-defined weight set.

4. In the first paragraph, the step of deriving the first prediction block comprises: A step of determining a predetermined search area based on the motion vector of the first partition; A step of calculating a cost for each search location within the search area; and An image decoding method, comprising a step of deriving an L0 prediction block and an L1 prediction block of the first partition based on a search position having a minimum cost among the above-described costs.

5. In paragraph 4, A video decoding method, wherein the above cost is calculated as the sum of absolute difference (SAD) between the weighted L0 block of the search position and the weighted L1 block corresponding to the weighted L0 block.

6. In the first paragraph, the step of deriving the first prediction block comprises: A step of generating a light-compensated L0 prediction block by applying a first light compensation parameter to the L0 prediction block of the first partition; wherein the first light compensation parameter is derived based on a surrounding area of ​​the current block and a surrounding area of ​​the L0 prediction block. A step of generating a light-compensated L1 prediction block by applying a second light compensation parameter to the L1 prediction block of the first partition; wherein the second light compensation parameter is derived based on a surrounding area of ​​the current block and a surrounding area of ​​the L1 prediction block, and An image decoding method, comprising a step of deriving the first prediction block based on a weighted sum of the illumination-compensated L0 prediction block and the illumination-compensated L1 prediction block.

7. In paragraph 6, A video decoding method, wherein the weights for the above weighted sum are determined based on any one of a plurality of weight candidates belonging to a pre-defined weight set.

8. In paragraph 1, The value of the sample of the first prediction block is derived based on at least one of the value of the sample belonging to the L0 prediction block of the first partition, the value of the sample belonging to the L1 prediction block of the first partition, or a predetermined offset, A method for decoding an image, wherein the offset is derived based on at least one of horizontal and vertical slopes at the position of a sample belonging to the L0 prediction block or horizontal and vertical slopes at the position of a sample belonging to the L1 prediction block.

9. In paragraph 1, A video decoding method, wherein each of the first partition and the second partition is a block encoded in one of merge mode, intra block copy (IBC) mode, or template matching-based prediction (TMP) mode.

10. In paragraph 1, A BCW index is obtained for each of the first partition and the second partition, A method for decoding an image, wherein the BCW index specifies one of a plurality of weight candidates belonging to a pre-defined weight set.

11. In paragraph 10, The above current block is divided into a first region, a second region, and a blending region, A video decoding method, wherein either the BCW index of the first partition or the BCW index of the second partition is selectively stored in the blending area.

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

13. A step of dividing the current block into multiple partitions; wherein the multiple partitions include a first partition and a second partition. A step of deriving a first prediction block of the first partition; a step of deriving a second prediction block of the second partition; and A step of deriving a prediction block of the current block based on the first prediction block and the second prediction block, A video encoding method, wherein 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 a video encoding method, wherein the video encoding method comprises: A step of dividing a current block into multiple partitions; wherein the multiple partitions include a first partition and a second partition; A step of deriving a first prediction block of the first partition; a step of deriving a second prediction block of the second partition; and A step of deriving a prediction block of the current block based on the first prediction block and the second prediction block, A computer-readable storage medium, wherein at least one of the first prediction block or the second prediction block is derived through bidirectional prediction.

15. A step of obtaining a bitstream for image information; wherein the bitstream is generated based on a step of dividing a current block into a plurality of partitions including a first partition and a second partition, a step of deriving a first prediction block of the first partition, a step of deriving a second prediction block of the second partition, and a step of deriving a prediction block of the current block based on the first prediction block and the second prediction block, and Including a step of transmitting data including the above bitstream, A data transmission method, wherein at least one of the first prediction block or the second prediction block is derived through bidirectional prediction.

Citation Information

Patent Citations

  • Method for simulating lens and system thereof

    KR1020230163701A

  • Aerosol-generating article with low ignition propensity

    KR102918675B1

  • Using inter prediction with geometric partitioning for video processing

    US20210266537A1

  • Encoding and decoding methods and apparatus

    US20220408082A1