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

By adaptively determining weights based on weight candidate lists and applying weighted prediction in image compression technology, the problem of high weight index signaling overhead in the existing technology is solved, and the compression efficiency and prediction accuracy of high-definition and ultra-high-definition images are improved.

CN118633282APending Publication Date: 2024-09-10LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380021129.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-02-13
Filing Date
2023-02-13
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

When existing image compression technology processes high-definition and ultra-high-definition images, there are problems such as high weight index signaling overhead and low compression efficiency, especially in the application of weighted prediction mode.

Method used

By adaptively determining weights based on a weight candidate list, utilizing multiple predefined weight candidates to calculate and reorder weights, reducing signaling overhead, and applying weighted prediction during image decoding and encoding to improve compression efficiency.

Benefits of technology

It effectively reduces the weight index signaling overhead, improves the efficiency and prediction accuracy of image compression, and is suitable for encoding and decoding of high-definition and ultra-high-definition images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118633282A
    Figure CN118633282A
Patent Text Reader

Abstract

An image decoding / encoding method and apparatus disclosed herein are capable of: generating a first prediction block of a current block on the basis of a first prediction mode; generating a second prediction block of the current block based on the second prediction mode; determining a weight for the current block based on a weight candidate list including a plurality of predefined weight candidates; generating a third prediction block of the current block by weighted summation of the first prediction block and the second prediction block; and decoding / encoding the current block based on the third prediction block of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to an image encoding / decoding method and apparatus and a recording medium storing a bit stream. Background Art

[0002] Recently, demands for high-resolution and high-quality images such as HD (High Definition) images and UHD (Ultra High Definition) images have been increasing in various application fields, and therefore, efficient image compression technology is being discussed.

[0003] There are various technologies, such as inter-frame prediction technology that uses video compression technology to predict pixel values ​​included in the current picture from pictures before or after the current picture, intra-frame prediction technology that predicts pixel values ​​included in the current picture by using pixel information in the current picture, entropy coding technology that assigns short symbols to values ​​with high occurrence frequency and assigns long symbols to values ​​with low occurrence frequency, etc., and these image compression technologies can be used to effectively compress image data and transmit or store it. Summary of the invention

[0004] Technical issues

[0005] The present disclosure is directed to providing a method and apparatus for adaptively determining a weight based on a weight candidate list.

[0006] The present disclosure aims to provide a method and device for configuring a weight candidate list.

[0007] The present disclosure is directed to providing a method and apparatus for signaling / deriving a flag for adaptively using a weight determination technique.

[0008] Technical Solution

[0009] According to an image decoding method and device disclosed herein, a first prediction block of a current block can be generated based on a first prediction mode, a second prediction block of the current block can be generated based on a second prediction mode, a weight for the current block can be determined based on a weight candidate list including a plurality of predefined weight candidates, a third prediction block of the current block can be generated by weighted summing the first prediction block and the second prediction block based on the determined weight, and the current block can be decoded based on the third prediction block of the current block.

[0010] In the image decoding method and apparatus according to the present disclosure, the first prediction mode represents prediction in the L0 direction, and the second prediction mode represents prediction in the L1 direction.

[0011] The image decoding method and apparatus according to the present disclosure may calculate SDA (Sum of Absolute Difference) values ​​respectively corresponding to the plurality of weight candidates.

[0012] In the image decoding method and device according to the present disclosure, the SAD value is calculated based on the reference template area and the template area of ​​the current block, and the reference template area is derived by weighted summing the template area of ​​the L0 reference block and the template area of ​​the L1 reference block based on a weight candidate.

[0013] In the image decoding method and apparatus according to the present disclosure, a reordered weight candidate list is generated by reordering the plurality of weight candidates in ascending order of the SAD values, and a weight for the current block is determined from the reordered weight candidate list.

[0014] According to the image decoding method and device of the present disclosure, a flag indicating whether weighted prediction is performed on the current block can be obtained from a bit stream.

[0015] In the image decoding method and apparatus according to the present disclosure, when the flag indicates that the weighted prediction is performed for the current block, a weight for the current block is determined based on a weight candidate having a minimum SAD value among the SAD values.

[0016] In the image decoding method and apparatus according to the present disclosure, when the flag indicates that the weighted prediction is not performed for the current block, the weight applied to the first prediction block and the weight applied to the second prediction block are determined to be the same value.

[0017] The image decoding method and apparatus according to the present disclosure may determine whether weighted prediction is applicable to the current block based on a predefined condition.

[0018] In the image decoding method and apparatus according to the present disclosure, when the weighted prediction is available for the current block, a weight for the current block is determined based on a weight candidate having a minimum SAD value among the SAD values.

[0019] In the image decoding method and apparatus according to the present disclosure, when the weighted prediction is not available for the current block, the weight applied to the first prediction block and the weight applied to the second prediction block are determined to be the same value.

[0020] In the image decoding method and apparatus according to the present disclosure, the weight candidate list is configured based on the inter prediction mode of the current block, whether bidirectional prediction is applied, or the size of the current block.

[0021] In the image decoding method and device according to the present disclosure, the current block is divided into multiple partitions based on a geometric partitioning mode, the multiple partitions include a first partition and a second partition, the first prediction mode represents a prediction using prediction information of the first partition, and the second prediction mode represents a prediction using prediction information of the second partition.

[0022] According to the image encoding method and device of the present disclosure, a first prediction block of a current block can be generated based on a first prediction mode, a second prediction block of the current block can be generated based on a second prediction mode, a weight for the current block can be determined based on a weight candidate list including multiple predefined weight candidates, a third prediction block of the current block can be generated by weighted summing the first prediction block and the second prediction block based on the determined weight, and the current block can be encoded based on the third prediction block of the current block.

[0023] A computer-readable digital storage medium is provided, which stores encoded video / image information, resulting in execution of an image decoding method due to a decoding device according to the present disclosure.

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

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

[0026] Technical Effects

[0027] The present disclosure can reduce weight index signaling overhead and increase compression efficiency by adaptively determining weights based on a weight candidate list.

[0028] The present disclosure can efficiently determine weights by defining a weight candidate list by considering various encoding information.

[0029] The present disclosure may reduce signaling overhead and increase prediction accuracy by signaling / deriving a flag for adaptively using a weight determination technique. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A video / image compilation system according to the present disclosure is shown.

[0031] Figure 2 A rough block diagram of an encoding device to which an embodiment of the present disclosure can be applied and which performs encoding of a video / image signal is shown.

[0032] Figure 3 A rough block diagram of a decoding device to which an embodiment of the present disclosure can be applied and which performs decoding of a video / image signal is shown.

[0033] Figure 4 An inter-frame prediction method performed by the decoding device 300 according to an embodiment of the present disclosure is illustrated.

[0034] Figure 5is a flowchart illustrating a weight determination method based on a weighted prediction flag according to an embodiment of the present disclosure.

[0035] Figure 6 is a flowchart illustrating a weight determination method for weighted prediction according to an embodiment of the present disclosure.

[0036] Figure 7 is a flowchart illustrating a weighted prediction method based on a geometric partitioning mode according to an embodiment of the present disclosure.

[0037] Figure 8 A schematic configuration of the inter-frame predictor 332 that performs the inter-frame prediction method according to the present disclosure is shown.

[0038] Fig. 9 An inter-frame prediction method performed by the encoding apparatus 200 according to an embodiment of the present disclosure is illustrated.

[0039] Fig.10 A schematic configuration of the inter-frame predictor 221 that performs the inter-frame prediction method according to the present disclosure is shown.

[0040] Fig.11 An example of a content streaming system to which the embodiments of the present disclosure can be applied is shown. DETAILED DESCRIPTION

[0041] Because the present disclosure can make various changes and has several embodiments, specific embodiments will be illustrated in the drawings and described in detail in the detailed description. However, it is not intended to limit the present disclosure to specific embodiments, and it should be understood to include all changes, equivalents and substitutes included in the spirit and technical scope of the present disclosure. While describing each of the accompanying drawings, similar reference numerals are used for similar components.

[0042] Terms such as first, second, etc. can be used to describe various components, but components should not be limited by these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present disclosure, a first component can be referred to as a second component, and similarly, a second component can also be referred to as a first component. Terms and / or combinations of any one or more related statement items in a plurality of related statement items are included.

[0043] When a component is referred to as being "connected" or "linked" to another component, it should be understood that it can be directly connected or linked to another component, but another component may also exist in between. On the other hand, when a component is referred to as being "directly connected" or "directly linked" to another component, it should be understood that another component does not exist in between.

[0044] The terms used in this application are only used to describe specific embodiments and are not intended to limit the present disclosure. Unless the context clearly indicates otherwise, singular expressions include plural expressions. In this application, it should be understood that terms such as "including" or "having" are intended to designate the existence of features, numbers, steps, operations, components, parts or combinations thereof described in the specification, but do not exclude the possibility of the existence or addition of one or more other features, numbers, steps, operations, components, parts or combinations thereof in advance.

[0045] The present disclosure relates to video / image coding. For example, the methods / embodiments disclosed herein may be applied to methods disclosed in the Universal Video Coding (VVC) standard. In addition, the methods / embodiments disclosed herein may be applied to methods disclosed in the Basic Video Coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the second generation audio video coding standard (AVS2), or the next generation video / image coding standard (e.g., H.267 or H.268, etc.).

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

[0047] Here, video may refer to a collection of a series of images over time. A picture generally refers to a unit representing an image within a specific time period, and a slice / tile is a unit that forms a part of a picture in coding. A slice / tile may include at least one coding tree unit (CTU). A picture may consist of at least one slice / tile. 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 ​​a CTU having the same height as the picture and a width assigned by the syntax requirements of the picture parameter set. A tile row is a rectangular area of ​​a CTU having a height assigned by the picture parameter set and the same width as the width of the picture. The CTU within a tile may be arranged continuously according to a CTU raster scan, and the tiles within a picture may be arranged continuously according to a raster scan of the tile. A slice may include an integer number of complete tiles or an integer number of continuous complete CTU rows within a tile of a picture that may be exclusively included in a single NAL unit. At the same time, a picture may be divided into at least two sub-pictures. A sub-picture may be a rectangular area of ​​at least one slice within a picture.

[0048] Pixel, pixel or picture element may refer to the smallest unit constituting a picture (or image). In addition, "sample" may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luminance component, or only a pixel / pixel value of a chrominance component.

