Image encoding / decoding method and apparatus, and recording medium for storing bitstream

The method of deriving multiple prediction blocks using various prediction modes and correction methods addresses the challenge of compressing high-resolution images, enhancing compression efficiency and prediction performance for HD and UHD video content.

WO2024225705A1PCT designated stage expired Publication Date: 2024-10-31LG ELECTRONICS INC
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Current video compression technologies face challenges in efficiently compressing high-resolution images like HD and UHD, requiring improved prediction methods to enhance compression efficiency and prediction performance.

Method used

The method involves deriving multiple prediction blocks for a current block based on different prediction modes, using motion vector predictors like AMVP mode and merge mode, and applying correction methods such as bidirectional matching or template matching to improve prediction accuracy.

Benefits of technology

This approach enhances compression efficiency and prediction performance by deriving multiple prediction blocks through weighted sums, improving the encoding and decoding of high-resolution video content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure KR2024005395_31102024_PF_FP_ABST
    Figure KR2024005395_31102024_PF_FP_ABST
Patent Text Reader

Abstract

An image decoding / encoding method and apparatus according to the present disclosure may derive, for the current block, a plurality of prediction blocks including a first prediction block and a second prediction block and derive a final prediction block of the current block on the basis of the first prediction block and the second prediction block.
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 method and device for deriving multiple prediction blocks for a current block.

[0005] The present disclosure provides a method and device for deriving a multi-prediction block according to a prediction mode.

[0006] The video decoding method and device according to the present disclosure can derive a plurality of prediction blocks including a first prediction block and a second prediction block for a current block, derive a final prediction block of the current block based on the first prediction block and the second prediction block, and reconstruct the current block based on the final prediction block of the current block.

[0007] In the video decoding method and device according to the present disclosure, the first prediction block may be derived based on at least one of a first L0 motion vector predictor or a second L1 motion vector predictor, and the second prediction block may be derived based on at least one of the first L1 motion vector predictor or a second L0 motion vector predictor. Here, at least one of the first L0 motion vector predictor or the first L1 motion vector predictor may be derived based on a first prediction mode, and at least one of the second L0 motion vector predictor or the second L1 motion vector predictor may be derived based on a second prediction mode.

[0008] In the video decoding method and device according to the present disclosure, the first prediction mode may be an AMVP mode, and the second prediction mode may be a merge mode.

[0009] In the video decoding method and device according to the present disclosure, the first L0 motion vector predictor may be derived based on the first prediction mode, and the first L1 motion vector predictor may be derived based on the pre-derived first L0 motion vector predictor.

[0010] In the video decoding method and device according to the present disclosure, at least one of the first L0 motion vector predictor or the second L1 motion vector predictor can be corrected based on either a bidirectional matching-based correction method or a template matching-based correction method.

[0011] In the image decoding method and device according to the present disclosure, either the bidirectional matching-based correction method or the template matching-based correction method can be selected based on a pre-defined first condition.

[0012] In the video decoding method and device according to the present disclosure, at least one of the first L1 motion vector predictor or the second L0 motion vector predictor can be corrected based on either a bidirectional matching-based correction method or a template matching-based correction method.

[0013] In the image decoding method and device according to the present disclosure, either the bidirectional matching-based correction method or the template matching-based correction method can be selected based on a pre-defined second condition.

[0014] In the video decoding method and device according to the present disclosure, whether the second condition is satisfied can be determined based on whether the first condition is satisfied.

[0015] In the video decoding method and device according to the present disclosure, the first prediction block may be derived based on an inter mode, and the second prediction block may be derived based on one or more intra prediction modes for the current block. Here, the one or more intra prediction modes for the current block may include at least one of a planar mode, an MPM, an MIP mode, a DIMD-based intra prediction mode, or a TIMD-based intra prediction mode.

[0016] In the image decoding method and device according to the present disclosure, the first prediction block may be derived based on an inter-prediction block and an intra-prediction block of the current block, and the second prediction block may be derived based on an additional intra-prediction mode for the current block.

[0017] In the video decoding method and device according to the present disclosure, the first prediction block may be derived based on one or more block vectors derived from an IBC candidate list of the current block, and the second prediction block may be derived based on one or more intra prediction modes for the current block.

[0018] The video encoding method and device according to the present disclosure can derive a plurality of prediction blocks including a first prediction block and a second prediction block for a current block, derive a final prediction block of the current block based on the first prediction block and the second prediction block, derive a residual block of the current block based on the final prediction block of the current block, and encode the residual block of the current block.

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

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

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

[0022] According to the present disclosure, compression efficiency can be improved by deriving multiple prediction blocks for a current block and deriving a final prediction block through a weighted sum thereof.

[0023] According to the present disclosure, by proposing a method for deriving various multi-prediction blocks according to the prediction mode of the current block, prediction performance and compression efficiency can be improved.

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

[0025] 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.

[0026] 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.

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

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

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

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

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

[0032] 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. Throughout the description of each drawing, similar reference numerals have been used to designate similar components.

[0033] 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.

[0034] 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.

[0035] 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.

[0036] 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).

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

[0038] 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.

[0039] 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.

[0040] 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.

[0041] 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."

[0042] 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."

[0043] 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".

[0044] 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.”

[0045] 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."

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

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

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

[0049] 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.

[0050] 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.

[0051] 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.

[0052] 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.

[0053] 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.

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

[0055] 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.

[0056] 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.

[0057] 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.

[0058] 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.

[0059] 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.

[0060] 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).

[0061] 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).

[0062] 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.

[0063] 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.

[0064] 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.

[0065] 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.

[0066] 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.

[0067] 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.

[0068] 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.

[0069] 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).

[0070] 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 reconstructed. 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 reconstructor 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.

[0071] 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.

[0072] 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.

[0073] 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).

[0074] 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.

[0075] 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).

[0076] 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.

[0077] 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.

[0078] 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).

[0079] 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).

[0080] 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.

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

[0082] 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.

[0083] 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.

[0084] 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.

[0085] 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.

[0086] 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.

[0087] 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.

[0088] 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.

[0089] 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).

[0090] 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.

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

[0092] Referring to FIG. 4, multiple prediction blocks can be derived for the current block (S400).

[0093] The multiple prediction blocks for the current block may include a first prediction block and a second prediction block. The first prediction block may be derived based on a first prediction mode, and the second prediction block may be derived based on a second prediction mode. Here, the first prediction mode and the second prediction mode may be the same prediction mode or different prediction modes. Hereinafter, a method for deriving the first and second prediction blocks will be described.

[0094] Example 1

[0095] The present disclosure relates to a case where the first and second prediction modes are AMVP-MERGE modes. In particular, it relates to a case where motion information for unidirectional prediction is acquired for each of the AMVP mode and the merge mode.

[0096] In the AMVP-MERGE mode, bidirectional motion information can be acquired for the current block. Here, the bidirectional motion information can include motion information of a first prediction direction acquired based on the AMVP mode and motion information of a second prediction direction acquired based on the merge mode. The first prediction direction can be expressed in the LX direction, and the second prediction direction can be expressed in the L(1-X) direction. X can have a value of 0 or 1. It can be interpreted with the same meaning in the embodiments described below.