[0049] 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 associated with the corresponding region. A unit may include a luminance block and two chrominance (e.g., cb, cr) blocks. In some cases, a unit may be used interchangeably with terms such as a block or region. In general, an MxN block may include a set (or array) of transform coefficients or samples (or sample arrays) consisting of M columns and N rows.

[0050] Here, "A or B" may refer to "only A", "only B", or "both A and B". In other words, herein, "A or B" may be interpreted as "A and / or B". For example, herein, "A, B or C" may refer to "only A", "only B", "only C", or "any combination of A, B, and C".

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

[0052] Here, "at least one of A and B" may refer to "only A", "only B", or "both A and B". In addition, herein, expressions such as "at least one of A or B" or "at least one of A and / or B" can be interpreted in the same manner as "at least one of A and B".

[0053] In addition, herein, “at least one of A, B, and C” may refer to “only A”, “only B”, “only C”, or “any combination of A, B, and C”. In addition, “at least one of A, B, or C” or “at least one of A, B and / or C” may refer to “at least one of A, B, and C”.

[0054] In addition, the brackets used herein may refer to "for example". Specifically, when the indication is "prediction (intra-frame prediction)", "intra-frame prediction" may be proposed as an example of "prediction". In other words, the "prediction" here is not limited to "intra-frame prediction", and "intra-frame prediction" may be proposed as an example of "prediction". In addition, even when the indication is "prediction (ie, intra-frame prediction)", "intra-frame prediction" may be proposed as an example of "prediction".

[0055] Here, technical features described individually in one drawing may be implemented individually or simultaneously.

[0056] Figure 1 A video / image compilation system according to the present disclosure is shown.

[0057] refer to Figure 1, a video / image coding system may include a first device (source device) and a second device (receiving device).

[0058] The source device may send the encoded video / image information or data to the receiving device in the form of a file or stream transmission through a digital storage medium or a network. The source device may include a video source, an encoding device, and a sending unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / image encoding device, and the decoding device may be referred to as a video / image decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display unit, and the display unit may be composed of a separate device or an external component.

[0059] The video source may obtain the video / image by a process of capturing, synthesizing or generating the video / image. The video source may include a device for capturing the video / image and a device for generating the video / image. The device for capturing the video / image may include at least one camera, a video / image archive including previously captured videos / images, etc. The device for generating the video / image may include a computer, a tablet computer, a smart phone, etc., and may (electronically) generate the video / image. For example, a virtual video / image may be generated by a computer, etc., and in this case, the process of capturing the video / image may be replaced by a process of generating the relevant data.

[0060] The encoding device can encode the input video / image. The encoding device can perform a series of processes such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.

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

[0062] The decoding device may decode the video / image by performing a series of processes corresponding to the operations of the encoding device, such as dequantization, inverse transformation, prediction, etc.

[0063] The renderer may render the decoded video / image. The rendered video / image may be displayed through a display unit.

[0064] Figure 2A rough block diagram of an encoding device to which an embodiment of the present disclosure can be applied and which performs encoding of a video / image signal is shown.

[0065] refer to Figure 2 , the encoding device 200 may be composed of an image segmenter 210, a predictor 220, a residual processor 230, an entropy encoder 240, an adder 250, a filter 260, and a memory 270. The predictor 220 may include an inter-frame predictor 221 and an intra-frame predictor 222. The residual processor 230 may include a transformer 232, a quantizer 233, a dequantizer 234, and an inverse transformer 235. The residual processor 230 may further include a subtractor 231. The adder 250 may be referred to as a reconstructor or a reconstructed block generator. According to an embodiment, the above-mentioned image segmenter 210, the predictor 220, the residual processor 230, the entropy encoder 240, the adder 250, and the filter 260 may be configured by at least one hardware component (e.g., an encoder chipset or processor). 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 a memory 270 as an internal / external component.

[0066] The image divider 210 may divide the input image (or picture, frame) input to the encoding device 200 into at least one processing unit. As an example, the processing unit may be referred to as a coding unit (CU). In this case, the coding unit may be recursively divided from a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree binary tree ternary tree (QTBTTT) structure.

[0067] For example, one coding unit may be segmented into a plurality of coding units having a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quadtree 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 quadtree structure. The coding process according to this specification may be performed based on a final coding unit that is no longer segmented. In this case, based on coding efficiency according to image characteristics, etc., the maximum coding unit may be directly used as the final coding unit, or if necessary, the coding unit may be recursively segmented into coding units of a deeper depth, and the coding unit with the best size may be used as the final coding unit. Here, the coding process may include processes such as prediction, transformation, and reconstruction described later.

[0068] 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 be divided or partitioned from the above-mentioned final coding unit, respectively. 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 the transform coefficient.

[0069] In some cases, a unit may be used interchangeably with terms such as a block or region. In general, an MxN block may represent a set of transform coefficients or samples consisting of M columns and N rows. A sample may generally represent a pixel or a pixel value, and may represent only a pixel / pixel value of a luma component, or only a pixel / pixel value of a chroma component. A sample may be used as a term to make a picture (or image) correspond to a pixel or a picture element.

[0070] The encoding device 200 may subtract the prediction signal (prediction block, prediction sample array) output from the inter predictor 221 or the intra predictor 222 from the input image signal (original block, original sample array) to generate a residual signal (residual signal, residual sample array), and the generated residual signal is transmitted to the transformer 232. In this case, a unit that subtracts the prediction signal (prediction block, prediction sample array) from the input image signal (original block, original sample array) within the encoding device 200 may be referred to as a subtractor 231.

[0071] The predictor 220 may perform prediction on a block to be processed (hereinafter referred to as a current block) and generate a predicted block including a prediction sample for the current block. The predictor 220 may determine whether intra prediction or inter prediction is applied in units of a current block or CU. The predictor 220 may generate various information about the prediction, such as prediction mode information, and send it to the entropy encoder 240, as described later in the description of each prediction mode. The information about the prediction may be encoded in the entropy encoder 240 and output in the form of a bitstream.

[0072] The intra-frame predictor 222 can predict the current block by referring to the samples in the current picture. Depending on the prediction mode, the referenced sample can be located near the current block or can be located at a certain distance away from the current block. In intra-frame prediction, the prediction mode may include at least one non-directional mode and multiple directional modes. The non-directional mode may include at least one of the DC mode or the plane mode. Depending on the detail level of the prediction direction, the directional mode may include 33 directional modes or 65 directional modes. However, this is only an example, and more or less directional modes may be used depending on the configuration. The intra-frame predictor 222 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0073] The inter-frame predictor 221 may 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. In this case, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter-frame prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter-frame prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc., and the reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter-frame predictor 221 may configure 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, for skip mode and merge mode, the inter predictor 221 may use motion information of neighboring blocks as motion information of the current block. For skip mode, unlike merge mode, a residual signal may not be transmitted. For motion vector prediction (MVP) mode, motion vectors of surrounding blocks are used as motion vector predictors, and motion vector differences are signaled to indicate the motion vector of the current block.

[0074] The predictor 220 may generate a prediction signal based on various prediction methods described later. For example, the predictor may not only apply intra prediction or inter prediction to predict a block, but may also apply intra prediction and inter prediction at the same time. It may be referred to as a combined inter and intra prediction (CIIP) mode. In addition, the predictor may be based on an intra block copy (IBC) prediction mode or may be based on a palette mode for prediction of a block. The IBC prediction mode or the palette mode may be used for content image / video coding of games, such as screen content coding (SCC), etc. IBC basically performs prediction within the current picture, but it may be performed similarly to inter prediction because it derives a reference block within the current picture. In other words, IBC may use at least one of the inter prediction techniques described herein. The palette mode may be considered an example of intra coding or intra prediction. When the palette mode is applied, the sample values ​​within the picture may be signaled based on information about the palette table and the palette index. The prediction signal generated by the predictor 220 may be used to generate a reconstructed signal or a residual signal.

[0075] The transformer 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loève transform (KLT), a graph-based transform (GBT), or a conditional nonlinear transform (CNT). Here, GBT refers to a transform obtained from a graph when relationship information between pixels is expressed as a graph. CNT refers to a transform obtained based on generating a prediction signal using all previously reconstructed pixels. In addition, the transform process may be applied to square pixel blocks of the same size or may be applied to non-square blocks of variable size.

[0076] The quantizer 233 may quantize the transform coefficients and send them to the entropy encoder 240, and the entropy encoder 240 may encode the quantized signal (information about the quantized transform coefficients) and output it as a bitstream. The information about the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange the quantized transform coefficients in the block form into a one-dimensional vector form based on the coefficient scanning order, and may generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form.

[0077] The entropy encoder 240 may perform various encoding methods such as Exponential Golomb, Context Adaptive Variable Length Coding (CAVLC), Context Adaptive Binary Arithmetic Coding (CABAC), etc. The entropy encoder 240 may encode information necessary for video / video image reconstruction (e.g., values ​​of syntax elements, etc.) in addition to transform coefficients quantized together or individually.

[0078] The encoded information (e.g., encoded video / image information) can be transmitted or stored in units of network abstraction layer (NAL) units in the form of a bitstream. The video / image information may further include information about various parameter sets such as an adaptive 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. Here, information and / or syntax elements transmitted / signaled from the encoding device to the decoding device may be included in the video / image information. The video / image information may be encoded and included in the bitstream through the above-mentioned encoding process. The bitstream may be transmitted through a network or may be stored in a digital storage medium. Here, the network may include a broadcast network and / or a communication network, etc., and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmission unit (not shown) for transmission and / or a storage unit (not shown) for storing a signal output from the entropy encoder 240 may be configured as an internal / external element of the encoding device 200, or the transmission unit may also be included in the entropy encoder 240.

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

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

[0081] The modified reconstructed picture transmitted to the memory 270 may be used as a reference picture in the inter predictor 221. When inter prediction is applied therethrough, the encoding apparatus can avoid prediction mismatch in the encoding apparatus 200 and the decoding apparatus, and can also improve encoding efficiency.

[0082] The DPB of the memory 270 may store the modified reconstructed picture to be used as a reference picture in the inter-frame predictor 221. The memory 270 may store the motion information of the block from which the motion information in the current picture is derived (or encoded) and / or the motion information of the block in the pre-reconstructed picture. The stored motion information may be sent to the inter-frame predictor 221 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 270 may store the reconstructed samples of the reconstructed block in the current picture and send them to the intra-frame predictor 222.

[0083] Figure 3 A rough block diagram of a decoding device to which an embodiment of the present disclosure can be applied and which performs decoding of a video / image signal is shown.

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

[0085] According to an embodiment, the above-mentioned entropy decoder 310, residual processor 320, predictor 330, adder 340 and filter 350 may be configured by one hardware component (e.g., decoder chipset or processor). 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.

[0086] When a bit stream including video / image information is input, the decoding device 300 may respond to the Figure 2 The image is reconstructed by a process of processing video / image information in an encoding device. For example, the decoding device 300 can derive a unit / block based on relevant information of block segmentation obtained from a bitstream. The decoding device 300 can perform decoding by using a processing unit applied in the encoding device. Therefore, the processing unit of decoding can be a coding unit, and the coding unit can be divided from a coding tree unit or a maximum coding unit according to a quadtree structure, a binary tree structure and / or a ternary tree structure. At least one transform unit can be derived from the coding unit. And, the reconstructed image signal decoded and output by the decoding device 300 can be played by a playback device.

[0087] The decoding device 300 may receive the bit stream from Figure 2 The received signal can be decoded by the entropy decoder 310. For example, the entropy decoder 310 can parse the bitstream to derive information (e.g., video / image information) necessary for image reconstruction (or picture reconstruction). The video / image information may further include information about various parameter sets such as an adaptive 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 may further decode the picture based on the information about the parameter set and / or the general constraint information. The signaled / received information and / or the syntax elements described later in this document may be decoded and obtained from the bitstream by a decoding process. For example, the entropy decoder 310 may decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, CABAC, etc., and output the values ​​of the syntax elements necessary for image reconstruction and the quantized values ​​of the transform coefficients of the residual. In more detail, the CABAC entropy decoding method can receive a bin corresponding to each syntax element from a bitstream, determine a context model by using information of syntax elements to be decoded, decoding information of surrounding blocks and blocks to be decoded, or information of symbols / bins decoded in the previous step, perform arithmetic decoding on bins by predicting the probability of occurrence of bins according to the determined context model, and generate symbols corresponding to the values ​​of each syntax element. In this case, after determining the context model, the CABAC entropy decoding method can update the context model by using information about decoded symbols / bins of the context model for the next symbol / bin. Among the information decoded in the entropy decoder 310, information about prediction is provided to the predictor (inter-frame predictor 332 and intra-frame predictor 331), and the residual value, that is, the quantized transform coefficient and related parameter information, which is entropy decoded in the entropy decoder 310, can be input to the residual processor 320. The residual processor 320 can derive a residual signal (residual block, residual sample, residual sample array). In addition, information about filtering among the information decoded in the entropy decoder 310 can be provided to the filter 350. Meanwhile, a receiving unit (not shown) that receives a signal output from the encoding device may be further configured as an internal / external element of the decoding device 300 or the receiving unit may be a component of the entropy decoder 310 .

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

[0089] The dequantizer 321 may dequantize the quantized transform coefficients and output the transform coefficients. The dequantizer 321 may rearrange the quantized transform coefficients into a two-dimensional block form. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the encoding device. The dequantizer 321 may dequantize the quantized transform coefficients by using a quantization parameter (e.g., quantization step size information) and obtain the transform coefficients.

[0090] The inverse transformer 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0091] The predictor 320 may perform prediction on the current block and generate a prediction block including prediction samples for the current block. The predictor 320 may determine whether to apply intra prediction or inter prediction to the current block based on the information on prediction output from the entropy decoder 310, and determine a specific intra / inter prediction mode.

[0092] The predictor 320 can generate a prediction signal based on various prediction methods described later. For example, the predictor 320 can not only apply intra prediction or inter prediction to predict a block, but also apply intra prediction and inter prediction at the same time. It can be called a combined inter and intra prediction (CIIP) mode. In addition, the predictor can be based on an intra block copy (IBC) prediction mode or can be based on a palette mode for prediction of a block. The IBC prediction mode or the palette mode can be used for content image / video coding of games, such as screen content coding (SCC), etc. IBC basically performs prediction within the current picture, but it can be performed similarly to inter prediction because it derives a reference block within the current picture. In other words, IBC can use at least one of the inter prediction techniques described herein. The palette mode can be considered as an example of intra coding or intra prediction. When the palette mode is applied, information about the palette table and the palette index can be included in the video / image information and sent with a signal.

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

[0094] The inter-frame predictor 332 may 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. In this case, in order to reduce the amount of motion information sent in the inter-frame prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter-frame prediction direction information (L0 prediction, L1 prediction, Bi prediction, etc.). For inter-frame prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter-frame predictor 332 may configure a motion information candidate list based on the neighboring blocks, and derive a motion vector and / or a reference picture index for the current block based on the received candidate selection information. Inter-frame prediction may be performed based on various prediction modes, and information about the prediction may include information indicating an inter-frame prediction mode for the current block.

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

[0096] The adder 340 may be referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next block to be processed in the current picture, may be output through filtering described later, or may be used for inter prediction of the next picture. At the same time, luminance mapping with chroma scaling (LMCS) may be applied during picture decoding.

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

[0098] The (modified) reconstructed picture stored in the DPB of the memory 360 can be used as a reference picture in the inter-frame prediction unit 332. The memory 360 can be derived from the motion information in its current picture (or decoded) The motion information of the block and / or the motion information of the block in the pre-reconstructed picture. The stored motion information can be sent to the inter-frame predictor 332 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 360 can store the reconstructed samples of the reconstructed block in the current picture and send them to the intra-frame predictor 331.

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

[0100] Figure 4 An inter-frame prediction method performed by the decoding device 300 according to an embodiment of the present disclosure is illustrated.

[0101] refer to Figure 4 , the decoding device may generate an initial prediction block S400. The decoding device may generate a first prediction block of the current block based on the first prediction mode, and may generate a second prediction block of the current block based on the second prediction mode. In the present disclosure, the first prediction block and / or the second prediction block that are weighted and summed to generate the final prediction block may be referred to as an initial prediction block. In addition, in the present disclosure, the first prediction block and / or the second prediction block may be referred to as a reference block.

[0102] As an example, the first prediction mode may represent a prediction in the L0 direction, and the second prediction mode may represent a prediction in the L1 direction. In other words, the current block may be a bidirectional prediction block. Alternatively, as an example, the current block may be a unidirectional prediction block. Of course, when a general inter-frame prediction method such as a merge mode or AMVP is applied to the current block, an embodiment of the present disclosure may be applied, and in addition to this, various other inter-frame prediction methods may be applied. As an example, the first prediction mode may be a merge mode, and the second prediction mode may be an AMVP mode.

[0103] Alternatively, as an example, the current block may be divided into a plurality of partitions based on a geometric partitioning mode, and the plurality of partitions may include a first partition and a second partition. In this case, the first prediction mode may represent a prediction using prediction information of the first partition, and the second prediction mode may represent a prediction using prediction information of the second partition. The prediction information of the first partition may be motion information of the first partition or may be intra-frame prediction information of the first partition. Similarly, the prediction information of the second partition may be motion information of the second partition or may be intra-frame prediction information of the second partition. In other words, an initial prediction block may be generated based on a GPM or a GPM-intra mode. The GPM-intra mode represents a mode in which one GPM partition performs inter-frame prediction and another GPM partition performs intra-frame prediction. The initial prediction block may be generated by the prediction information of each GPM partition.

[0104] The decoding device may determine the weight S410. The decoding device may determine the weight for the current block based on a weight candidate list including a plurality of predefined weight candidates. In this regard, the present disclosure will later describe in detail an embodiment of a method for determining a weight applied to the current block based on a weight candidate list.

[0105] The decoding device may generate a final prediction block based on the weight determined in S410 S420. The decoding device may generate a final prediction block by weighted summing the initial prediction blocks based on the determined weights. In other words, the decoding device may generate a third prediction block of the current block by weighted summing the first prediction block and the second prediction block.

[0106] Hereinafter, a method for effectively performing weighted prediction is described. Since the weights according to the embodiments of the present disclosure are weights for weighted prediction, they may be collectively referred to as bidirectional prediction (BCW) using CU-based weights, unidirectional prediction (UCW) using CU-based weights, and CU-based weights (CW). The weights according to the present disclosure may be applied to bidirectional weighted prediction or may be applied to unidirectional weighted prediction (e.g., local illumination compensation (LIC)). In describing the following embodiments, for ease of description, the case where bidirectional weighted prediction is performed is mainly described, but the present disclosure is not limited thereto. In essence, the same method may also be applied to unidirectional weighted prediction.

[0107] In one embodiment, weights can be derived from a weight candidate list. The weight candidate list may include multiple weight candidates and may be predefined in the encoding / decoding device. The weight candidate may be a set of weights (i.e., a first weight and a second weight) representing the weights applied to each bidirectional prediction block, or may be a weight applied to a prediction block in either direction. When only the weights applied to a prediction block in one direction are derived from the weight candidate list, the weights applied to the prediction block in another direction may be derived based on the weights derived from the weight candidate list. For example, the weights applied to the prediction block in another direction may be derived by subtracting the weights derived from the weight candidate list from a predetermined value. In the present disclosure, the weight candidate list may be referred to as a candidate list, a weight list, a weight factor list, a weight group, a weight candidate group (candidate group), a weight factor group, and the like.

[0108] In addition, in one embodiment, a weight index may be derived that indicates a weight for weighted prediction of a current block in a weight candidate list. In the present disclosure, the weight index may be referred to as bcw_idx or bcw index. The weight index may be derived in a decoding device in the same manner as in an encoding device, or may be signaled to a decoding device via a bitstream from an encoding device.

[0109] Example 1

[0110] In an embodiment of the present disclosure, a method for reordering weight indexes is described to reduce the signaling overhead of weight indexes and increase compression efficiency. In this embodiment, the description is made on the assumption that the first prediction block is an L0 prediction block and the second prediction block is an L1 prediction block, but the present disclosure is not limited thereto. For example, the first prediction block may be an intra-frame prediction block, and the second prediction block may be an inter-frame prediction block. Alternatively, for example, the first prediction block may be an intra-frame prediction block of a first partition, and the second prediction block may be an inter-frame prediction block of a second partition. Alternatively, for example, the first prediction block may be an inter-frame prediction block of a first partition, and the second prediction block may be an inter-frame prediction block of a second partition.

[0111] In an embodiment, the weight can be determined or signaled in units of CU. For example, under low-latency conditions (or low-latency B-picture conditions), the weight (w1) candidate group of L1 can be defined (or determined) as {4, 5, 3, 10, -2}, and the weight w0 of L0 can be defined as (8-w1). Under non-low-latency conditions (or random access conditions), considering the trade-off between complexity and performance, the weight candidate group of L1 can be defined as {4, 5, 3}, which includes three weights. The weight w0 of L0 can be defined as (8-w1) in the same way.