[0097] Specifically, for the first prediction direction, at least one of an MVP index, a reference picture index, or MVD information may be signaled. The MVP index may specify any one of a plurality of MVP candidates belonging to an MVP candidate list. The reference picture index may specify any one of the reference pictures belonging to the reference picture list of the first prediction direction. The MVD information may mean information about a motion vector difference. Based on the MVP candidate specified by the MVP index, a motion vector predictor (MVP[0][X]) for the first prediction direction of the current block may be derived. In MVP[0][X], [0] represents the AMVP mode, and [X] represents the LX direction. That is, MVP[0][X] may represent a motion vector predictor in the LX direction derived based on the AMVP mode. MVP[0][X] may mean a motion vector of an MVP candidate specified by the MVP index, or may mean a sum of the difference between a motion vector of an MVP candidate specified by the MVP index and a motion vector derived based on the MVD information.

[0098] For the second prediction direction, a merge index can be signaled. The merge index can specify any one of a plurality of merge candidates belonging to a merge candidate list. Based on the motion vector for the second prediction direction of the merge candidate specified by the merge index, a motion vector predictor (MVP[1][1-X]) for the second prediction direction of the current block can be derived. In MVP[1][1-X], [1] represents a merge mode, and [1-X] represents the L(1-X) direction. That is, MVP[1][1-X] can represent a motion vector predictor in the L(1-X) direction derived based on the merge mode.

[0099] A first prediction block of the current block can be derived based on a motion vector predictor (MVP[0][X]) for the first prediction direction. A second prediction block of the current block can be derived based on a motion vector predictor (MVP[1][1-X]) for the second prediction direction.

[0100] At least one of the motion vector predictors (MVP[0][X], MVP[1][1-X]) for bidirectional prediction of the current block may be corrected based on either a bidirectional matching-based correction method or a template matching-based correction method described below. Based on the corrected motion vector predictor, a first prediction block and a second prediction block of the current block may each be derived.

[0101] 1. Correction method based on two-way matching

[0102] A cost array can be produced by performing a search based on the location of the reference block of the current block within a given search range.

[0103] The reference block of the current block may include a reference block of a first prediction direction (hereinafter, referred to as a first reference block) and a reference block of a second prediction direction (hereinafter, referred to as a second reference block). The first reference block may be specified based on motion information for the first prediction direction. The second reference block may be specified by motion information for the second prediction direction. The motion information for the first prediction direction may be obtained based on either the AMVP mode or the merge mode, and the motion information for the second prediction direction may be obtained based on the other of the AMVP mode or the merge mode.

[0104] The above cost array may be composed of a plurality of costs calculated for each search position within the search range. Each cost may be calculated as a sample difference between at least two blocks searched in both directions. For example, the cost may be calculated as a sum of absolute differences (SAD) between at least two blocks searched in both directions. In this case, a block searched in a first prediction direction is called an LX block, and a block searched in a second prediction direction is called an L(1-X) block. The cost may be calculated based on all samples belonging to the LX and L(1-X) blocks, or may be calculated based on some samples within the LX and L(1-X) blocks.

[0105] Here, some samples refer to sub-blocks of LX and L(1-X) blocks, and at least one of the width or height of the sub-blocks may be half of the width or height of the LX and L(1-X) blocks. That is, the LX and L(1-X) blocks have a size of W x H, and some samples may be sub-blocks having a size of W x H / 2, W / 2 x H, or W / 2 x H / 2. At this time, when some samples are sub-blocks of W x H / 2, some samples may be upper sub-blocks (or lower sub-blocks) within the LX and L(1-X) blocks. When some samples are sub-blocks of W / 2 x H, some samples may be left sub-blocks (or right sub-blocks) within the LX and L(1-X) blocks. When some samples are sub-blocks of W / 2 x H / 2, some samples may be upper-left sub-blocks within the LX and L(1-X) blocks, but are not limited thereto.

[0106] Alternatively, some samples may be defined as at least one of the even-numbered sample lines of the LX and L(1-X) blocks, or at least one of the odd-numbered sample lines. In this case, the sample lines may be vertical sample lines or horizontal sample lines.

[0107] Alternatively, some samples may refer to samples at identically pre-defined positions in the encoding / decoding device. For example, the sample at the pre-defined position may refer to at least one of the upper left sample, the upper right sample, the lower left sample, the lower right sample, the center sample, the center sample of a sample column / row adjacent to the boundary of the current block, or a sample located on a diagonal line within the current block within the LX and L(1-X) blocks.

[0108] The search position within the above search range may be a position shifted by p in the x-axis direction and q in the y-axis direction from the position of the reference block of the current block. For example, when p and q are integers in the range of -1 to 1, the number of search positions in integer pel units within the search range may be at most 9. Alternatively, when p and q are integers in the range of -2 to 2, the number of search positions in integer pel units within the search range may be at most 25. However, the present invention is not limited thereto, and p and q may be integers whose magnitude (or absolute value) is greater than 2, or a search in decimal pel units may be performed.

[0109] A search position within the above search range can be determined based on an offset that is identically predefined for the encoding device and the decoding device. That is, the offset can be defined as a disparity vector between a position of a reference block of a current block and the search position. The offset can include at least one of a non-directional offset or a directional offset. The directional offset can include an offset in at least one direction of left, right, top, bottom, top left, top right, bottom left, or bottom right. The non-directional offset can mean an offset whose magnitude is 0, and the directional offset can mean an offset in which a magnitude (or absolute value) of at least one of the x-component or the y-component of the offset is greater than or equal to 1.

[0110] For example, the offset can be defined as shown in Table 1 below.

[0111] Index(i)012345678dX[ i ]-101-101-101dY[ i ]-1-1-1000111

[0112] Table 1 defines offsets that specify search positions by index, where dX[i] may represent the x-component of the ith offset, and dY[i] may represent the y-component of the ith offset. Offsets according to Table 1 may include a non-directional offset of (0,0) and eight directional offsets. However, the indices in Table 1 are merely for distinguishing offsets, and do not limit the position of the offset corresponding to the index or limit the priority between offsets. In addition, Table 1 shows a case where the magnitudes of the x-component and y-component of the offset are 1, but this is merely an example, and an offset in which the magnitude of at least one of the x-component or the y-component is greater than or equal to 2 may be defined.

[0113] The above offsets can be defined for the L0 and L1 directions respectively. The offset for the search in the L1 direction can be determined dependently on the offset for the search in the L0 direction. For example, if the offset for the search in the L0 direction is (p, q), the offset for the search in the L1 direction can be set to (-p, -q) through mirroring. Alternatively, the offset for the search in the L1 direction can be determined independently from the offset for the search in the L0 direction.

[0114] Information regarding the size and / or direction of the aforementioned offset may be identically predefined in the encoding device and the decoding device, or may be encoded in the encoding device and signaled to the decoding device. The aforementioned information may also be variably determined in consideration of the aforementioned block properties.

[0115] Through the above-described method, a cost corresponding to each search position (or pre-defined offset) within a search range can be calculated. A cost with a minimum value among multiple costs belonging to the cost array can be identified, and a delta motion vector can be determined based on an offset corresponding to the identified cost. A motion vector predictor in the L0 direction can be corrected based on a delta motion vector (deltaMV), and a motion vector predictor in the L1 direction can be corrected based on a mirrored delta motion vector (-deltaMV).

[0116] 2. Template matching-based correction method

[0117] A cost array can be calculated by performing a search based on the position of the reference block of the current block within a given search range. Here, the reference block of the current block is as discussed above in the 'Bidirectional Matching-Based Correction Method'. The cost array can be composed of multiple costs calculated for each search position within the search range. Each cost can be calculated as the sample difference between the template area of ​​the current block and the template area of ​​the search position. For example, the cost can be calculated as the SAD (sum of absolute difference) between the template area of ​​the current block and the template area of ​​the search position. The template area of ​​the search position can mean the template area of ​​a block having the sample of the search position as the upper left sample.