[0112] In an embodiment, a final prediction sample considering the weight of each direction may be calculated according to the following Equation 1.

[0113] [Equation 1]

[0114]

[0115] In Equation 1, offset3 is a variable representing an offset, and shift1 is a variable for configuring a shift value of a right shift operation. The above Equation 1 can be simply expressed as the following Equation 2.

[0116] [Equation 2]

[0117]

[0118] For example, in Equation 2, the variable offset may be defined as (1<<(1+2)), and the variable shift may be defined as (1+3). If the sum of the weights in both directions is 16, the offset may be defined as (1<<(1+3)), and the shift may be defined as (1+4).

[0119] In the decoding device aspect, a cost may be calculated for each weight candidate belonging to the weight candidate list, and the weight candidates belonging to the weight candidate list may be reordered based on the calculated cost. The cost calculation method will be described in detail later. As an example, the decoding device can reorder the weight candidates belonging to the weight candidate list in ascending order of the calculated cost.

[0120] The weight of the weighted sum for predicting the block may be determined based on the reordered candidate list and the index information. As an example, the index information is encoded based on the reordered candidate list and may be signaled via the bitstream. Alternatively, as an example, the index information may be derived from spatial or temporal neighboring blocks. The index information may indicate any one of the weight candidates in the reordered candidate list.

[0121] As an example, it is assumed that the candidate list includes three weight candidates, ie, first to third weight candidates, and indexes of 0 to 2 are assigned to the first to third weight candidates, respectively.

[0122] For the first to third weight candidates, the costs of cost0 to cost2 may be calculated respectively. In this case, when the calculated costs are sorted in ascending order, it is assumed that they are sorted in the order of cost1, cost2, and cost0. In this case, if the weight candidates are reordered in ascending order of cost, the candidate list can be reordered in the order of the second weight candidate, the third weight candidate, and the first weight candidate. In other words, an index of 0 may be assigned to the second weight candidate, an index of 1 may be assigned to the third weight candidate, and an index of 2 may be assigned to the first weight candidate.

[0123] The value of the index information is an integer in the range of 0 to 2, and the weight candidate indicated by the index information can be configured as a weight for the weighted sum of the prediction block. In other words, when the value of the index information is 0, the second weight candidate assigned with an index of 0 in the reordered candidate list can be configured as a weight for the weighted sum of the prediction block. Alternatively, when the value of the index information is 1, the third weight candidate assigned with an index of 1 in the reordered candidate list can be configured as a weight for the weighted sum of the prediction block. Alternatively, when the value of the index information is 2, the first weight candidate assigned with an index of 2 in the reordered candidate list can be configured as a weight for the weighted sum of the prediction block.

[0124] Alternatively, as an example, it is assumed that the candidate list includes five weight candidates, ie, first to fifth weight candidates, and indexes of 0 to 4 are assigned to the first to fifth weight candidates, respectively.

[0125] The costs of cost0 to cost4 may be calculated for the first to fifth weight candidates, respectively. In this case, when the calculated costs are sorted in ascending order, it is assumed that they are sorted in the order of cost1, cost2, cost0, cost3, and cost4. In this case, when the weight candidates are reordered in ascending order of cost, the candidate list can be reordered in the order of the second weight candidate, the third weight candidate, the first weight candidate, the fourth weight candidate, and the fifth weight candidate. In other words, an index of 0 may be assigned to the second weight candidate, an index of 1 may be assigned to the third weight candidate, an index of 2 may be assigned to the first weight candidate, an index of 3 may be assigned to the fourth weight candidate, and an index of 4 may be assigned to the fifth weight candidate.

[0126] Index information may be encoded for the first N weight candidates belonging to the reordered candidate list. If N is 3, the value of the index information is an integer in the range of 0 to 2, and it may indicate any one of the first three weight candidates belonging to the reordered candidate list. The weight candidate indicated by the index information may be configured as the weight of the weighted sum of the prediction block. However, this is only an example, and N may be 2 or 4.

[0127] Alternatively, costs may be calculated for the first N weight candidates among the five weight candidates belonging to the candidate list, respectively, and costs may not be calculated for the remaining weight candidates. In the following, for ease of description, it is assumed that N is 3, but is not limited thereto, and N may be 2 or 4.

[0128] For the first three weight candidates, i.e., the first to third weight candidates, the costs of cost0 to cost2 may be calculated respectively. In this case, when the calculated costs are sorted in ascending order, it is assumed that they are sorted in the order of cost1, cost2, and cost0. In this case, when the weight candidates are reordered in ascending order of cost, the candidate list can be reordered in the order of the second weight candidate, the third weight candidate, the first weight candidate, the fourth weight candidate, and the fifth weight candidate.

[0129] The index information may be encoded for the first N weight candidates for calculating the cost. If N is 3, the value of the index information is an integer in the range of 0 to 2, and it may indicate any one of the first three weight candidates belonging to the reordered candidate list. The weight candidate indicated by the index information may be configured as a weight for the weighted sum of the prediction block.

[0130] Even under low latency conditions, cost-based index reordering can be performed on each candidate in the determined candidate list. As an example, reordering can be performed for more candidates than the number of candidates used for index signaling, and index signaling can be performed for a specific number of candidates with small costs among the reordered candidates. Hereinafter, a cost calculation method will be described.

[0131] In the decoding device aspect, a cost may be calculated for each weight candidate belonging to a weight candidate list. As an example, the weight candidate list may be sorted based on the weight candidates. Alternatively, as an example, a weight candidate having a minimum cost among the costs calculated from the weight candidates may be selected. The selected one weight candidate may be configured as a weight for a weighted sum of a prediction block.

[0132] Here, the cost can be calculated for all weight candidates belonging to the weight candidate list, or the cost can be calculated only for the first N weight candidates belonging to the weight candidate list. N is an integer of 2, 3, 4 or more, and can be equal to or less than the total number of weight candidates belonging to the weight candidate list.

[0133] The cost may be calculated as the sum of absolute differences (SAD) between one or more samples in the template region of the current block and one or more samples in the template region of the reference block.The template region may be defined as a left region and / or a top region.

[0134] Specifically, when the current block is encoded by bidirectional prediction, the current block may have a reference block in the L0 direction and a reference block in the L1 direction. In this case, the SAD may be calculated based on a template area adjacent to the reference block in the L0 direction, a template area adjacent to the reference block in the L1 direction, and a template area adjacent to the current block. Samples of the template area in the L0 direction and the L1 direction may be generated by applying corresponding weight candidates to reconstructed samples of reference pictures in the L0 direction and the L1 direction, respectively. Reference blocks in the L0 direction and the L1 direction may be specified using L0 motion information (or motion vector) and L1 motion information (or motion vector), respectively.

[0135] After applying corresponding weight values ​​to the left and top template regions adjacent to the L0 reference block and the left and top template regions adjacent to the L1 reference block to generate the final template, the SAD of the left and top template regions with the current block can be calculated.

[0136] In an embodiment, the template area may consider only the left or top area by considering the availability of boundaries of a picture, slice, tile, CTU, etc. In addition, the area and size of the template may vary depending on the shape and size of the block. As an example, a SAD value corresponding to a plurality of weight candidates may be calculated in a weight candidate list, and in this case, the SAD value may be calculated based on the reference template area and the template area of ​​the current block. Here, the reference template area may be derived by weighted summing the template area of ​​the L0 reference block and the template area of ​​the L1 reference block based on the corresponding weight candidates. As an example, SAD may be used to calculate the cost of the template area. A general SAD calculation formula may be defined as Equation 3 below.

[0137] [Equation 3]

[0138]

[0139] In Equation 3, tP0 and tP1 represent sample values ​​of the left and top template regions of L0 and L1, respectively, and tC represents sample values ​​of the left and top templates of the current block. In addition, the offset and shift in Equation 3 may be omitted as offset and shift variables, respectively, or may be partially changed and applied to facilitate calculation.

[0140] Alternatively, as an example, in addition to the SAD described above, various methods such as mean reduced SAD (MRSAD), high frequency removal SAD, etc. may be used to calculate the cost. For example, MRSAD may be derived by using Equation 4 below.

[0141] [Equation 4]

[0142]

[0143] In addition, the high frequency removal SAD can be derived by using the following Equation 5.

[0144] [Equation 5]

[0145]

[0146] Referring to Equation 5, it is assumed that the sum of w0 and w1 is 8. In order to calculate the cost by compensating the weights of w0 and w1 applied by the reference block in the template area for the current block, 3 can be applied to the left shift operation. In addition, the offset and shift variables can be reflected in the SAD calculation process to adjust the range of the SAD value.

[0147] As described above, the variables offset and shift can be derived (or determined, or configured) based on the sum of w0 and w1, so they can be changed according to the weight value. In addition, in the SAD calculation process, the order in which the offset and shift are applied can also be changed. For example, for equation 5 for high-frequency removal of SAD described above, part of the calculation process can be changed according to the following equation 6 or 7.

[0148] [Equation 6]

[0149]

[0150] [Equation 7]

[0151]

[0152] Changing Equation 5 to Equation 6 or Equation 7 can also be applied to other SAD calculation formulas described above in the same or similar manner. In addition, the cost calculation method described above can be applied to all samples in the template area of ​​the corresponding block, or can also be applied to some samples in the template area.

[0153] Alternatively, even when the current block is encoded by bidirectional prediction, the SAD may be calculated based on a template area adjacent to the reference block and a template area adjacent to the current block in either the L0 or L1 directions. Either the L0 or L1 directions may be directions predefined equally for the encoding device and the decoding device.

[0154] The template area used to calculate the cost may be a neighboring area adjacent to the current block and / or the reference block. For example, the template area may include at least one of a top neighboring area, a left neighboring area, an upper left neighboring area, a lower left neighboring area, or an upper right neighboring area.

[0155] The template area may be an area predefined equally for the encoding device and the decoding device to calculate the cost. Alternatively, the template area may be variably determined based on information specifying the location of the template area. In this case, the information specifying the location of the template area may be signaled by the bitstream. Alternatively, the location and / or size of the template area may be determined based on whether the current block is located on the boundary of at least one of a picture, a slice, a tile, or a coding tree unit, the size of the current block (e.g., width, height, ratio of width and height, product of width and height), the shape of the current block, the partition type of the current block, the prediction mode of the neighboring area, or the availability of the neighboring area.

[0156] For example, when the current block is located at the top boundary of the coding tree unit, at least one of the top neighboring area, the upper left neighboring area, or the upper right neighboring area of ​​the current block may not be referenced for cost calculation. When the width of the current block is greater than the height, the top neighboring area may be referenced for cost calculation, and the left neighboring area may not be referenced for cost calculation. On the contrary, when the width of the current block is less than the height, the left neighboring area may be referenced for cost calculation, and the top neighboring area may not be referenced for cost calculation.

[0157] When the current block is generated by horizontal block division, the top adjacent region may not be referenced for calculating the cost. Conversely, when the current block is generated by vertical block division, the cost may not be calculated by reference to the left adjacent region. When the adjacent region of the current block is encoded in intra mode, the corresponding adjacent region may not be referenced for calculating the cost. However, this is not limited to this, and the corresponding adjacent region may be referenced for calculating the cost regardless of the prediction mode of the adjacent region.

[0158] The template area may be composed of M sample rows. Here, M may be an integer of 1, 2, 3, 4 or more. Regardless of the position of the neighboring area, the number of sample rows configuring the template area may be the same, or may be different according to the position of the neighboring area. The cost may be calculated based on all samples belonging to the template area. Alternatively, the cost may be calculated by using only sample rows at predetermined positions within the template area. Alternatively, the cost may be calculated based on all or some samples of sample rows belonging to predetermined positions. The positions of sample rows and / or samples used for cost calculation within the template area may be determined based on at least one of whether the current block is located on the boundary of a picture, slice, tile or coding tree unit, the size of the current block, the shape of the current block, the partition type of the current block, the prediction mode of the neighboring area, or the availability of the neighboring area. Alternatively, information for specifying the position of the sample rows used for cost calculation may be signaled via a bitstream.

[0159] Example 2

[0160] In an embodiment of the present disclosure, a method for reducing the signaling overhead of a weight index and increasing compression efficiency is proposed. As described above, three weight candidate groups can be defined for random access, and five weight candidate groups can be defined for low latency. In the present disclosure, a weight candidate group represents a group including weight candidates, and can be referred to as a weight candidate list. In the present embodiment, it is described by assuming a situation in which signaling of a weight index is required, but the present disclosure is not limited to this. In other words, the weight index can be signaled via a bitstream, or can be derived by a decoding device.

[0161] As an example, a weight index of a weight candidate for inter-frame prediction of a current block within a specified weight candidate group may be notified by a signal. In this case, as an example, based on index signaling, a method for improving signaling overhead will be described below. As an example, the syntax in Table 1 below may be defined.

[0162] [Table 1]

[0163]

[0164] Referring to Table 1, when weighted prediction is activated in the current sequence, the current block is a bidirectional prediction block, explicit weighted prediction is not applied, and the block size is greater than or equal to a predefined threshold, weighted prediction based on weights according to the present disclosure may be applied, as shown in the syntax of Table 1. If the predefined conditions are met, bcw_flag may be signaled.

[0165] In the present disclosure, bcw_flag may represent a syntax element indicating whether weighted prediction is performed, and may be referred to as a weighted prediction flag. In other words, whether weighted prediction is applied may be determined by using bcw_flag. When bcw_flag is 1, the weight may be determined by using the derivation method proposed in the present disclosure. When bcw_flag is 0, weighted prediction is not applied, and a final prediction block may be generated by averaging the initial prediction blocks.

[0166] According to an embodiment of the present invention, if weighted prediction is not applied according to the value of bcw_flag, averaging may be performed. However, in the present disclosure, weighted prediction may be a concept separate from averaging, or may be a concept encompassing averaging. In other words, even when weighted prediction is applied, if the weight values ​​applied to the two initial prediction blocks are the same, averaging may be performed. In other words, the weight index of the weighted prediction may indicate a case where the weights included in the weight set are the same, or may indicate a case where the weights included in the weight set are different.

[0167] In addition, as an example, as shown in Table 2 below, the method described above is changed and applied by considering the trade-off between compression performance and computational complexity.

[0168] [Table 2]

[0169]

[0170] Referring to Table 2, even when weighted prediction is activated in the current sequence, bcw_flag may be signaled that the current block is a unidirectional prediction block and explicit weighted prediction in the corresponding direction (L0 or L1) is not applied. In other words, according to Table 2, even when unidirectional prediction is performed, weighted sum may be performed for a prediction block or a reference block. Accordingly, in the present disclosure, even in this case, even when unidirectional prediction is performed to increase the weight determination efficiency for weighted prediction, weight-based weighted prediction according to the present disclosure may be applied.

[0171] In addition, as an example, bcw_flag may be signaled based on the syntax in Table 3 below.

[0172] [Table 3]

[0173]

[0174] Referring to Table 3, when weighted prediction is activated in the current sequence, the current block is a bi-directional prediction block, and the block size is greater than a predefined threshold, bcw_flag may be signaled. In other words, for bcw_flag signaling, explicit weighted prediction may not be considered.

[0175] In addition, as an example, bcw_flag may be signaled based on the syntax in Table 4 below.

[0176] [Table 4]

[0177]

[0178] Referring to Table 4, when weighted prediction is activated in the current sequence and the block size is greater than a predefined threshold, bcw_flag may be signaled. In other words, for bcw_flag signaling, whether it is a bidirectional prediction block and explicit weighted prediction may not be considered.

[0179] In addition, as an example, bcw_flag may be signaled based on the syntax in Table 5 below.

[0180] [Table 5]

[0181]

[0182] Referring to Table 4, bcw_flag may be signaled when weighted prediction is activated in the current sequence. In other words, bcw_flag may be signaled regardless of whether it is a bidirectional prediction block, whether explicit weighted prediction is applied, or whether the block size is greater than or equal to a predefined threshold.

[0183] Example 3

[0184] Embodiments of the present disclosure propose a method for deriving a weight index without separate signaling, so as to reduce the signaling overhead of the weight index and improve compression efficiency.

[0185] In other words, the weight index and / or weighted prediction flag may be derived by the decoding device without being signaled by the encoding device. As an example, the weight index may be derived by the decoding device when the conditions in Table 6 below are met.

[0186] It can be exported when the following conditions are met during decoding.

[0187] [Table 6]

[0188]

[0189] Referring to Table 6, when weighted prediction based on weight is activated, the current block is a bidirectional prediction block, explicit weighted prediction is not applied in both directions, and the size of the current block is greater than or equal to a predetermined threshold, a weight index can be derived. As an example, the threshold can be configured as 64, 128, 256, 512, etc., and its value can be changed and applied.

[0190] As an example, considering the trade-off between compression performance and computational complexity, the method described above can be applied as shown in Table 7 below.

[0191] [Table 7]

[0192]

[0193] Referring to Table 7, when weighted prediction based on weight is activated, the current block is a unidirectional prediction block, explicit weighted prediction in the corresponding direction is not applied, and the size of the current block is greater than or equal to a predetermined threshold, a weight index can be derived. As an example, the threshold can be configured as 64, 128, 256, 512, etc., and its value can be changed and applied.

[0194] In addition, as an example, it can be changed as in the following Table 8 and applied.

[0195] [Table 8]

[0196]

[0197] Referring to Table 8, when weighted prediction based on weight is activated, the current block is a bidirectional prediction block, and the size of the current block is greater than or equal to a predetermined threshold, a weight index can be derived. As an example, the threshold can be configured as 64, 128, 256, 512, etc., and its value can be changed and applied.

[0198] In addition, as an example, it can be changed as in the following Table 9 and applied.

[0199] [Table 9]

[0200]

[0201] Referring to Table 9, when weighted prediction based on weight is activated and the size of the current block is greater than or equal to a predetermined threshold, a weight index can be derived. As an example, the threshold can be configured as 64, 128, 256, 512, etc., and its value can be changed and applied. In other words, the weight index can be derived regardless of whether explicit weighted prediction or bidirectional prediction is performed.

[0202] In addition, as an example, it can be changed as in the following Table 10 and applied.

[0203] [Table 10]

[0204]

[0205] Referring to Table 10, when weighted prediction based on weight is activated, the weight index can be derived. In other words, the weight index can be derived regardless of whether explicit weighted prediction or bidirectional prediction is performed or the size of the block.

[0206] Example 4

[0207] According to an embodiment of the present invention, the weight for weighted prediction can be derived based on the weighted prediction flag. Figure 5 Describe in detail.

[0208] Figure 5 is a flowchart illustrating a weight determination method based on a weighted prediction flag according to an embodiment of the present disclosure.

[0209] refer to Figure 5 , described by assuming that the execution is based on Figure 5 As an embodiment, the weighted prediction flag may be signaled by a bit stream from an encoding device according to embodiment 2 described above, or may be derived by a decoding device.

[0210] refer to Figure 5, the decoding apparatus may confirm whether the weighted prediction flag value is 1 ( S500 ). As an example, the weighted prediction flag can be signaled or derived in units of coding units, prediction units, or transform units.

[0211] When the weighted prediction flag value is 1, the decoding device may calculate the cost for each candidate in the predefined weight candidate list S510. Figure 4 The template area-based cost calculation method described in .

[0212] The decoding device may select a candidate with the minimum cost in the weighted candidate list (S520). The candidate with the minimum cost may be referred to as a candidate with the best cost or a candidate with the lowest cost.

[0213] The decoding device may generate a final prediction block (or prediction sample) by weighted summing the prediction block and the weight (or weight factor) of the selected candidate (S530). As an example, the method described in Equation 1 or 2 above may be applied.

[0214] As an example, when weighted prediction is applied, the offset in the process of generating the final prediction block can be configured as (1<<(1+2)), and the shift can be configured as (1+3). However, this is an example, and the present embodiment is not limited to this. The offset and shift in the process of calculating the average value between the prediction blocks of L0 and L1 can be configured as 1, respectively, and considering that the sum of the weights applied to the L0 and L1 prediction blocks for applying weighted prediction is 8, the offset and shift can be configured as 4 and 3, respectively. Accordingly, when the sum of the weights of L0 and L1 is changed, the corresponding offset and shift can be changed by taking this into consideration.

[0215] If the weighted prediction flag value is 0, the decoding device may generate a final prediction block by averaging the two prediction blocks (S540). As described above, when weighted prediction is performed according to the weighted prediction flag, weighted summation may be performed, and when weighted prediction is not performed, averaging may be performed. In other words, according to the weighted prediction flag, the weights in the weight set may be determined to be different values, or may be determined (ie, averaged) to be the same value.