[0118] The above cost may be calculated based on all samples belonging to the template area of ​​the current block and search position, or may be calculated based on some samples within the template area.

[0119] Here, some samples may mean at least one of the even-numbered sample lines or at least one of the odd-numbered sample lines within the template area. In this case, the sample lines may be vertical sample lines or horizontal sample lines.

[0120] Alternatively, the template region may include at least one of the top region, left region, top-left region, bottom-left region, or top-right region adjacent to the block (i.e., the current block, the block at the search position). In this case, some samples may be limited to samples belonging to a region at a specific location within the template region. For example, the region at a specific location may include at least one of the top region or the left region.

[0121] Alternatively, the template region may include neighboring sample lines adjacent to the block and / or at least one non-neighboring sample line. In this case, some samples may be limited to samples belonging to sample lines at specific locations within the template region. For example, the sample line at specific locations may include at least one of a neighboring sample line, a non-neighboring sample line that is one sample away from the boundary of the block, or a non-neighboring sample line that is two samples away from the boundary of the block, which are predefined identically to the encoding device and the decoding device. Information indicating the sample line at the specific location may be signaled through the bitstream.

[0122] The search position within the above search range may be a position shifted by p in the x-axis direction and q in the y-axis direction from the position of the reference block of the current block, and may be determined based on an offset that is identically pre-defined for the encoding device and the decoding device. This has been discussed in the 'Bidirectional Matching-Based Correction Method' above, and any duplicate explanation will be omitted here.

[0123] Through the above-described method, a cost array can be generated for each of the first prediction direction and the second prediction direction. A cost having a minimum value among a plurality of costs belonging to the cost array of the first prediction direction can be identified, and a delta motion vector of the first prediction direction can be determined based on an offset corresponding to the identified cost. Based on the determined delta motion vector of the first prediction direction, a motion vector predictor of the first prediction direction can be corrected. Similarly, a cost having a minimum value among a plurality of costs belonging to the cost array of the second prediction direction can be identified, and a delta motion vector of the second prediction direction can be determined based on an offset corresponding to the identified cost. Based on the determined delta motion vector of the second prediction direction, a motion vector predictor of the second prediction direction can be corrected.

[0124] Depending on whether the current block satisfies a predetermined first condition, either the above-described bidirectional matching-based correction method or the template matching-based correction method may be selectively used. The first condition according to the present disclosure may include at least one of the following conditions: that the current block performs bidirectional prediction; that bidirectional reference pictures for the current block exist before and / or after the current picture in time order; or that the POC difference between the current picture and each reference picture is the same. The time order may mean an output order (picture order count, POC) or an encoding order.

[0125] If the first condition described above is true, a bidirectional matching-based correction method may be used, and if the first condition is false, a template matching-based correction method may be used. Alternatively, if all of the first conditions are true, a bidirectional matching-based correction method may be used, and if any one of the first conditions is false, a template matching-based correction method may be used. Alternatively, if any one of the first conditions is true, a bidirectional matching-based correction method may be used, and if all of the first conditions are false, a template matching-based correction method may be used.

[0126] For example, if the current block performs bidirectional prediction, a bidirectional matching-based correction method may be used, and if not, a template matching-based correction method may be used.

[0127] Alternatively, if the POC difference (diffPOC0) between the current picture including the current block and the reference picture in the first prediction direction is equal to the POC difference (diffPOC1) between the current picture and the reference picture in the second prediction direction, a bidirectional matching-based correction method may be used, and if not, a template matching-based correction method may be used.

[0128] Alternatively, if the current block performs bidirectional prediction and diffPOC is equal to diffPOC1, a bidirectional matching-based correction method may be used; otherwise (i.e., if the current block does not perform bidirectional prediction or diffPOC is not equal to diffPOC1), a template matching-based correction method may be used.

[0129] Alternatively, if the current block performs bidirectional prediction, a bidirectional matching-based correction method can be used even if diffPOC is not identical to diffPOC1. Conversely, if the current block does not perform bidirectional prediction, a template matching-based correction method can be used.

[0130] The AMVP-MERGE mode according to the present disclosure can also be applied to a current block encoded in the intra block copy (IBC) mode. If the inter prediction mode of the current block is the IBC mode, the current picture to which the current block belongs is used as a reference picture, and otherwise, the method according to the aforementioned first embodiment can be applied in the same manner.

[0131] Example 2

[0132] The present disclosure relates to a case where the first and second prediction modes are AMVP-MERGE modes. In particular, the disclosure relates to a case where motion information for bidirectional prediction is acquired for each of the AMVP mode and the merge mode.

[0133] In AMVP-MERGE mode, two or more bidirectional motion information can be acquired for the current block. For example, bidirectional motion information can be acquired based on AMVP mode, and bidirectional motion information can be acquired based on merge mode. However, the present invention is not limited thereto, and unidirectional motion information can be acquired based on AMVP mode, and bidirectional motion information can be acquired based on merge mode. Alternatively, bidirectional motion information can be acquired based on AMVP mode, and unidirectional motion information can be acquired based on merge mode. Hereinafter, for convenience of explanation, it is assumed that bidirectional motion information is acquired for each of AMVP mode and merge mode.

[0134] Motion information can be acquired based on the AMVP mode for each prediction direction of the current block. To this end, at least one of information regarding whether bidirectional prediction is performed, an MVP index, a reference picture index, or MVD information can be signaled. If the current block performs bidirectional prediction, the MVP index, reference picture index, and MVD information can be signaled for each prediction direction.

[0135] Specifically, an MVP candidate list can be constructed for each prediction direction of the current block. The MVP candidate list can include multiple MVP candidates. A motion vector predictor (MVP[0][X], MVP[0][1-X]) of the prediction direction can be derived from the MVP candidate list of each prediction direction. In MVP[0][X], [0] represents the AMVP mode, and [X] represents the LX direction. That is, MVP[0][X] can represent a motion vector predictor of the LX direction derived based on the AMVP mode. MVP[0][X] can be derived based on an MVP candidate specified by an MVP index in the LX direction. For example, MVP[0][X] can mean a motion vector of an MVP candidate specified by an MVP index in the LX direction. Alternatively, MVP[0][X] may denote a motion vector derived based on a motion vector difference between a motion vector of an MVP candidate specified by an MVP index in the LX direction and the motion vector of the MVP candidate. Here, the motion vector difference may be derived based on MVD information in the LX direction. Similarly, in MVP[0][1-X], [0] represents the AMVP mode, and [1-X] represents the L(1-X) direction. That is, MVP[0][1-X] may denote a motion vector predictor in the L(1-X) direction derived based on the AMVP mode. MVP[0][1-X] may be derived based on an MVP candidate specified by an MVP index in the L(1-X) direction. For example, MVP[0][1-X] may denote a motion vector of an MVP candidate specified by an MVP index in the L(1-X) direction. Alternatively, MVP[0][1-X] may refer to a motion vector derived based on the motion vector difference between the motion vector of the MVP candidate specified by the MVP index in the L(1-X) direction and the motion vector. Here, the motion vector difference may be derived based on the MVD information in the L(1-X) direction.

[0136] Meanwhile, motion information of the current block can be obtained based on the merge mode. For this purpose, at least one of a merge index or MVD information specifying one of a plurality of merge candidates belonging to a merge candidate list can be signaled. Motion information of the current block can be obtained based on motion information of the merge candidate specified by the merge index. Here, the motion information can include at least one of a motion vector (or a motion vector predictor) or a reference picture index. If the specified merge candidate performs bidirectional prediction, bidirectional motion information can be obtained for the current block. However, if the specified merge candidate performs unidirectional prediction, unidirectional motion information can be obtained for the current block.