[0216] As an example, the weight candidate list can be configured as shown in Table 11 below.

[0217] [Table 11]

[0218]

[0219] Referring to Table 11, in an embodiment, the weight candidate list may include four weight candidates (or weight sets). As shown in Table 11, an index may be assigned to each weight candidate. As an embodiment, the weight candidate list in Table 11 may perform template-based cost calculation in the same manner in an encoding device and a decoding device.

[0220] Example 5

[0221] According to an embodiment of the present invention, a weight index or a weighted prediction flag for weighted prediction can be derived by a decoding device without being notified by a signal from an encoding device. The encoding device and the decoding device can derive the weight index or the weighted prediction flag in the same manner. Figure 6 The weight determination process according to the present embodiment is described.

[0222] Figure 6 is a flowchart illustrating a weight determination method for weighted prediction according to an embodiment of the present disclosure.

[0223] refer to Figure 6 , the decoding device may determine whether weighted prediction is available (S600). As an example, as described in Embodiment 3, whether weighted prediction is available may be determined in units of blocks based on at least one of SPS, whether explicit weighted prediction is applied, whether bidirectional prediction is performed, or block size. As an example, the unit of a block may be a unit of a coding unit, a prediction unit, or a transform unit.

[0224] When weighted prediction is available, the decoding device may calculate the cost for each candidate in the predefined weight candidate list (S610). The above Figure 4 The template-based costing method described in .

[0225] The decoding device may select a candidate with the minimum cost in the weighted candidate list (S620). The decoding device may generate a final prediction block (or prediction sample) by weighted summing the prediction block with the weight (or weight factor) of the selected candidate (S630). In this case, as an example, the method described in the above equation 1 or 2 may be applied.

[0226] As an example, when weighted prediction is applied, the offset in the process of generating the final prediction block can be configured as (1<<(1+2)), and the shift can be configured as (1+3). However, this is an example, and the present embodiment is not limited to this. The offset and shift in the process of calculating the average value between the prediction blocks of L0 and L1 can be configured as 1, respectively, and considering that the sum of the weights applied to the L0 and L1 prediction blocks for applying weighted prediction is 8, the offset and shift can be configured as 4 and 3, respectively. Accordingly, when the sum of the weights of L0 and L1 is changed, the corresponding offset and shift can be changed by taking this into consideration.

[0227] When weighted prediction is not available, the decoding apparatus may generate a final prediction block by averaging two prediction blocks ( S640 ).

[0228] As an example, the weight candidate list may be configured as shown in Table 12 below.

[0229] [Table 12]

[0230]

[0231] Referring to Table 12, in an embodiment, the weight candidate list may include five weight candidates (or weight sets). As shown in Table 12, an index may be assigned to each weight candidate. As an embodiment, the weight candidate list in Table 12 may perform template-based cost calculation in the same manner in an encoding device and a decoding device. In this case, when the index value is 0, this is a case where the weight applied to the prediction block of L0 is the same as the weight applied to the prediction block of L1, which may indicate a case where an average is performed for the prediction block.

[0232] Example 6

[0233] According to an embodiment of the present invention, in deriving the weight of weighted prediction, the weight candidate list may be configured (or determined) based on the inter prediction mode, whether bidirectional prediction is performed, or the size of a block.

[0234] Inter prediction may include various prediction methods other than general merge mode or AMVP mode. For example, inter prediction may include at least one of affine prediction mode, template matching mode or AMVP-MERGE mode. Weight candidate lists for these various inter prediction methods may be configured to improve prediction performance.

[0235] As an example, the affine prediction mode and / or template matching mode can be selected by considering the deformation or relatively fine motion of the block. Accordingly, in addition to the candidates included in the weight candidate list described above, the candidates reflecting the deformation or relatively fine changes of the block described above can be further considered. For example, as shown in Table 13 below, a weight candidate list for the affine prediction mode and / or template matching mode can be defined.

[0236] [Table 13]

[0237]

[0238] Referring to Table 13, weight candidates with relatively small changes in weight between L0 and L1 may be considered. Table 13 is an example showing that a separate weight candidate list with relatively small changes between weight candidates may be configured in addition to the merge mode or AMVP mode, and the present embodiment is not limited thereto. In addition, when the weighted prediction flag is signaled, the first candidate in Table 13 may be excluded from the weight candidate list.

[0239] When the inter-frame prediction mode of the current block is an affine prediction mode or a template matching mode, the change in weight values ​​between multiple predefined weight candidates included in the weight candidate list can be configured to have a relatively smaller value than the change in weight values ​​between multiple weight candidates included in the weight candidate list in the merge mode or the AMVP mode.

[0240] AMVP-MERGE represents a method in which a prediction block (or reference block) is derived by applying the AMVP mode to any one direction of L0 and L1, and the prediction block is derived by applying the merge mode to the other direction. A weighted sum of the two derived prediction blocks can be performed. As an embodiment, a weight candidate list for AMVP-MERGE can be configured. Alternatively, when AMVP-MERGE is applied, a weight candidate list for the AMVP mode or the merge mode can be configured. Similarly, a weight candidate list for a unidirectional prediction block can be configured. For example, a weight candidate list for AMVP-MERGE and / or a unidirectional prediction block as shown in Table 14 can be defined.

[0241] [Table 14]

[0242]

[0243] In addition, the weighted candidate list can be configured according to the size of the block. As an example, considering the increased complexity for small blocks, the cost can be calculated for a small number of candidates. Alternatively, the candidate configuration of the weighted candidate list and the number of candidates can be different according to the inter-frame prediction mode, whether bidirectional prediction is performed, or the size of the block.

[0244] Example 7

[0245] According to an embodiment of the present invention, in deriving the weight of weighted prediction, the weight candidate list may be configured (or determined) based on the inter-frame prediction mode, whether bidirectional prediction is performed, or the size of the block. In deriving the weight of weighted prediction, the weight may be selected based on different thresholds according to the inter-frame prediction mode, whether bidirectional prediction is performed, or the size of the block. As an example, the weight candidate list in Table 15 below may be defined.

[0246] [Table 15]

[0247]

[0248] When there is a predefined weight candidate list as in Table 15, the weight candidate can be determined by using the following threshold. Specifically, the decoding device can calculate the cost of each candidate for the candidates present in the weight candidate list, and select the candidate with the lowest cost from among them. If the index of the selected candidate is not 0 (default weight), that is, if the selected candidate is not a weight set in which two weights are the same, the difference between the cost of the selected candidate and the cost of the default weight candidate can be calculated.

[0249] When the difference between the cost of the selected candidate and the cost of the default weight candidate is greater than a predefined threshold or greater than or equal to a predefined threshold, a weighted summation can be performed by using the weight of the selected candidate. Otherwise, weighted prediction can be performed by using a default weight with an index of 0. In this case, the weighted summation can be an average value. According to this embodiment, the importance of weight sets with the same weight value can be given priority. In addition, as an example, as described in Embodiment 2 described above, when the same weight candidate (or weight set) is not included in the weight candidate list, the process described above can be performed by comparing with the first candidate in the corresponding list. The process described above can be shown in Table 16.

[0250] [Table 16]

[0251]

[0252] In Table 16, bestCost represents the cost of the candidate with the lowest cost in the weighted candidate list.

[0253] As an example, the threshold value may be different according to at least one of the inter-frame prediction mode, the size of the block, or whether bidirectional prediction is performed. As an example, for a prediction method that can consider fine motion such as an affine prediction mode or a template matching mode, the threshold value may be configured to be relatively small to reflect fine weight changes.

[0254] In addition, as an example, since the prediction error of a unidirectional prediction block tends to be larger than the prediction error of a bidirectional prediction block, another threshold or threshold weight, such as lambda*threshold, may also be configured for the unidirectional prediction block or AMVP-MERGE mode.

[0255] Example 8

[0256] The weight index or weighted prediction flag described above can be referenced by spatial, temporal or non-adjacent spatial neighboring blocks. As described in the above embodiment 1, when the weight candidate list is reordered, the index can be determined based on the reordered order. Accordingly, the embodiments of the present disclosure describe a method for propagating (or storing) weight indexes by considering a case in which the weight candidate list is reordered.

[0257] According to an embodiment of the present invention, when determining the weight for weighted prediction of the current block based on the reordered weight candidate list, the index in the non-reordered weight candidate list may be stored for propagation to the next block.

[0258] When the weight index is signaled based on the reordered weight candidate list, a weight index different from the candidate order in the predefined weight candidate list (i.e., the weight candidate list before reordering) may be signaled. If stored as is, a problem may arise in which a block referring to a corresponding block may use a value other than a weight factor applied to the corresponding block.

[0259] Accordingly, separately from the signaled index, the index of the predefined weight candidate list (i.e., the weight candidate list before reordering) can be stored for propagation to the block decoded later. In addition, even when the weight index is derived, the index value before reordering can be stored to ensure that the index in the predefined weight candidate list can be propagated.

[0260] As an example, the weight index in this embodiment can be encoded based on the index of the candidate list predefined equally for the encoding device and the decoding device, rather than the reordered weight candidate list. In this case, the process of calculating the cost for each weight candidate belonging to the weight candidate list and the process of reordering the weight candidates of the weight candidate list based on the calculated cost can be omitted. The weight index can indicate any one of the multiple weight candidates belonging to the weight candidate list. The weight candidate indicated by the weight index can be configured as the weight of the current block.

[0261] Example 9

[0262] A method for applying an embodiment of the present disclosure to an inter prediction mode other than the prediction mode described above is described. As an example, the other inter prediction mode may include at least one of a geometric partition mode (GPM), a combined inter and intra prediction (CIIP) mode, or a GPM-Intra mode. Here, the GPM-Intra mode refers to a method in which a prediction block is generated by performing geometric partitioning in the same or similar method as GPM and applying inter prediction and intra prediction to the partitioned partitions, respectively.

[0263] Generally, weighted prediction is applied to bidirectional prediction blocks, but for the GPM mode, since unidirectional prediction is performed for each partition, the weight for weighted prediction is not considered. In other words, in the candidate configured for the GPM mode, for the GPM candidate, the weight for the weighted sum of the prediction block is configured as the default weight. However, according to an embodiment of the present disclosure, weighted prediction can be performed even when unidirectional weighted prediction is applied. Figure 7 Give a description.

[0264] Figure 7 is a flowchart illustrating a weighted prediction method based on a geometric partitioning mode according to an embodiment of the present disclosure.

[0265] refer to Figure 7 , when the GPM mode is applied, the decoding device may derive a weight index from the prediction candidate (S700). The decoding device may derive a weight index from the prediction candidate. In other words, the decoding device may inherit the weight index in the process of configuring the candidate list for the GPM mode.

[0266] The decoding device may determine whether the derived weight is a default value (S710). When the derived weight is not a default value, the derived weight may be applied to the prediction block of each partition to perform weighted prediction (S720 and S730), generating a final prediction block (S740).

[0267] When the derived weight is a default value, the decoding device may generate a final prediction block by averaging the prediction blocks of each partition (S750 and S760). Alternatively, when the derived weight is a default value, when weighted prediction based on GPM is possible, the decoding device may generate a final prediction block by applying a scaling factor and an offset based on a determined weight and combining the prediction blocks of each partition. As an example, the weight of each partition may be derived only when at least one of unidirectional weighted prediction, GPM, or GPM-Intra is applied to a neighboring block. In addition, as an example, for GPM-Intra, the same process may also be applied to perform inter-frame prediction.

[0268] In addition, generally, when CIIP is applied, weighted prediction may not be performed. Although the weight index is inherited in the inter-frame prediction process of CIIP, in the actual prediction sample generation process, an average prediction block may always be generated without considering the weight index. According to an embodiment of the present disclosure, weighted prediction may also be applied to CIIP to improve prediction performance. For a bidirectional prediction block, a final block may be generated by considering a weight index determined by a weight derivation process, and as described in the present disclosure, a weight index may also be derived and applied to a unidirectional prediction block.

[0269] Example 10

[0270] In an embodiment of the present disclosure, a method for propagating or storing weight indices derived and modified by GPM, CIIP, and GPM-Intra processes is described. When decoding the current block in GPM or GPM-Intra mode, a unidirectional weight index for each partition can be stored, and for a mixed area, a weight index for a specific partition can be stored.

[0271] As an example, the decoding device may store a weight index of a partition referring to a close reference picture based on a POC (Picture Order Count) difference between a current picture and a reference picture.

[0272] Alternatively, a weight index in which the weight indicated by the weight index has a value close to the default value may be stored. Here, when generating a prediction sample by applying the weight is expressed as (WxP)>>shift, if it is assumed that the shift is 4, the case in which W is 8 may be shown as the default value.

[0273] Alternatively, the decoding device may store weight indices of partitions occupying large areas of a block by considering the segmentation angle or shape of the GPM. A method for storing weight indices may be predefined according to the segmentation angle or shape of the GPM. For example, for an angle index > th, a weight index of a first partition may be stored, and otherwise, a weight index of a second partition may be stored. Here, th represents a threshold value of an angle index.

[0274] In addition, in an embodiment, even if the weight index and weighted prediction are not applied to the GPM and GPM-Intra modes, weights may be derived for propagation to the next block. Specifically, in the process of generating inter-frame prediction samples in the GPM and GPM-Intra modes, considering that a final prediction sample is generated by deriving a weight factor based on a distance from a boundary based on a partition boundary, a representative weight of a mixed region (i.e., a weighted sum region) may be mapped to a weight index and stored.

[0275] In addition, in an embodiment, the weight between two partitions of a mixed area can be derived as a representative value in units of 4x4 blocks. The candidate index in the weight candidate list that is most similar to the representative value is stored in units of each block. In this case, when it is not a mixed area, it can be stored as a default value.

[0276] In addition, in an embodiment, the weight between two partitions at the center position of the current block may be mapped to candidates in a weight candidate list and stored as a weight index without considering partition boundaries.

[0277] Figure 8 A schematic configuration of the inter-frame predictor 332 performing the inter-frame prediction method according to the present disclosure is shown.

[0278] refer to Figure 8 , the inter-frame predictor 332 may include an initial prediction block generation unit 800 , a weight determination unit 810 , and a final prediction block generation unit 820 .

[0279] The initial prediction block generation unit 800 may generate an initial prediction block. The initial prediction block generation unit 800 may generate a first prediction block of a current block based on a first prediction mode, and may generate a second prediction block of the current block based on a second prediction mode. In the present disclosure, the first prediction block and / or the second prediction block that are weighted and summed to generate a final prediction block may be referred to as an initial prediction block. In addition, in the present disclosure, the first prediction block and / or the second prediction block may be referred to as a reference block.

[0280] As an example, the first prediction mode may represent a prediction in the L0 direction, and the second prediction mode may represent a prediction in the L1 direction. In other words, the current block may be a bidirectional prediction block. Alternatively, as an example, the current block may be a unidirectional prediction block. Of course, when a general inter-frame prediction method such as a merge mode or AMVP is applied to the current block, the embodiments of the present disclosure may be applied, and in addition to this, various other inter-frame prediction methods may also be applied. As an example, the first prediction mode may be a merge mode, and the second prediction mode may be an AMVP mode.

[0281] Alternatively, as an example, the current block may be divided into a plurality of partitions based on a geometric partitioning mode, and the plurality of partitions may include a first partition and a second partition. In this case, the first prediction mode may represent a prediction using prediction information of the first partition, and the second prediction mode may represent a prediction using prediction information of the second partition. The prediction information of the first partition may be motion information of the first partition, or intra-frame prediction information of the first partition. Similarly, the prediction information of the second partition may be motion information of the second partition, or may be intra-frame prediction information of the second partition. In other words, an initial prediction block may be generated based on a GPM or GPM-Intra mode. The GPM-Intra mode represents a mode in which one GPM partition performs inter-frame prediction and another GPM partition performs intra-frame prediction. The initial prediction block may be generated by the prediction information of each GPM partition.

[0282] The weight determination unit 810 may determine the weight. The decoding device may determine the weight for the current block based on a weight candidate list including a plurality of predefined weight candidates. In this case, the weight may be applied Figures 4 to 7 The method for determining the weight applied to the current block based on the weight candidate list is described in Embodiments 1 to 10, and repeated description is omitted here.

[0283] The final prediction block generation unit 820 may generate a final prediction block based on the determined weight. The final prediction block generation unit 820 may generate a final prediction block by weighted summing the initial prediction blocks based on the determined weight. In other words, the decoding device may generate a third prediction block of the current block by weighted summing the first prediction block and the second prediction block.

[0284] Fig. 9 An inter-frame prediction method performed by the encoding apparatus 200 according to an embodiment of the present disclosure is illustrated.

[0285] refer to Fig. 9 , the encoding device may generate an initial prediction block (S900). The encoding device may generate a first prediction block of the current block based on the first prediction mode, and generate a second prediction block of the current block based on the second prediction mode. In the present disclosure, the first prediction block and / or the second prediction block that are weighted and summed to generate the final prediction block may be referred to as an initial prediction block. In addition, in the present disclosure, the first prediction block and / or the second prediction block may be referred to as a reference block.

[0286] As an example, the first prediction mode may represent a prediction in the L0 direction, and the second prediction mode may represent a prediction in the L1 direction. In other words, the current block may be a bidirectional prediction block. Alternatively, as an example, the current block may be a unidirectional prediction block. Of course, when a general inter-frame prediction method such as a merge mode or AMVP is applied to the current block, the embodiments of the present disclosure may be applied, and in addition to this, various other inter-frame prediction methods may also be applied. As an example, the first prediction mode may be a merge mode, and the second prediction mode may be an AMVP mode.

[0287] Alternatively, as an example, the current block may be divided into a plurality of partitions based on a geometric partitioning mode, and the plurality of partitions may include a first partition and a second partition. In this case, the first prediction mode may represent a prediction using prediction information of the first partition, and the second prediction mode may represent a prediction using prediction information of the second partition. The prediction information of the first partition may be motion information of the first partition, or may be intra-frame prediction information of the first partition. Similarly, the prediction information of the second partition may be motion information of the second partition, or may be intra-frame prediction information of the second partition. In other words, an initial prediction block may be generated based on a GPM or GPM-Intra mode. The GPM-Intra mode represents a mode in which one GPM partition performs inter-frame prediction and another GPM partition performs intra-frame prediction. The initial prediction block may be generated by the prediction information of each GPM partition.

[0288] The encoding device may determine a weight (S910). The encoding device may determine a weight for the current block based on a weight candidate list including a plurality of predefined weight candidates. In this case, the weight for the current block may be applied in substantially the same manner. Figures 4 to 7 The method for determining the weight applied to the current block based on the weight candidate list is described in Embodiments 1 to 10, and repeated description is omitted here.

[0289] Specifically, as described in Example 1, the method for calculating the cost of the candidates included in the weight candidate list and the method for reordering the weight candidate list based on the cost can be performed in the same manner in the encoding device and the decoding device. As described in Example 2, for the method for notifying the weight index or the weighted prediction flag with a signal according to a predefined condition, encoding can be performed in the same manner in the encoding device for the weight index or the weighted prediction flag according to the predefined condition. For Examples 3 to 10, the encoding device and the decoding device can store the weight candidate list in the same manner, determine the weight in units of blocks, and generate a prediction sample based on the determined weight.

[0290] The encoding device may generate a final prediction block based on the weight determined in S910 S920. The encoding device may generate a final prediction block by weighted summing the initial prediction blocks based on the determined weights. In other words, the encoding device may generate a third prediction block of the current block by weighted summing the first prediction block and the second prediction block.

[0291] Fig.10 A schematic configuration of the inter-frame predictor 221 performing the inter-frame prediction method according to the present disclosure is shown.

[0292] refer to Fig.10 , the inter-frame predictor 221 may include an initial prediction block generating unit 1000 , a weight determining unit 1010 , and a final prediction block generating unit 1020 .

[0293] refer to Fig.10 , the initial prediction block generation unit 1000 may generate an initial prediction block. The initial prediction block generation unit 1000 may generate a first prediction block of a current block based on a first prediction mode, and may generate a second prediction block of the current block based on a second prediction mode. In the present disclosure, the first prediction block and / or the second prediction block that are weighted and summed to generate a final prediction block may be referred to as an initial prediction block. In addition, in the present disclosure, the first prediction block and / or the second prediction block may be referred to as a reference block.

[0294] As an example, the first prediction mode may represent a prediction in the L0 direction, and the second prediction mode may represent a prediction in the L1 direction. In other words, the current block may be a bidirectional prediction block. Alternatively, as an example, the current block may be a unidirectional prediction block. Of course, when a general inter-frame prediction method such as a merge mode or AMVP is applied to the current block, the embodiments of the present disclosure may be applied, and in addition to this, various other inter-frame prediction methods may also be applied. As an example, the first prediction mode may be a merge mode, and the second prediction mode may be an AMVP mode.