[0137] Specifically, a merge candidate list including multiple merge candidates can be constructed for the current block. A bidirectional motion vector predictor (MVP[1][X], MVP[1][1-X]) can be derived from the merge candidate list. In MVP[1][X], [1] represents a merge mode, and [X] represents the LX direction. That is, MVP[1][X] can represent a motion vector predictor in the LX direction derived based on the merge mode. MVP[1][X] can be derived based on a merge candidate specified by a merge index. For example, MVP[1][X] can mean a motion vector in the LX direction of a merge candidate specified by a merge index. Alternatively, MVP[1][X] can mean a motion vector derived based on a motion vector difference between a motion vector in the LX direction of a merge candidate specified by a merge index and the motion vector. Here, the motion vector difference can be derived based on MVD information. Similarly, in MVP[1][1-X], [1] represents a merge mode, and [1-X] represents the L(1-X) direction. That is, MVP[1][1-X] can represent a motion vector predictor in the L(1-X) direction derived based on the merge mode. MVP[1][1-X] can be derived based on a merge candidate specified by a merge index. For example, MVP[1][1-X] can mean a motion vector in the L(1-X) direction of a merge candidate specified by a merge index. Alternatively, MVP[1][1-X] can mean a motion vector derived based on a motion vector difference from a motion vector in the L(1-X) direction of a merge candidate specified by a merge index. Here, the motion vector difference can be derived based on MVD information.

[0138] Bidirectional motion vector predictors (MVP[0][X], MVP[0][1-X]) derived based on the AMVP mode and bidirectional motion vector predictors (MVP[1][X], MVP[1][1-X]) derived based on the merge mode can be paired in a predefined manner. Through the pairing, one or more bidirectional motion vector predictors can be derived for the current block.

[0139] For example, a single bidirectional motion vector predictor for the current block can be derived through the pairing. In this case, the bidirectional motion vector predictor for the current block can be {MVP[0][X], MVP[1][1-X]}. That is, the bidirectional motion vector predictor for the current block can be derived as a combination of a motion vector predictor in the LX direction according to the AMVP mode and a motion vector predictor in the L(1-X) direction according to the merge mode. Alternatively, the bidirectional motion vector predictor for the current block can be {MVP[0][1-X], MVP[1][X]}. That is, the bidirectional motion vector predictor for the current block can be derived as a combination of a motion vector predictor in the L(1-X) direction according to the AMVP mode and a motion vector predictor in the LX direction according to the merge mode.

[0140] Alternatively, two bidirectional motion vector predictors for the current block can be derived through the pairing. In this case, the bidirectional motion vector predictors for the current block can be {MVP[0][X], MVP[1][1-X]} and {MVP[0][1-X], MVP[1][X]}. That is, one of the two bidirectional motion vector predictors can be derived as a combination of the LX direction motion vector predictor according to the AMVP mode and the L(1-X) direction motion vector predictor according to the merge mode. The other of the two bidirectional motion vector predictors can be derived as a combination of the L(1-X) direction motion vector predictor according to the AMVP mode and the LX direction motion vector predictor according to the merge mode.

[0141] If one bidirectional motion vector predictor is derived for the current block, the first prediction block of the current block can be derived based on MVP[0][X], and the second prediction block of the current block can be derived based on MVP[1][1-X]. Alternatively, if one bidirectional motion vector predictor is derived for the current block, the first prediction block of the current block can be derived based on MVP[0][1-X], and the second prediction block of the current block can be derived based on MVP[1][X].

[0142] When two bidirectional motion vector predictors are derived for the current block, the first prediction block of the current block can be derived based on MVP[0][X] and MVP[1][1-X]. For example, the first prediction block of the current block can be derived based on a weighted sum between a reference block in the LX reference picture specified by MVP[0][X] and a reference block in the L(1-X) reference picture specified by MVP[1][1-X]. In addition, the second prediction block of the current block can be derived based on MVP[0][1-X] and MVP[1][X]. For example, the first prediction block of the current block can be derived based on a weighted sum between a reference block in the L(1-X) reference picture specified by MVP[0][1-X] and a reference block in the LX reference picture specified by MVP[1][X].

[0143] Alternatively, if two bidirectional motion vector predictors are derived for the current block, either one of them may be selectively used. For this purpose, an index specifying one of the two bidirectional motion predictors may be used. The index may be signaled through the bitstream, or may be derived based on conditions predefined equally for the encoding device and the decoding device. Based on the bidirectional motion vector predictors specified by the index, the first and second prediction blocks of the current block may be derived, respectively.

[0144] Hereinafter, for convenience of explanation, one of {MVP[0][X], MVP[1][1-X]} and {MVP[0][1-X], MVP[1][X]} derived through the aforementioned pairing is called the first motion pair, and the other is called the second motion pair.

[0145] At least one of the first motion pair and the second motion pair may be corrected based on either the bidirectional matching-based correction method or the template matching-based correction method discussed above. In this case, the first prediction block and / or the second prediction block of the current block may be derived based on the corrected motion pair.

[0146] Depending on whether the current block satisfies a predetermined first condition, the first motion pair may be corrected based on either a bidirectional matching-based correction method or a template matching-based correction method. The first condition herein is the same as that discussed in Example 1, and a redundant description thereof will be omitted.

[0147] Depending on whether the current block satisfies a predetermined second condition, the second motion pair can be corrected based on either a bidirectional matching-based correction method or a template matching-based correction method.

[0148] The second condition for the second motion pair can be defined independently from the first condition for the first motion pair. For example, the second condition can include at least one of the following conditions: the current block performs bidirectional prediction; the bidirectional reference pictures for the current block exist before and / or after the current picture in time order; or the POC difference between the current picture and each reference picture is the same. The second condition for the second motion pair can be the same as the first condition for the first motion pair. Alternatively, the second condition for the second motion pair can be defined differently from the first condition for the first motion pair.

[0149] Alternatively, the second condition for the second motion pair may include at least one of the following conditions: a condition that the first condition for the first motion pair is false, a condition that the current block performs bidirectional prediction, a condition that the POC difference between the current picture and each reference picture is the same, a condition that the cost for the first motion pair calculated by a bidirectional matching-based correction method or a template matching-based correction method is less than a first threshold, a condition that the POC difference between the current picture and the reference picture for the second motion pair is less than or equal to the POC difference between the current picture and the reference picture for the first motion pair, and a condition that the difference between the first motion pair (or the corrected first motion pair) and the second motion pair is greater than a second threshold.

[0150] If the second condition described above is true, a bidirectional matching-based correction method may be used, and if the second condition is false, a template matching-based correction method may be used. Alternatively, if both second conditions are true, a bidirectional matching-based correction method may be used, and if any one of the second conditions is false, a template matching-based correction method may be used. Alternatively, if any one of the second conditions is true, a bidirectional matching-based correction method may be used, and if all second conditions are false, a template matching-based correction method may be used.

[0151] For example, if the first condition for the first movement pair among the second conditions is true or if none of the remaining conditions among the second conditions are true, a template matching-based correction method may be used, and if not, a bidirectional matching-based correction method may be used.

[0152] The inter prediction method according to the present disclosure may be applied with the following modifications.

[0153] In AMVP-MERGE mode, the derivation of bidirectional motion information for the current block can be restricted. For example, only merge candidates with bidirectional motion information can be included in the merge candidate list. Alternatively, if a merge candidate identified by a merge index has unidirectional motion information, bidirectional motion information can be derived based on that unidirectional motion information.

[0154] Alternatively, in AMVP-MERGE mode, either MVP[0][X] or MVP[0][1-X] can be derived based on the other one of the pre-derived MVP[0][X] or MVP[0][1-X]. For example, the pre-derived MVP[0][X] or MVP[0][1-X] can be mirrored to a reference picture in the opposite direction relative to the current picture to derive an MVP with the opposite sign.

[0155] Alternatively, in AMVP-MERGE mode, either MVP[1][X] or MVP[1][1-X] can be derived based on the other one of the pre-derived MVP[1][X] or MVP[1][1-X]. For example, the pre-derived MVP[1][X] or MVP[1][1-X] can be mirrored to a reference picture in the opposite direction with respect to the current picture to derive an MVP with the opposite sign.

[0156] The AMVP-MERGE mode according to the present disclosure can also be applied to a current block encoded in the intra block copy (IBC) mode. If the inter prediction mode of the current block is the IBC mode, the current picture to which the current block belongs is used as a reference picture, and otherwise, the method according to the aforementioned embodiment 2 can be applied in the same manner.

[0157] Example 3

[0158] The present disclosure relates to a case where the first and second prediction modes are combined inter and intra prediction (CIIP) modes. When the CIIP mode is applied to a current block, a first prediction block and a second prediction block can be derived for the current block, respectively.

[0159] The first prediction block according to the present disclosure can be derived based on inter prediction.

[0160] For example, the first prediction block can be derived based on unidirectional or bidirectional motion information of the current block. Here, the unidirectional or bidirectional motion information can be derived based on AMVP mode or merge mode, as discussed in Examples 1 and 2.

[0161] The second prediction block according to the present disclosure can be derived based on intra prediction.

[0162] For example, one intra prediction mode may be determined for a current block, and a second prediction block may be derived based on the intra prediction mode. The one intra prediction mode may be any one of a planar mode, a Most Probable Mode (MPM), a matrix-based intra prediction mode (MIP), a DIMD-based intra prediction mode to be described later, or a TIMD-based intra prediction mode to be described later. The MPM may be one or more MPM candidates among a plurality of MPM candidates belonging to an MPM candidate list, and may be specified by an MPM index signaled through a bitstream.

[0163] The above one intra prediction mode may be predefined for the encoding device and the decoding device. Alternatively, any one of the predefined intra prediction modes for the CIIP mode may be selected, and the selected intra prediction mode may be set as one intra prediction mode for the current block. Here, the predefined intra prediction modes for the CIIP mode may include at least one of a planar mode, an MPM, a MIP mode, a DIMD-based intra prediction mode, or a TIMD-based intra prediction mode. An index specifying any one of the predefined intra prediction modes may be used for the selection. The index may be signaled through the bitstream, or may be derived based on a condition predefined equally for the encoding device and the decoding device.

[0164] 1. Decoder-side intra mode derivation (DIMD)

[0165] A gradient can be derived based on at least two samples belonging to a surrounding area of ​​a current block. Here, the gradient can include at least one of a horizontal gradient or a vertical gradient. An intra prediction mode of the current block can be derived based on at least one of the derived gradient or the amplitude of the gradient. Here, the magnitude of the gradient can be determined based on the sum of the horizontal gradient and the vertical gradient. Through this derivation method, one intra prediction mode or two or more intra prediction modes can be derived for the current block.

[0166] For example, a gradient can be calculated in units of a window having a predetermined size. Based on the calculated gradient, an angle indicating the directionality of a sample within the window can be calculated. The calculated angle can correspond to any one of the multiple pre-defined intra prediction modes described above. The magnitude of the gradient can be stored / updated for the intra prediction mode corresponding to the calculated angle. Through this process, for each window, an intra prediction mode corresponding to the calculated gradient can be determined, and the magnitude of the gradient can be stored / updated for the determined intra prediction mode. Among the stored gradients, the top T intra prediction modes having the largest magnitude can be selected, and the selected intra prediction mode can be set as the intra prediction mode of the current block. Here, T can be an integer of 1, 2, 3, or a larger number.

[0167] The surrounding area used to calculate the above slope may include at least one of a left area, an upper area, an upper left area, a lower left area, or an upper right area adjacent to the current block, which are previously reconstructed areas of the current block. The surrounding area may include at least one of a neighboring sample line adjacent to the current block, a first non-neighboring sample line that is 1 sample away from the current block, or a second non-neighboring sample line that is 2 samples away from the current block. However, the present invention is not limited thereto, and a non-neighboring sample line that is N samples away from the current block may be further included, and N may be an integer greater than or equal to 3.

[0168] The peripheral region may be a region that is identically predefined for the encoding device and the decoding device to calculate the slope. Alternatively, the peripheral region may be variably determined based on information specifying the location of the peripheral region. In this case, the information specifying the location of the peripheral region may be signaled through a bitstream. Alternatively, the location of the peripheral region may be determined based on at least one of whether the current block is located at the boundary of a coding tree unit, the size of the current block (e.g., width, height, ratio of width to height, product of width and height), the segmentation type of the current block, the prediction mode of the peripheral region, or the availability of the peripheral region.

[0169] For example, if the current block is located at the top boundary of the coding tree unit, at least one of the top region, the top left region, or the top right region of the current block may not be referenced to calculate the gradient. If the width of the current block is greater than the height, either the top region or the left region (e.g., the top region) may be referenced to calculate the gradient, and the other (e.g., the left region) may not be referenced to calculate the gradient. Conversely, if the width of the current block is less than the height, either the top region or the left region (e.g., the left region) may be referenced to calculate the gradient, and the other (e.g., the top region) may not be referenced to calculate the gradient. If the current block is generated through horizontal block division, the top region may not be referenced to calculate the gradient. Conversely, if the current block is generated through vertical block division, the left region may not be referenced to calculate the gradient. If a surrounding region of the current block is encoded in inter mode, the surrounding region may not be referenced to calculate the gradient. However, this is not limited to this, and regardless of the prediction mode of the surrounding area, the surrounding area may also be referenced to calculate the slope.

[0170] 2. Template-based intra-mode derivation (TIMD)

[0171] From the decoder side, intra prediction modes can be derived based on template regions adjacent to the current block, which will be discussed in detail below.

[0172] A cost can be calculated for each of the given candidate modes.

[0173] The above-described candidate modes may refer to multiple intra prediction modes that are identically predefined for the encoding device and the decoding device. Alternatively, for template region-based derivation, a candidate list composed of the candidate modes may be generated, and costs may be calculated for candidate modes belonging to the candidate list. Alternatively, costs may be calculated only for the top N candidate modes within the generated candidate list. Here, N may be a value identically predefined for the encoding device and the decoding device. For example, N may be an integer of 2, 3, 4, 5, or higher.

[0174] The candidate list for template region-based derivation can be constructed in the same manner as the MPM list described above. Alternatively, the candidate list can correspond to the first MPM list or the second MPM list described above. Alternatively, the candidate list can be constructed as a combination of the first and second groups (i.e., MPM lists) described above, or as a combination of subgroups of the first and second groups (i.e., the first MPM list or the second MPM list).