[0295] Alternatively, as an example, the current block may be divided into a plurality of partitions based on a geometric partitioning mode, and the plurality of partitions may include a first partition and a second partition. In this case, the first prediction mode may represent a prediction using prediction information of the first partition, and the second prediction mode may represent a prediction using prediction information of the second partition. The prediction information of the first partition may be motion information of the first partition, or may be intra-frame prediction information of the first partition. Similarly, the prediction information of the second partition may be motion information of the second partition, or may be intra-frame prediction information of the second partition. In other words, an initial prediction block may be generated based on a GPM or GPM-Intra mode. The GPM-Intra mode represents a mode in which one GPM partition performs inter-frame prediction and another GPM partition performs intra-frame prediction. The initial prediction block may be generated by the prediction information of each GPM partition.

[0296] The weight determination unit 1010 may determine the weight. The weight determination unit 1010 may determine the weight for the current block based on a weight candidate list including a plurality of predefined weight candidates. In this case, the weight for the current block may be applied in substantially the same manner. Figures 4 to 8 The method for determining the weight applied to the current block based on the weight candidate list is described in Embodiments 1 to 10, and repeated description is omitted here.

[0297] Specifically, as described in Example 1, the method for calculating the cost of the candidates included in the weight candidate list and the method for reordering the weight candidate list based on the cost can be performed in the same manner in the encoding device and the decoding device. As described in Example 2, for the method for notifying the weight index or the weighted prediction flag with a signal according to a predefined condition, the weight index or the weighted prediction flag can be encoded in the same manner according to the predefined condition in the encoding device. For Examples 3 to 10, the encoding device and the decoding device can store the weight candidate list in the same manner, determine the weight in units of blocks, and generate a prediction sample based on the determined weight.

[0298] The final prediction block generation unit 1020 may generate a final prediction block based on the determined weight. The final prediction block generation unit 1020 may generate a final prediction block by weighted summing the initial prediction blocks based on the determined weight. In other words, the final prediction block generation unit 1020 may generate a third prediction block of the current block by weighted summing the first prediction block and the second prediction block.

[0299] In the above embodiments, the method is described as a series of steps or boxes based on the flowchart, but the corresponding embodiments are not limited to the order of the steps, and some steps may occur simultaneously or in a different order than other steps described above. In addition, those skilled in the art will appreciate that the steps shown 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 the present disclosure.

[0300] The above method according to an embodiment of the present disclosure can be implemented in the form of software, and the encoding device and / or decoding device according to the present disclosure can be included in a device that performs image processing, such as a TV, a computer, a smart phone, a set-top box, a display device, etc.

[0301] In the present disclosure, when the embodiment is implemented as software, the above method can be implemented as a module (process, function, etc.) that performs the above functions. The module can be stored in a memory and can be executed by a processor. The memory can be located inside or outside the processor and can be connected to the processor by various well-known means. The processor may include an application-specific integrated circuit (ASIC), another chipset, a logic circuit, and / or a data processing device. The memory may include a read-only memory (ROM), a random access memory (RAM), a flash memory, a memory card, a storage medium, and / or other storage devices. In other words, the embodiments described herein can be implemented on a processor, a microprocessor, a controller, or a chip. For example, the functional unit shown in each of the figures can be implemented on a computer, a processor, a microprocessor, a controller, or a chip. In this case, information (e.g., information about instructions) or an algorithm for implementation can be stored in a digital storage medium.

[0302] In addition, the decoding device and the encoding device of the embodiment of the present disclosure can be included in multimedia broadcast sending and receiving devices, mobile communication terminals, home theater video devices, digital theater video devices, surveillance cameras, video conversation devices, real-time communication devices such as video communication, mobile streaming devices, storage media, cameras, devices for providing video on demand (VoD) services, over-the-top video (OTT) devices, devices for providing Internet streaming services, three-dimensional (3D) video devices, virtual reality (VR) devices, augmented reality (AR) devices, videophone video devices, transportation terminals (e.g., vehicle (including autonomous driving vehicle) terminals, aircraft terminals, ship terminals, etc.) and medical video devices, etc., and can be used to process video signals or data signals. For example, over-the-top video (OTT) devices can include game consoles, Blu-ray players, networked TVs, home theater systems, smart phones, tablet computers, digital video recorders (DVRs), etc.

[0303] In addition, the processing method of the embodiment of the present disclosure can be generated in the form of a program executed by a computer and can be stored in a computer-readable recording medium. Multimedia data having a data structure according to an embodiment of the present disclosure can also be stored in a computer-readable recording medium. Computer-readable recording media include all types of storage devices and distributed storage devices that store computer-readable data. Computer-readable recording media may include, for example, Blu-ray discs (BD), universal serial buses (USB), ROMs, PROMs, EPROMs, EEPROMs, RAMs, CD-ROMs, tapes, floppy disks, and optical media storage devices. In addition, computer-readable recording media include media implemented in the form of carrier waves (e.g., transmitted via the Internet). In addition, the bit stream generated by the encoding method may be stored in a computer-readable recording medium or may be sent via a wired or wireless communication network.

[0304] In addition, the embodiments of the present disclosure may be implemented by a computer program product through a 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.

[0305] Fig.11 An example of a content streaming system to which an embodiment of the present disclosure can be applied is shown.

[0306] refer to Fig.11 The content streaming transmission system to which the embodiments of the present disclosure are applied may mainly include an encoding server, a streaming transmission server, a web server, a media storage, a user device, and a multimedia input device.

[0307] The encoding server generates a bitstream by compressing content input from a multimedia input device such as a smartphone, a camera, a camcorder, etc. into digital data and transmits it to the streaming server. As another example, when a multimedia input device such as a smartphone, a camera, a camcorder, etc. directly generates a bitstream, the encoding server may be omitted.

[0308] A bitstream may be generated by applying the encoding method or the bitstream generating method of the embodiment of the present disclosure, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0309] The streaming server sends multimedia data to the user device through the web server based on the user's request, and the web server serves as a medium to inform the user what services are available. When the user requests the required service from the web server, the web server delivers it to the streaming server, and the streaming server sends the multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server controls the command / response between each device in the content streaming system.

[0310] The streaming server may receive content from a media storage and / or encoding server. For example, when receiving content from an encoding server, the content may be received in real time. In this case, in order to provide a smooth streaming service, the streaming server may store the bitstream for a certain period of time.

[0311] Examples of user devices may include mobile phones, smart phones, laptop computers, digital broadcast terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation, tablet PCs, tablet computers, ultrabooks, wearable devices (e.g., smart watches, smart glasses, head-mounted displays (HMDs), digital televisions, desktops, digital signage, etc.).

[0312] Each server in the content streaming system may be operated as a distributed server, and in this case, data received from each server may be distributed and processed.

[0313] The claims set forth herein can be combined in various ways. For example, the technical features of the method claims of the present disclosure can be combined and implemented as a device, and the technical features of the device claims of the present disclosure can be combined and implemented as a method. In addition, the technical features of the method claims of the present disclosure and the technical features of the device claims can be combined and implemented as a device, and the technical features of the method claims of the present disclosure and the technical features of the device claims can be combined and implemented as a method.

Claims

1. An image decoding method, the method comprising: Generate a first prediction block of the current block based on the first prediction mode, and generate a second prediction block of the current block based on the second prediction mode; determining a weight for the current block based on a weight candidate list including a plurality of predefined weight candidates; as well as Based on the determined weight, a third prediction block of the current block is generated by weighted summing the first prediction block and the second prediction block.

2. The method according to claim 1, wherein: The first prediction mode represents prediction in the L0 direction, and the second prediction mode represents prediction in the L1 direction.

3. The method according to claim 1, wherein: Determining the weight includes calculating the sum of absolute differences (SDA) values ​​corresponding to the plurality of weight candidates respectively, The SAD value is calculated based on a reference template area and a template area of ​​the current block, The reference template region is derived by weighted summing the template region of the L0 reference block and the template region of the L1 reference block based on the weight candidate.

4. The method according to claim 3, wherein: By reordering the plurality of weight candidates in ascending order of the SAD values, a reordered weight candidate list is generated, The weight for the current block is determined from the reordered weight candidate list.

5. The method according to claim 3, wherein: The method further includes acquiring, from a bitstream, a flag indicating whether weighted prediction is performed on the current block.

6. The method according to claim 5, wherein: When the flag indicates that the weighted prediction is performed for the current block, the weight for the current block is determined based on a weight candidate having a minimum SAD value among the SAD values.

7. The method according to claim 5, wherein: When the flag indicates that the weighted prediction is not performed for the current block, the weight applied to the first prediction block and the weight applied to the second prediction block are determined to be the same value.

8. The method according to claim 3, wherein: The method further includes determining whether weighted prediction is available for the current block based on a predefined condition.

9. The method according to claim 8, wherein: When the weighted prediction is available for the current block, the weight for the current block is determined based on a weight candidate having a minimum SAD value among the SAD values.

10. The method according to claim 8, wherein: When the weighted prediction is not available for the current block, a weight applied to the first prediction block and a weight applied to the second prediction block are determined to be the same value.

11. The method according to claim 1, wherein: The weight candidate list is configured based on an inter prediction mode of the current block, whether bidirectional prediction is applied, or a size of the current block.

12. The method of claim 1, wherein: Based on the geometric partitioning mode, the current block is divided into multiple partitions, The plurality of partitions include a first partition and a second partition, The first prediction mode represents prediction using prediction information of the first partition, and the second prediction mode represents prediction using prediction information of the second partition.

13. A method for image encoding, the method comprising: generating a first prediction block of the current block based on the first prediction mode, and generating a second prediction block of the current block based on the second prediction mode, determining a weight for the current block based on a weight candidate list including a plurality of predefined weight candidates; as well as Based on the determined weight, a third prediction block of the current block is generated by weighted summing the first prediction block and the second prediction block.

14. A computer-readable storage medium storing a bit stream generated by the image encoding method according to claim 13.

15. A method for transmitting data of image information, the method comprising: generating a first prediction block of the current block based on the first prediction mode, and generating a second prediction block of the current block based on the second prediction mode, determining a weight for the current block based on a weight candidate list including a plurality of predefined weight candidates; Based on the determined weight, generating the third prediction block of the current block by weighted summing the first prediction block and the second prediction block; Based on the third prediction block, generating a bitstream by encoding the current block; as well as Data including the bit stream is transmitted.