[0175] The above cost can be calculated as the sum of absolute differences (SAD) between the predicted samples and the reconstructed samples within the template region. Alternatively, the cost can also be calculated as the sum of absolute transformed differences (SATD) between the predicted samples and the reconstructed samples within the template region. Here, SATD may refer to the SAD transformed into the frequency domain. As an example of the transformation, the Hadamard transform may be used, but is not limited thereto. The predicted samples within the template region may be generated based on the candidate modes described above.

[0176] The template area for calculating the above cost may be a pre-restored area adjacent to the current block. For example, the template area may include at least one of the upper peripheral area, the left peripheral area, the upper left peripheral area, the lower left peripheral area, or the upper right peripheral area of ​​the current block.

[0177] The template region may be a region that is identically predefined for the encoding device and the decoding device to calculate the cost. Alternatively, the template region may be variably determined based on information specifying the location of the template region. In this case, the information specifying the location of the template region may be signaled through a bitstream. Alternatively, the location of the template region may be determined based on at least one of whether the current block is located at the boundary of a coding tree unit, the size of the current block (e.g., width, height, ratio of width to height, product of width and height), the segmentation type of the current block, the prediction mode of the surrounding region, or the availability of the surrounding region.

[0178] For example, if the current block is located at the top boundary of the coding tree unit, at least one of the top peripheral region, the top-left peripheral region, or the top-right peripheral region of the current block may not be referenced to calculate the cost. If the width of the current block is greater than the height, either the top peripheral region or the left peripheral region (e.g., the top peripheral region) may be referenced to calculate the cost, and the other (e.g., the left peripheral region) may not be referenced to calculate the gradient. Conversely, if the width of the current block is less than the height, either the top peripheral region or the left peripheral region (e.g., the left peripheral region) may be referenced to calculate the cost, and the other (e.g., the top peripheral region) may not be referenced to calculate the cost. If the current block is generated through horizontal block division, the top peripheral region may not be referenced to calculate the cost. Conversely, if the current block is generated through vertical block division, the left peripheral region may not be referenced to calculate the cost. If the surrounding area of ​​the current block is encoded in inter mode, the surrounding area may not be referenced for cost calculation. However, this is not limited to the surrounding area, and the surrounding area may be referenced for cost calculation regardless of the prediction mode of the surrounding area.

[0179] The template region may be composed of N reference sample lines. Here, N may be an integer of 1, 2, 3, 4, or a greater number. The number of reference sample lines constituting the template region may be the same regardless of the location of the surrounding region, or may vary depending on the location of the surrounding region. The cost may be calculated based on all samples belonging to the template region. Alternatively, the cost may be calculated using only reference sample lines at a predetermined location within the template region. Alternatively, the cost may be calculated based on all samples belonging to the reference sample line at the predetermined location, or the cost may be calculated using only samples at a predetermined location within the reference sample line at the predetermined location. The locations of the reference sample lines and / or samples for cost calculation may be determined based on at least one of whether the current block is located at the boundary of a coding tree unit, the size of the current block (e.g., width, height, ratio of width to height, product of width to height), the segmentation type of the current block, the prediction mode of the surrounding region, or the availability of the surrounding region. Alternatively, information indicating the location of the reference sample line for calculating the above cost can be signaled via the bitstream.

[0180] Among the costs calculated for the above candidate modes, one candidate mode with the lowest cost may be selected. For example, costs may be calculated for each of five candidate modes in the candidate list. The five candidate modes in the candidate list may be reordered in ascending order of the calculated costs. Among the five reordered candidate modes, the top candidate mode may be selected.

[0181] Alternatively, at least two candidate modes with the lowest cost among the calculated costs for the above candidate modes may be selected. For example, the costs for each of the five candidate modes in the candidate list may be calculated. The five candidate modes in the candidate list may be reordered in ascending order of the calculated costs. The top two candidate modes among the five reordered candidate modes may be selected.

[0182] One or more candidate modes selected through the above-described process can be set as the intra prediction mode of the current block.

[0183] Alternatively, if at least two candidate modes are selected through the aforementioned process, the intra prediction mode of the current block may be derived based on a comparison between the selected candidate modes and / or a comparison between at least one of the selected candidate modes and a threshold value. For example, the intra prediction mode of the current block may be derived based on whether the selected candidate modes satisfy the following conditions:

[0184] [Condition] costMode2 < (K x costMode1)

[0185] In the above condition, costMode1 may refer to a cost calculated based on one of the selected candidate modes, and costMode2 may refer to a cost calculated based on another of the selected candidate modes. For example, costMode1 may refer to a cost calculated based on a candidate mode with a smaller cost among the selected candidate modes, and costMode2 may refer to a cost calculated based on a candidate mode with a larger cost among the selected candidate modes. In the above condition, K represents a predetermined comparison factor, which may be a value that is identically predefined for the encoding device and the decoding device. For example, K may be an integer of 1, 2, or more, or may refer to a real number such as 1 / 2 or 1 / 4.

[0186] If the above conditions are satisfied, the selected candidate modes may be set as the intra prediction modes of the current block. On the other hand, if the above conditions are not satisfied, the candidate mode with a cost of costMode1 may be set as the intra prediction mode of the current block, and the candidate mode with a cost of costMode2 may not be used as the intra prediction mode of the current block.

[0187] Alternatively, two or more intra prediction modes may be determined for the current block, and a second prediction block may be derived based on the determined two or more intra prediction modes. That is, a prediction block may be derived based on two or more intra prediction modes, and a second prediction block may be derived based on a weighted sum between the derived two or more prediction blocks. For example, if two intra prediction modes are determined for the current block, the second prediction block may be derived as in the following mathematical expression 1.

[0188] [Mathematical Formula 1]

[0189] P intra = ((4 - w1) * P intra0 + w1 * P intra1 + offset) >> shift

[0190] P in mathematical formula 1 intra represents the second prediction block (or a sample of the second prediction block). P intra0 represents a predicted block (or a sample of a predicted block) derived based on either of the two intra prediction modes, and P intra1represents a prediction block (or a sample of a prediction block) derived based on the other intra prediction mode among the two. w1 represents a weight for a weighted sum between the two prediction blocks. For example, when shift is 2 and offset is 2, w1 can be determined as an integer in the range of 1 to 3. Alternatively, when shift is 3, 4, or 5, offset can be 4, 8, or 16, respectively, and w1 can be determined as an integer in the range of 1 to 7, 1 to 15, or 1 to 32, respectively.

[0191] The two or more intra prediction modes may include at least two of a planar mode, an MPM, an MIP mode, a DIMD-based intra prediction mode, or a TIMD-based intra prediction mode. The number of intra prediction modes used to derive the second prediction block may be determined according to a predefined number.

[0192] Example 4

[0193] The present disclosure relates to a case where the first prediction mode is the CIIP mode and the second prediction mode is the intra mode. In this case, a first prediction block and a second prediction block can be derived for the current block, respectively.

[0194] The first prediction block according to the present disclosure can be derived based on inter prediction and intra prediction.

[0195] For example, an inter-prediction block can be derived based on inter-prediction, and an intra-prediction block can be derived based on intra-prediction. A first prediction block can be derived based on the derived inter-prediction block and intra-prediction block.

[0196] The above inter prediction block can be derived based on unidirectional or bidirectional motion information of the current block. Here, the unidirectional or bidirectional motion information can be derived based on AMVP mode or merge mode, as discussed in Examples 1 and 2.

[0197] Additionally, one intra prediction mode may be determined for the current block, and an intra block may be derived based on the intra prediction mode. The one intra prediction mode may be any one of a planar mode, an MPM, an MIP mode, a DIMD-based intra prediction mode, or a TIMD-based intra prediction mode. The method for determining one intra prediction mode for the current block is the same as that described in Example 3, and a duplicate description thereof will be omitted here.

[0198] The above first prediction block can be derived through a weighted sum between the derived inter-prediction block and intra-prediction block. The first prediction block can be derived as shown in the following mathematical expression 2.

[0199] [Equation 2]

[0200] P temp = ((4 - w2) * P inter + w2 * P intra + offset) >> shift

[0201] P in Equation 2 temp represents the first prediction block (or a sample of the first prediction block). P inter represents an inter-prediction block (or a sample of an inter-prediction block), and P intra represents an intra prediction block (or a sample of an intra prediction block). w2 represents a weight for the weighted sum between the inter and intra prediction blocks. The values ​​of shift, offset, and weight in Equation 2 are as discussed in Equation 1.

[0202] The second prediction block according to the present disclosure can be derived based on intra prediction.

[0203] For example, an additional intra prediction mode may be determined for a current block, and a second prediction block may be derived based on the intra prediction mode. The additional intra prediction mode may be an intra prediction mode different from the intra prediction mode for the intra prediction block of the first prediction block, and may be any one of a planar mode, an MPM, an MIP mode, a DIMD-based intra prediction mode, or a TIMD-based intra prediction mode. The additional intra prediction mode may be determined based on the method for determining one intra prediction mode for the current block discussed in Embodiment 3, and a detailed description thereof will be omitted herein.

[0204] However, the derivation of the second prediction block (or determination of an additional intra prediction mode) may be omitted according to conditions equally pre-defined for the encoding device and the decoding device.

[0205] Example 5

[0206] The present disclosure relates to a case where the first prediction mode is the CIIP mode and the second prediction mode is the intra mode. In this case, a first prediction block and a second prediction block can be derived for the current block, respectively.

[0207] The first prediction block according to the present disclosure can be derived based on inter prediction and intra prediction.

[0208] For example, an inter-prediction block can be derived based on inter-prediction, and an intra-prediction block can be derived based on intra-prediction. A first prediction block can be derived based on a weighted sum between the derived inter-prediction block and the intra-prediction block.

[0209] The above inter prediction block can be derived based on unidirectional or bidirectional motion information of the current block. Here, the unidirectional or bidirectional motion information can be derived based on AMVP mode or merge mode, as discussed in Examples 1 and 2.

[0210] Additionally, two or more intra prediction modes may be determined for the current block, and an intra block may be derived based on any one of the two or more intra prediction modes. The two or more intra prediction modes may include at least two of a planar mode, an MPM, a MIP mode, a DIMD-based intra prediction mode, or a TIMD-based intra prediction mode. A method for determining two or more intra prediction modes for the current block is as described in Embodiment 3, and a duplicate description thereof will be omitted herein.

[0211] The above first prediction block can be derived through a weighted sum between the derived inter-prediction block and intra-prediction block. The first prediction block can be derived as shown in the following mathematical expression 3.

[0212] [Equation 3]

[0213] P temp = ((4 - w3) * P inter + w3 * P intra + offset) >> shift

[0214] P in Equation 3 temp represents the first prediction block (or a sample of the first prediction block). P inter represents an inter-prediction block (or a sample of an inter-prediction block), and P intra represents an intra prediction block (or a sample of an intra prediction block). w3 represents a weight for the weighted sum between inter and intra prediction blocks. The values ​​of shift, offset, and weight in Equation 3 are as discussed in Equation 1.

[0215] The second prediction block according to the present disclosure can be derived based on intra prediction.

[0216] For example, a second prediction block may be derived based on another one of two or more intra prediction modes determined for the current block.

[0217] Example 6

[0218] The present disclosure relates to a case where the first prediction mode is the IBC mode and the second prediction mode is the intra mode. In this case, a first prediction block and a second prediction block can be derived for the current block, respectively.

[0219] The first prediction block according to the present disclosure can be derived based on the IBC mode.

[0220] An IBC candidate list may be constructed for the current block. The IBC candidate list may include multiple IBC candidates, and the multiple IBC candidates may be derived based on neighboring blocks adjacent to the current block (or block vectors of the neighboring blocks). One or more block vectors may be derived from the IBC candidate list. A first prediction block may be derived based on the derived block vectors.

[0221] For example, one of a plurality of IBC candidates belonging to an IBC candidate list of a current block may be selected. An index specifying one of the plurality of IBC candidates may be used for the selection. Here, the index may be signaled via a bitstream. A block vector of the current block may be derived based on a block vector of the selected IBC candidate. A reference block specified based on the derived block vector may be set as a first prediction block. Here, the reference block may belong to a current picture to which the current block belongs.

[0222] Alternatively, at least two IBC candidates among a plurality of IBC candidates belonging to an IBC candidate list of a current block may be selected. For this purpose, a first index specifying one of the plurality of IBC candidates and a second index specifying another of the plurality of IBC candidates may be used. The first and second indices may be signaled via a bitstream. Alternatively, the first index may be signaled via a bitstream, and the second index may be derived based on the signaled first index. A first block vector of the current block may be derived based on a block vector of the IBC candidate selected based on the first index. A second block vector of the current block may be derived based on a block vector of the IBC candidate selected based on the second index. A first prediction block may be derived through a weighted sum of a first reference block specified based on the first block vector and a second reference block specified based on the second block vector. Here, the first and second reference blocks may belong to a current picture to which the current block belongs.

[0223] Meanwhile, based on the first and second indices, two different IBC candidates may be selected from among a plurality of IBC candidates. For example, an index may be assigned to each of a plurality of IBC candidates in an IBC candidate list. An IBC candidate having an index equal to the first index may be selected from the IBC candidate list. If the second index is smaller than the first index, an IBC candidate having an index equal to the second index may be selected from the IBC candidate list. On the other hand, if the second index is greater than or equal to the first index, an IBC candidate having an index equal to a value obtained by adding 1 to the second index may be selected from the IBC candidate list.

[0224] The second prediction block according to the present disclosure can be derived based on intra prediction.

[0225] For example, an intra prediction mode may be determined for the current block, and a second prediction block may be derived based on the intra prediction mode. The intra prediction mode may be any one of a planar mode, an MPM mode, an MIP mode, a DIMD-based intra prediction mode, or a TIMD-based intra prediction mode. This is as discussed in Example 3.

[0226] Alternatively, two or more intra prediction modes may be determined for the current block, and a second prediction block may be derived based on the determined two or more intra prediction modes. That is, a prediction block may be derived based on two or more intra prediction modes, and a second prediction block may be derived based on a weighted sum between the two or more derived prediction blocks. This is as discussed in Example 3, and a duplicate description will be omitted here.

[0227] Referring to FIG. 4, a final prediction block of the current block can be derived based on multiple prediction blocks for the current block (S410).

[0228] That is, the prediction block of the current block can be derived based on the weighted sum of the first prediction block and the second prediction block of the current block. For example, the prediction block of the current block can be derived as shown in the following mathematical expression 4.

[0229] [Equation 4]

[0230] P final = ((4 - w4) * P0+ w4 * P1+ offset) >> shift

[0231] P in Equation 4 finalrepresents a prediction block of the current block (or a sample of the prediction block). P0 represents a first prediction block (or a sample of the first prediction block), and P1 represents a second prediction block (or a sample of the second prediction block). w4 represents a weight for a weighted sum between the first and second prediction blocks. For example, when shift is 2 and offset is 2, w4 may be determined as an integer in the range of 1 to 3. Alternatively, when shift is 3, 4, or 5, offset may be 4, 8, or 16, respectively, and w4 may be determined as an integer in the range of 1 to 7, 1 to 15, or 1 to 32, respectively.

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

[0233] Referring to FIG. 5, the inter prediction unit (332) may include a multi-prediction block derivation unit (500) and a multi-prediction block weighting unit (510).

[0234] The multi-prediction block derivation unit (500) can derive multiple prediction blocks for a current block. The multiple prediction blocks can include a first prediction block and a second prediction block. The first prediction block can be derived based on a first prediction mode, and the second prediction block can be derived based on a second prediction mode. Here, the first prediction mode and the second prediction mode may be the same prediction mode or different prediction modes. The first and second prediction blocks according to the first and second prediction modes can be derived based on any one of the above-described embodiments 1 to 6, and a detailed description thereof will be omitted herein.

[0235] The multi-prediction block weighting unit (510) can derive the final prediction block of the current block based on multiple prediction blocks for the current block. That is, the multi-prediction block weighting unit (510) can derive the prediction block of the current block based on the weighted sum of the first prediction block and the second prediction block of the current block. This is as described with reference to FIG. 4.

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

[0237] Referring to FIG. 6, multiple prediction blocks can be derived for the current block (S600).

[0238] The above-described plurality of prediction blocks may include a first prediction block and a second prediction block. The first prediction block may be derived based on a first prediction mode, and the second prediction block may be derived based on a second prediction mode. Here, the first prediction mode and the second prediction mode may be the same prediction mode or different prediction modes. The first and second prediction blocks according to the first and second prediction modes may be derived based on any one of the above-described embodiments 1 to 6, and a detailed description thereof will be omitted herein.

[0239] Referring to FIG. 6, a final prediction block of the current block can be derived based on multiple prediction blocks for the current block (S610). That is, the prediction block of the current block can be derived based on a weighted sum of the first and second prediction blocks of the current block, as discussed with reference to FIG. 4.

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

[0241] Referring to FIG. 7, the inter prediction unit (221) may include a multi-prediction block derivation unit (700) and a multi-prediction block weighting unit (710).

[0242] The multi-prediction block derivation unit (700) can derive multiple prediction blocks for a current block. The multiple prediction blocks can include a first prediction block and a second prediction block. The first prediction block can be derived based on a first prediction mode, and the second prediction block can be derived based on a second prediction mode. Here, the first prediction mode and the second prediction mode may be the same prediction mode or different prediction modes. The first and second prediction blocks according to the first and second prediction modes can be derived based on any one of the above-described embodiments 1 to 6, and a detailed description thereof will be omitted herein.

[0243] The multi-prediction block weighting unit (710) can derive the final prediction block of the current block based on multiple prediction blocks for the current block. That is, the multi-prediction block weighting unit (510) can derive the prediction block of the current block based on the weighted sum of the first and second prediction blocks of the current block. This is as described with reference to FIG. 4.

[0244] 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.

[0245] 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.

[0246] 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.

[0247] 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.

[0248] 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.

[0249] 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.

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

[0251] 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.

[0252] 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.

[0253] 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.

[0254] 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.

[0255] 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.

[0256] 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.

[0257] 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.

[0258] 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 deriving multiple prediction blocks for a current block; wherein the multiple prediction blocks include a first prediction block and a second prediction block. A step of deriving a final prediction block of the current block based on the first prediction block and the second prediction block; and An image decoding method, comprising a step of restoring the current block based on a final prediction block of the current block.

2. In paragraph 1, The first prediction block is derived based on at least one of a first L0 motion vector predictor or a second L1 motion vector predictor, The second prediction block is derived based on at least one of a first L1 motion vector predictor or a second L0 motion vector predictor, A video decoding method, wherein at least one of the first L0 motion vector predictor or the first L1 motion vector predictor is derived based on a first prediction mode, and at least one of the second L0 motion vector predictor or the second L1 motion vector predictor is derived based on a second prediction mode.

3. In paragraph 2, The above first prediction mode is AMVP mode, A video decoding method, wherein the second prediction mode is a merge mode.

4. In paragraph 1, The above first L0 motion vector predictor is derived based on the first prediction mode, A method for decoding an image, wherein the first L1 motion vector predictor is derived based on the first L0 motion vector predictor.

5. In paragraph 2, At least one of the first L0 motion vector predictor or the second L1 motion vector predictor is corrected based on either a bidirectional matching-based correction method or a template matching-based correction method, An image decoding method, wherein either the bidirectional matching-based correction method or the template matching-based correction method is selected based on a pre-defined first condition.

6. In paragraph 5, At least one of the first L1 motion vector predictor or the second L0 motion vector predictor is corrected based on either a bidirectional matching-based correction method or a template matching-based correction method, An image decoding method, wherein either the bidirectional matching-based correction method or the template matching-based correction method is selected based on a pre-defined second condition.

7. In paragraph 6, A video decoding method, wherein whether the second condition is satisfied is determined based on whether the first condition is satisfied.

8. In paragraph 1, The above first prediction block is derived based on the inter mode, A method for decoding an image, wherein the second prediction block is derived based on one or more intra prediction modes for the current block.

9. In paragraph 8, A video decoding method, wherein one or more intra prediction modes for the current block include at least one of a planar mode, an MPM, a MIP mode, a DIMD-based intra prediction mode, or a TIMD-based intra prediction mode.

10. In paragraph 1, The above first prediction block is derived based on the inter prediction block and intra prediction block of the current block, A method for decoding an image, wherein the second prediction block is derived based on an additional intra prediction mode for the current block.

11. In paragraph 1, The first prediction block is derived based on one or more block vectors derived from the IBC candidate list of the current block, A method for decoding an image, wherein the second prediction block is derived based on one or more intra prediction modes for the current block.

12. A step of deriving a plurality of prediction blocks for the current block; wherein the plurality of prediction blocks include a first prediction block and a second prediction block. A step of deriving a final prediction block of the current block based on the first prediction block and the second prediction block; A step of deriving a residual block of the current block based on the final predicted block of the current block; and A video encoding method, comprising a step of encoding a residual block of the current block.

13. A computer-readable storage medium storing a bitstream generated by a video encoding method, wherein the video encoding method comprises: A step of deriving a plurality of prediction blocks for a current block; wherein the plurality of prediction blocks include a first prediction block and a second prediction block. A step of deriving a final prediction block of the current block based on the first prediction block and the second prediction block; A step of deriving a residual block of the current block based on the final predicted block of the current block; and A computer-readable storage medium comprising a step of encoding a residual block of the current block.

14. A step of obtaining a bitstream for image information; wherein the bitstream is generated based on a step of deriving a plurality of prediction blocks including a first prediction block and a second prediction block for a current block, a step of deriving a final prediction block of the current block based on the first prediction block and the second prediction block, a step of deriving a residual block of the current block based on the final prediction block of the current block, and a step of encoding the residual block of the current block, and A data transmission method comprising a step of transmitting data including the above bitstream.

Citation Information

Patent Citations

  • Low Power Type Smart LogoLight

    KR1020210106074A

  • A Binding Molecules Able To Neutralize Coronavirus Superfamily

    KR1020220013297A

  • Semiconductor devices having upper conductive patterns and semiconductor packages having the same

    KR1020240145613A

  • Pre-dispersion liquid, electrode composition, electrode slurry, electrode and lithium ion secondary battery

    KR1020240147862A

  • Method, device, and medium for video processing

    WO2023274181A1