Image encoding / decoding method and apparatus based on illumination compensation, and recording medium storing bit stream

By adopting a lighting compensation-based method in image encoding/decoding, the problem of low image encoding/decoding efficiency in the prior art is solved, and more efficient image processing is achieved and storage and transmission costs are reduced.

CN119732053APending Publication Date: 2025-03-28LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380059623.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-07-05
Filing Date
2023-06-30
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The prior art is difficult to effectively improve image encoding/decoding efficiency, especially when processing high-resolution and high-quality images, the transmission and storage costs are high.

Method used

Using an image encoding/decoding method based on lighting compensation, by obtaining lighting compensation information, derive lighting compensation parameters, and applying lighting compensation to adjacent areas of the reference block, the lighting compensation candidate mode is reordered to determine the optimal mode.

Benefits of technology

Improves image encoding/decoding efficiency, reduces transmission and storage costs, and supports lighting compensation when the prediction mode is in a merged mode.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119732053A_ABST
    Figure CN119732053A_ABST
Patent Text Reader

Abstract

Provided are an image encoding / decoding method and apparatus. An image decoding method according to the present disclosure comprises the steps of: obtaining information on illumination compensation for a current block; deriving a lighting compensation parameter for each of the two or more lighting compensation candidate modes of lighting compensation; obtaining an illumination compensated first adjacent region by applying illumination compensation to a predetermined first adjacent region adjacent to a reference block of the current block based on the illumination compensation parameter; obtaining a final error value for each illumination compensation candidate mode based on an error of a sample value in the illumination-compensated first adjacent region and a sample value in a predetermined second adjacent region adjacent to the current block; rearranging the illumination compensation candidate modes based on the final error value; and determining an illumination compensation candidate mode for the current block based on the rearranged illumination compensation candidate mode and information on illumination compensation, where the first adjacent region and the second adjacent region may be located at corresponding positions.
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 device and a recording medium storing a bit stream, and more particularly, to an image encoding and decoding method and device based on illumination compensation and a recording medium storing a bit stream generated by the image encoding method / device of the present disclosure. Background Art

[0002] Recently, the demand for high-resolution and high-quality images, such as high-definition (HD) images and ultra-high-definition (UHD) images, is increasing in various fields. As the resolution and quality of image data are improved, the amount of information or bit volume transmitted is relatively increased compared to existing image data. The increase in the amount of information or bit volume transmitted leads to an increase in transmission cost and storage cost.

[0003] Therefore, efficient image compression technology is needed to effectively transmit, store, and reproduce information about high-resolution and high-quality images. Summary of the invention

[0004] Technical issues

[0005] An object of the present disclosure is to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.

[0006] In addition, an object of the present disclosure is to provide an image encoding / decoding method and apparatus for performing illumination compensation.

[0007] In addition, an object of the present disclosure is to provide an image encoding / decoding method and apparatus for reordering illumination compensation candidates based on a template cost when performing illumination compensation.

[0008] In addition, an object of the present disclosure is to provide an image encoding / decoding method and apparatus that performs illumination compensation when a prediction mode is a merge mode.

[0009] In addition, an object of the present disclosure is to provide a non-transitory computer-readable recording medium storing a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0010] In addition, an object of the present disclosure is to provide a non-transitory computer-readable recording medium storing a bit stream received and decoded by the image decoding device according to the present disclosure and used to reconstruct an image.

[0011] In addition, an object of the present disclosure is to provide a method of transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure.

[0012] The technical problems solved by the present disclosure are not limited to the above-mentioned technical problems, and other technical problems not described here will be clear to those skilled in the art through the following description.

[0013] Technical Solution

[0014] According to an embodiment of the present disclosure, an image decoding method performed by an image decoding device may include the following steps: obtaining information about illumination compensation of a current block; deriving an illumination compensation parameter for each of two or more illumination compensation candidate modes of illumination compensation; obtaining an illumination-compensated first adjacent region by applying illumination compensation to a predetermined first adjacent region adjacent to a reference block of the current block based on the illumination compensation parameter; obtaining a final error value for each illumination compensation candidate mode based on an error between a sample value in the illumination-compensated first adjacent region and a sample value in a predetermined second adjacent region adjacent to the current block; reordering the illumination compensation candidate modes based on the final error value; and determining an illumination compensation candidate mode for the current block based on the reordered illumination compensation candidate modes and the information about illumination compensation. The first adjacent region and the second adjacent region may be in corresponding positions.

[0015] According to an embodiment of the present disclosure, the information about illumination compensation may include at least one of information indicating whether illumination compensation can be performed on the current block, information indicating whether illumination compensation is applied to the current block, or an index indicating one of illumination compensation candidate modes.

[0016] According to an embodiment of the present disclosure, the illumination compensation candidate mode may include at least one of a first mode using both the left neighboring area and the upper neighboring area of ​​the current block and the reference block, a second mode using only the left neighboring area of ​​the current block and the reference block, or a third mode using only the upper neighboring area of ​​the current block and the reference block.

[0017] According to an embodiment of the present disclosure, reordering may mean sorting the final error values ​​in ascending order.

[0018] According to an embodiment of the present disclosure, based on the prediction mode of the current block being the merge mode, information about illumination compensation may be obtained from information about illumination compensation of a selected merge candidate of the current block.

[0019] According to an embodiment of the present disclosure, information on illumination compensation of a selected merge candidate of a current block may be obtained based on at least one of a size, a prediction type, a partition type, or a transform type of the current block.

[0020] According to an embodiment of the present disclosure, information indicating whether illumination compensation is applied to the current block may be obtained based on a first error value and a final error value for an illumination compensation candidate mode calculated based on a first neighboring area and a second neighboring area before illumination compensation.

[0021] According to an embodiment of the present disclosure, the acquisition of information indicating whether illumination compensation is applied to the current block may be further determined based on a threshold.

[0022] According to an embodiment of the present disclosure, obtaining the information indicating whether illumination compensation is applied to the current block may be performed by comparing a difference between the final error value and the first error value with a threshold value.

[0023] According to an embodiment of the present disclosure, an image encoding method performed by an image encoding device may include the following steps: encoding information about illumination compensation of a current block; deriving illumination compensation parameters for each of two or more illumination compensation candidate modes for illumination compensation; obtaining an illumination-compensated first adjacent region by applying illumination compensation to a predetermined first adjacent region adjacent to a reference block of the current block based on the illumination compensation parameters for each illumination compensation candidate mode; obtaining a final error value for each illumination compensation candidate mode based on an error between a sample value in the illumination-compensated first adjacent region and a sample value in a predetermined second adjacent region adjacent to the current block; reordering the illumination compensation candidate modes based on the final error values ​​for each illumination compensation candidate mode; and determining an illumination compensation candidate mode for the current block based on the reordered illumination compensation candidate modes and the information about illumination compensation. The first adjacent region and the second adjacent region may be in corresponding positions.

[0024] According to an embodiment of the present disclosure, in a method for transmitting a bitstream generated by an image encoding method, the image encoding method may include the following steps: encoding information about illumination compensation of a current block; deriving illumination compensation parameters for each of two or more illumination compensation candidate modes for illumination compensation; obtaining an illumination-compensated first adjacent region by applying illumination compensation to a predetermined first adjacent region adjacent to a reference block of the current block based on the illumination compensation parameters for each illumination compensation candidate mode; obtaining a final error value for each illumination compensation candidate mode based on an error between a sample value in the illumination-compensated first adjacent region and a sample value in a predetermined second adjacent region adjacent to the current block; reordering the illumination compensation candidate modes based on the final error values ​​for each illumination compensation candidate mode; and determining an illumination compensation candidate mode for the current block based on the reordered illumination compensation candidate modes and the information about illumination compensation. The first adjacent region and the second adjacent region may be in corresponding positions.

[0025] Beneficial Effects

[0026] According to the present disclosure, an image encoding / decoding method and apparatus with improved encoding / decoding efficiency may be provided.

[0027] According to the present disclosure, an image encoding / decoding method and apparatus for performing illumination compensation may be provided.

[0028] According to the present disclosure, an image encoding / decoding method and apparatus for reordering illumination compensation candidates based on a template cost when performing illumination compensation may be provided.

[0029] According to the present disclosure, an image encoding / decoding method and apparatus for performing illumination compensation when a prediction mode is a merge mode may be provided.

[0030] In addition, according to the present disclosure, a non-transitory computer-readable recording medium storing a bit stream generated by the image encoding method or apparatus according to the present disclosure may be provided.

[0031] In addition, according to the present disclosure, there may be provided a non-transitory computer-readable recording medium storing a bit stream received and decoded by the image decoding apparatus according to the present disclosure and used to reconstruct an image.

[0032] In addition, according to the present disclosure, a method of transmitting a bit stream generated by the image encoding method or apparatus according to the present disclosure may be provided.

[0033] Those skilled in the art will understand that the effects that can be achieved through the present disclosure are not limited to what has been specifically described above, and other advantages of the present disclosure will be more clearly understood from the detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 FIG. 4 is a diagram schematically illustrating a video encoding system to which an embodiment of the present disclosure is applicable.

[0035] Figure 2 is a view schematically illustrating an image encoding device to which an embodiment of the present disclosure is applicable.

[0036] Figure 3 is a view schematically illustrating an image decoding device to which an embodiment of the present disclosure is applicable.

[0037] Figure 4 is a diagram schematically showing an inter-frame prediction unit of an image encoding device.

[0038] Figure 5 is a flowchart illustrating a method for encoding an image based on inter-frame prediction.

[0039] Figure 6 is a diagram schematically showing an inter-frame prediction unit of an image decoding device.

[0040] Figure 7 is a flowchart illustrating a method of decoding an image based on inter-frame prediction.

[0041] Figure 8 is a flowchart illustrating an inter-frame prediction method.

[0042] Fig. 9 is a flowchart illustrating an image encoding method according to an embodiment of the present disclosure.

[0043] Fig.10 is a flowchart illustrating an image decoding method according to an embodiment of the present disclosure.

[0044] Fig.11 is a diagram illustrating locations of sample rows within a reference area for deriving illumination compensation parameters according to an embodiment of the present disclosure.

[0045] Fig.12 is a diagram illustrating candidate modes of illumination compensation according to an embodiment of the present disclosure.

[0046] Fig.13 is a flowchart illustrating a method of reordering illumination compensation candidate modes according to an embodiment of the present disclosure.

[0047] Fig.14 is a diagram illustrating template positions for template cost calculation according to an embodiment of the present disclosure.

[0048] Fig.15 is a flowchart illustrating a method of applying adaptive lighting compensation according to an embodiment of the present disclosure.

[0049] Fig.16 is a flowchart illustrating a method for reordering an illumination compensation list in an image encoding device according to an embodiment of the present disclosure.

[0050] Fig.17 is a flowchart illustrating a method for reordering an illumination compensation list in an image decoding device according to an embodiment of the present disclosure.

[0051] Fig.18 is a diagram illustrating a content streaming system to which an embodiment of the present disclosure is applicable. DETAILED DESCRIPTION

[0052] Hereinafter, the embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to facilitate implementation by those skilled in the art. However, the present disclosure can be implemented in various forms and is not limited to the embodiments described herein.

[0053] When describing the present disclosure, if it is determined that the detailed description of related known functions or configurations makes the scope of the present disclosure unnecessarily ambiguous, the detailed description thereof will be omitted. In the drawings, parts irrelevant to the description of the present disclosure are omitted, and like reference numerals are given to like parts.

[0054] In the present disclosure, when a component is "connected", "coupled" or "linked" to another component, it may include not only a direct connection relationship but also an indirect connection relationship with intermediate components. In addition, when a component "includes" or "has" other components, unless otherwise specified, it means that other components may also be included, rather than excluding other components.

[0055] In the present disclosure, the terms first, second, etc. are used only for the purpose of distinguishing one component from other components, and do not limit the order or importance of the components unless otherwise specified. Accordingly, within the scope of the present disclosure, a first component in one embodiment may be referred to as a second component in another embodiment, and similarly, a second component in one embodiment may be referred to as a first component in another embodiment.

[0056] In the present disclosure, components that are distinguished from each other are intended to clearly describe each feature and do not mean that the components must be separated. That is, multiple components can be integrated and implemented in one hardware or software unit, or one component can be distributed and implemented in multiple hardware or software units. Therefore, even if not specifically stated, implementations in which these components are integrated or distributed are also included in the scope of the present disclosure.

[0057] In the present disclosure, the components described in each embodiment are not necessarily indispensable components, and some components may be optional components. Therefore, the embodiments consisting of a subset of the components described in the embodiments are also included in the scope of the present disclosure. In addition, the embodiments including other components in addition to the components described in the various embodiments are included in the scope of the present disclosure.

[0058] The present disclosure relates to encoding and decoding of images. Unless otherwise defined in the present disclosure, terms used in the present disclosure may have general meanings commonly used in the technical field to which the present disclosure belongs.

[0059] In this disclosure, "video" may mean a collection of images over time.

[0060] In the present disclosure, a "picture" generally refers to a unit representing an image within a specific time period, and a slice / tile is a coding unit constituting a part of a picture, and a picture may be composed of one or more slices / tiles. In addition, a slice / tile may include one or more coding tree units (CTUs).

[0061] In the present disclosure, "pixel" or "pel" 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, or may represent only a pixel / pixel value of a luminance component or only a pixel / pixel value of a chrominance component.

[0062] In the present disclosure, a "unit" may refer to a basic unit of image processing. The unit may include at least one of a specific area of ​​a picture and information related to the area. In some cases, the unit may be used interchangeably with terms such as "sample array", "block" or "area". In general, an M×N block may include M columns and N rows of samples (or sample arrays) or a set (or array) of transform coefficients.

[0063] In the present disclosure, "current block" may mean one of "current coding block", "current coding unit", "coding target block", "decoding target block" or "processing target block". When prediction is performed, "current block" may mean "current prediction block" or "prediction target block". When transform (inverse transform) / quantization (dequantization) is performed, "current block" may mean "current transform block" or "transform target block". When filtering is performed, "current block" may mean "filtering target block".

[0064] In addition, in the present disclosure, unless explicitly stated as a chroma block, a "current block" may mean a block including both a luma component block and a chroma component block or a "luma block of the current block". The luma component block of the current block may be represented by an explicit description including a luma component block such as "luma block" or "current luma block". In addition, a "chroma component block of the current block" may be represented by an explicit description including a chroma component block such as "chroma block" or "current chroma block".

[0065] In the present disclosure, the term " / " or "," may be interpreted as indicating "and / or". For example, "A / B" and "A, B" may mean "A and / or B". In addition, "A / B / C" and "A / B / C" may mean "at least one of A, B, and / or C".

[0066] In the present disclosure, the term "or" should be interpreted to indicate "and / or". For example, the expression "A or B" may include 1) only "A", 2) only "B", or 3) both "A and B". In other words, in the present disclosure, "or" should be interpreted to indicate "additionally or alternatively".

[0067] In the present disclosure, "at least one of A, B, and C" may mean "only A", "only B", "only C", or "any and all combinations 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 mean "at least one of A, B, and C".

[0068] The brackets used in the present disclosure may mean "for example". For example, if "prediction (intra-frame prediction)" is indicated, "intra-frame prediction" may be proposed as an example of "prediction". In other words, "prediction" in the present disclosure is not limited to "intra-frame prediction", and "intra-frame prediction" may be proposed as an example of "prediction". In addition, even when "prediction (i.e., intra-frame prediction)" is indicated, "intra-frame prediction" may be proposed as an example of "prediction".

[0069] Overview of Video Coding Systems

[0070] Figure 1 is a diagram showing a video encoding system to which an embodiment of the present disclosure is applicable.

[0071] The video encoding system according to the embodiment may include an encoding device 10 and a decoding device 20. The encoding device 10 may deliver the encoded video and / or image information or data to the decoding device 20 via a digital storage medium or a network in the form of a file or a stream.

[0072] The encoding device 10 according to the embodiment may include a video source generator 11, an encoding unit (encoder) 12, and a transmitter 13. The decoding device 20 according to the embodiment may include a receiver 21, a decoding unit (decoder) 22, and a renderer 23. The encoding unit 12 may be referred to as a video / image encoding device, and the decoding unit 22 may be referred to as a video / image decoding device. The transmitter 13 may be included in the encoding unit 12. The receiver 21 may be included in the decoding unit 22. The renderer 23 may include a display and the display may be configured as a separate device or an external component.

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

[0074] The encoding unit 12 may encode the input video / image. For compression and encoding efficiency, the encoding unit 12 may perform a series of processes such as prediction, transformation, and quantization. The encoding unit 12 may output encoded data (encoded video / image information) in the form of a bitstream.

[0075] The transmitter 13 can obtain the coded video / image information or data output in the form of a bit stream in the form of a file or stream through a digital storage medium or a network and forward it to the receiver 21 of the decoding device 20 or another external object. The digital storage medium may include various storage media, such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitter 13 may include an element for generating a media file in a predetermined file format and may include an element for transmitting through a broadcast / communication network. The transmitter 13 may be provided as a transmitting device separated from the encoding device 10, and in this case, the transmitting device may include at least one processor that obtains the coded video / image information or data output in the form of a bit stream and a transmitting unit that transmits it in the form of a file or stream. The receiver 21 may extract / receive the bit stream from the storage medium or the network and transmit the bit stream to the decoding unit 22.

[0076] The decoding unit 22 may decode a video / image by performing a series of processes corresponding to the operations of the encoding unit 12, such as dequantization, inverse transformation, and prediction.

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

[0078] Overview of Image Coding Equipment

[0079] Figure 2 is a view schematically showing an image encoding device to which an embodiment of the present disclosure is applicable.

[0080] like Figure 2 As shown, the image encoding device 100 may include an image segmenter 110, a subtractor 115, a transformer 120, a quantizer 130, a dequantizer 140, an inverse transformer 150, an adder 155, a filter 160, a memory 170, an inter-frame prediction unit 180, an intra-frame prediction unit 185, and an entropy encoder 190. The inter-frame prediction unit 180 and the intra-frame prediction unit 185 may be collectively referred to as a "prediction unit". The transformer 120, the quantizer 130, the dequantizer 140, and the inverse transformer 150 may be included in a residual processor. The residual processor may also include a subtractor 115.

[0081] In some embodiments, all or at least some of the components configuring the image encoding apparatus 100 may be configured by one hardware component (eg, an encoder or a processor). In addition, the memory 170 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium.

[0082] The image segmenter 110 may segment the input image (or picture or frame) input to the image encoding device 100 into one or more processing units. For example, the processing unit may be referred to as a coding unit (CU). The coding unit may be obtained by recursively segmenting a coding tree unit (CTU) or a maximum coding unit (LCU) according to a quadtree binary tree ternary tree (QT / BT / TT) structure. For example, a coding unit may be segmented into a plurality of coding units of a deeper depth based on a quadtree structure, a binary tree structure, and / or a ternary tree structure. For the segmentation of the coding unit, the quadtree structure may be applied first, and then the binary tree structure and / or the ternary tree structure may be applied. The encoding process according to the present disclosure may be performed based on the final coding unit that is no longer segmented. The maximum coding unit may be used as the final coding unit, and the coding unit of a deeper depth obtained by segmenting the maximum coding unit may also be used as the final coding unit. Here, the encoding process may include the prediction, transformation, and reconstruction processes described later. As another example, the processing unit of the encoding process may be a prediction unit (PU) or a transformation unit (TU). The prediction unit and the transform unit may be divided or partitioned from the final coding unit. The prediction unit may be a sample prediction unit, 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.

[0083] The prediction unit (inter prediction unit 180 or intra prediction unit 185) may perform prediction on the block to be processed (current block) and generate a prediction block including prediction samples of the current block. The prediction unit may determine whether to apply intra prediction or inter prediction based on the current block or CU. The prediction unit may generate various information related to the prediction of the current block and transmit the generated information to the entropy encoder 190. The information about the prediction may be encoded in the entropy encoder 190 and output in the form of a bitstream.

[0084] The intra prediction unit (intra predictor) 185 can predict the current block by referring to the samples in the current picture. Depending on the intra prediction mode and / or intra prediction technology, the reference samples can be located in the neighbors of the current block or can be placed separately. The intra prediction mode may include multiple non-directional modes and multiple directional modes. The non-directional mode may include, for example, a DC mode and a plane mode. Depending on the level of detail of the prediction direction, the directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes. However, this is only an example, and more or fewer directional prediction modes may be used according to the settings. The intra prediction unit 185 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0085] The inter prediction unit (inter predictor) 180 may derive a prediction block of 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 transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter prediction direction (L0 prediction, L1 prediction, dual prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be referred to as a collocated reference block, a collocated CU (colCU), etc. The reference picture including the temporal neighboring block may be referred to as a collocated picture (colPic). For example, the inter prediction unit 180 may construct a motion information candidate list based on the neighboring blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the inter prediction unit 180 may use the motion information of the neighboring block as the motion information of the current block. In the case of skip mode, unlike the merge mode, the residual signal may not be transmitted. In the case of motion vector prediction (MVP) mode, the motion vector of the neighboring block may be used as a motion vector predictor, and the motion vector of the current block may be signaled by encoding the motion vector difference and an indicator of the motion vector predictor. The motion vector difference may mean the difference between the motion vector of the current block and the motion vector predictor.

[0086] The prediction unit may generate a prediction signal based on various prediction methods and prediction techniques described below. For example, the prediction unit may not only apply intra prediction or inter prediction, but may also apply intra prediction and inter prediction simultaneously to predict the current block. The prediction method of applying both intra prediction and inter prediction simultaneously to predict the current block may be referred to as combined inter and intra prediction (CIIP). In addition, the prediction unit may perform intra block copying (IBC) to predict the current block. Intra block copying may be used for content image / video encoding of games, etc., such as screen content coding (SCC). IBC is a method of predicting the current picture using a previously reconstructed reference block in the current picture at a position separated by a predetermined distance from the current block. When IBC is applied, the position of the reference block in the current picture may be encoded as a vector (block vector) corresponding to a predetermined distance. IBC basically performs prediction in the current picture, but may be performed similarly to inter prediction because the reference block is derived within the current picture. That is, IBC may use at least one inter prediction technique described in the present disclosure.

[0087] The prediction signal generated by the prediction unit can be used to generate a reconstruction signal or to generate a residual signal. The subtractor 115 can generate a residual signal (residual block or residual sample array) by subtracting the prediction signal (prediction block or prediction sample array) output from the prediction unit from the input image signal (original block or original sample array). The generated residual signal can be transmitted to the transformer 120.

[0088] The transformer 120 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 represented by a graph. CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to square pixel blocks of the same size or may be applied to blocks of variable size instead of square.

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

[0090] The entropy encoder 190 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 190 may encode information required for video / image reconstruction other than quantized transform coefficients together or separately (e.g., values ​​of syntax elements, etc.). The encoded information (e.g., encoded video / image information) may be transmitted or stored in units of a network abstraction layer (NAL) in the form of a bitstream. The video / image information may also 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 also include general constraint information. The signaled information, transmitted information, and / or syntax elements described in the present disclosure may be encoded and included in a bitstream through the above-described encoding process.

[0091] The bitstream may be transmitted over a network or may be stored in a digital storage medium. The network may include a broadcast network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitter (not shown) for transmitting a signal output from the entropy encoder 190 and / or a storage unit (not shown) for storing the signal may be included as an internal / external element of the image encoding device 100. Alternatively, a transmitter may be provided as a component of the entropy encoder 190.

[0092] The quantized transform coefficients output from the quantizer 130 may be used to generate a residual signal. For example, the residual signal (residual block or residual sample) may be reconstructed by applying dequantization and inverse transformation to the quantized transform coefficients through the dequantizer 140 and the inverse transformer 150.

[0093] The adder 155 adds the reconstructed residual signal to the prediction signal output from the inter-frame prediction unit 180 or the intra-frame prediction unit 185 to generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array). If the block to be processed has no residual, such as when the skip mode is applied, the prediction block can be used as a reconstructed block. The adder 155 can be called 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 be used for inter-frame prediction of the next picture by filtering as described below.

[0094] Furthermore, luminance mapping with chroma scaling (LMCS) is applied during picture coding and / or reconstruction.

[0095] The filter 160 can improve the subjective / objective image quality by applying filtering to the reconstructed signal. For example, the filter 160 can generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture, and store the modified reconstructed picture in the memory 170, specifically, in the DPB of the memory 170. Various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filtering, bilateral filtering, etc. The filter 160 can generate various information related to filtering and transmit the generated information to the entropy encoder 190, as described later in the description of each filtering method. The information related to filtering can be encoded by the entropy encoder 190 and output in the form of a bit stream.

[0096] The modified reconstructed picture transferred to the memory 170 may be used as a reference picture in the inter prediction unit 180. When inter prediction is applied by the image encoding apparatus 100, prediction mismatch between the image encoding apparatus 100 and the image decoding apparatus may be avoided and encoding efficiency may be improved.

[0097] The DPB of the memory 170 may store the modified reconstructed picture for use as a reference picture in the inter-frame prediction unit 180. The memory 170 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 reconstructed block in the picture. The stored motion information may be transmitted to the inter-frame prediction unit 180 and used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 170 may store the reconstructed samples of the reconstructed blocks in the current picture and may transmit the reconstructed samples to the intra-frame prediction unit 185.

[0098] Overview of Image Decoding Equipment

[0099] Figure 3 is a view schematically showing an image decoding device to which an embodiment of the present disclosure is applicable.

[0100] like Figure 3 As shown, the image decoding device 200 may include an entropy decoder 210, a dequantizer 220, an inverse transformer 230, an adder 235, a filter 240, a memory 250, an inter-frame prediction unit 260, and an intra-frame prediction unit 265. The inter-frame prediction unit (inter-frame predictor) 260 and the intra-frame prediction unit (intra-frame predictor) 265 may be collectively referred to as a "prediction unit (predictor)". The dequantizer 220 and the inverse transformer 230 may be included in a residual processor.

[0101] According to an embodiment, all or at least some of the plurality of components configuring the image decoding apparatus 200 may be configured by hardware components (eg, a decoder or a processor). In addition, the memory 250 may include a decoded picture buffer (DPB) or may be configured by a digital storage medium.

[0102] The image decoding device 200 having received a bit stream including video / image information may perform the same Figure 2 The image encoding device 100 may reconstruct the image by processing corresponding to the processing performed by the image encoding device 100. For example, the image decoding device 200 may perform decoding using a processing unit applied in the image encoding device. Therefore, the processing unit of decoding may be, for example, a coding unit. The coding unit may be obtained by partitioning the coding tree unit or the maximum coding unit. The reconstructed image signal decoded and output by the image decoding device 200 may be reproduced by a reproduction device (not shown).

[0103] The image decoding device 200 may receive the image in the form of a bit stream from Figure 2The received signal may be decoded by the entropy decoder 210. For example, the entropy decoder 210 may parse the bitstream to derive information (e.g., video / image information) required for image reconstruction (or picture reconstruction). The video / image information may also include information about various parameter sets, such as 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 also include general constraint information. The image decoding device may also decode the picture based on the information about the parameter set and / or the general constraint information. The information and / or syntax elements signaled / received described in the present disclosure may be decoded and obtained from the bitstream through a decoding process. For example, the entropy decoder 210 may decode the information in the bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values ​​of the syntax elements required for image reconstruction and the quantized values ​​of the transform coefficients of the residual. More specifically, the CABAC entropy decoding method can receive a bin corresponding to each syntax element in the bitstream, use the decoding target syntax element information, the decoding information of the neighboring block and the decoding target block, or the information of the symbol / bin decoded in the previous stage to determine the context model, perform arithmetic decoding on the bin by predicting the probability of occurrence of the bin according to the determined context model, and generate a symbol corresponding to the value of each syntax element. In this case, the CABAC entropy decoding method can update the context model by using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. The information related to the prediction in the information decoded by the entropy decoder 210 can be provided to the prediction unit (inter-frame prediction unit 260 and intra-frame prediction unit 265), and the residual value of the entropy decoding performed on it in the entropy decoder 210, that is, the quantized transform coefficient and the related parameter information can be input to the dequantizer 220. In addition, the information about filtering in the information decoded by the entropy decoder 210 can be provided to the filter 240. In addition, a receiver (not shown) for receiving a signal output from the image encoding apparatus may be further configured as an internal / external element of the image decoding apparatus 200 , or the receiver may be a component of the entropy decoder 210 .

[0104] In addition, the image decoding device according to the present disclosure may be referred to as a video / image / picture decoding device. The image 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 210. The sample decoder may include a dequantizer 220, an inverse transformer 230, an adder 235, a filter 240, a memory 250, an inter-frame prediction unit 260, or at least one of an intra-frame prediction unit 265.

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

[0106] The inverse transformer 230 may inversely transform the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0107] The prediction unit may perform prediction on the current block and generate a prediction block including prediction samples of the current block. The prediction unit may determine whether to apply intra prediction or inter prediction to the current block based on the information about prediction output from the entropy decoder 210, and may determine a specific intra / inter prediction mode (prediction technique).

[0108] The same as described in the prediction unit of the image encoding device 100 , the prediction unit can generate a prediction signal based on various prediction methods (techniques) described later.

[0109] The intra prediction unit 265 may predict the current block by referring to samples in the current picture. The description of the intra prediction unit 185 is also applicable to the intra prediction unit 265.

[0110] The inter-frame prediction unit 260 can derive the prediction block of the current block based on the reference block (reference sample array) specified by the motion vector on the reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter-frame prediction mode, the motion information can 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 also include inter-frame prediction direction (L0 prediction, L1 prediction, dual prediction, etc.) information. In the case of inter-frame prediction, the neighboring blocks may include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. For example, the inter-frame prediction unit 260 may configure a motion information candidate list based on the neighboring blocks, and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Inter-frame prediction may be performed based on various prediction modes, and information about the prediction may include information indicating the inter-frame prediction mode of the current block.

[0111] The adder 235 can generate a reconstruction signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to the prediction signal (prediction block, prediction sample array) output from the prediction unit (including the inter-frame prediction unit 260 and / or the intra-frame prediction unit 265). If the block to be processed has no residual (for example, when the skip mode is applied), the prediction block can be used as a reconstructed block. The description of the adder 155 also applies to the adder 235. The adder 235 can be called a reconstructor or a reconstructed block generator. The generated reconstruction signal can be used for intra-frame prediction of the next block to be processed in the current picture, and can be used for inter-frame prediction of the next picture by filtering as described below.

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

[0113] The (modified) reconstructed picture stored in the DPB of the memory 250 may be used as a reference picture in the inter-frame prediction unit 260. The memory 250 may store the motion information of the block from which the motion information in the current picture is derived (or decoded) and / or the motion information of the reconstructed block in the picture. The stored motion information may be transmitted to the inter-frame prediction unit 260 to be used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 250 may store the reconstructed samples of the reconstructed block in the current picture and transmit the reconstructed samples to the intra-frame prediction unit 265.

[0114] In the present disclosure, the implementations described in the filter 160, the inter-frame prediction unit 180 and the intra-frame prediction unit 185 of the image encoding device 100 can be equally or correspondingly applied to the filter 240, the inter-frame prediction unit 260 and the intra-frame prediction unit 265 of the image decoding device 200.

[0115] Inter prediction

[0116] The prediction unit of the image encoding device 100 and the image decoding device 200 may derive a prediction sample by performing inter-frame prediction on a per-block basis. Inter-frame prediction may be a prediction derived in a manner that depends on data elements (e.g., sample values ​​or motion information) of a picture other than the current picture. When inter-frame prediction is applied to the current block, a prediction block (prediction sample array) of the current block may be derived based on a reference block (reference sample array) specified by a motion vector on a reference picture indicated by a reference picture index. Herein, in order to reduce the amount of motion information transmitted in the inter-frame prediction mode, the motion information of the current block may be predicted on a per-block, sub-block, or sample basis based on the correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter-frame prediction type (L0 prediction, L1 prediction, dual prediction, etc.) information. When inter-frame prediction is applied, 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 or collocated CU (colCU). A reference picture including temporally neighboring blocks may be referred to as a collocated picture (colPic). For example, a motion information candidate list may be constructed based on neighboring blocks of the current block. A flag or index information indicating which candidate is selected (used) to derive a motion vector and / or a reference picture index may be signaled. Inter-frame prediction may be performed based on various prediction modes. For example, in the case of skip mode and merge mode, the motion information of the current block may be the same as the motion information of the selected neighboring block. In the case of skip mode, unlike merge mode, a residual signal may not be sent. In the case of motion information prediction (motion vector prediction, MVP) mode, the motion vector of the selected neighboring block may be used as a motion vector predictor, and the motion vector difference may be signaled. In this case, the motion vector of the current block may be derived using the sum of the motion vector predictor and the motion vector difference.

[0117] According to the inter-frame prediction type (L0 prediction, L1 prediction, dual prediction, etc.), the motion information may include L0 motion information and / or L1 motion information. The motion vector in the L0 direction may be referred to as the L0 motion vector or MVL0, and the motion vector in the L1 direction may be referred to as the L1 motion vector or MVL1. Prediction based on the L0 motion vector may be referred to as the L0 prediction. Prediction based on the L1 motion vector may be referred to as the L1 prediction. Prediction based on both the L0 motion vector and the L1 motion vector may be referred to as dual prediction. Herein, the L0 motion vector may refer to a motion vector (L0) associated with the reference picture list L0, and the L1 motion vector may refer to a motion vector (L1) associated with the reference picture list L1. The reference picture list L0 may include a picture before the current picture according to the output order as a reference picture. The reference picture list L1 may include a picture after the current picture according to the output order as a reference picture. The previous picture may be referred to as a forward (reference) picture, and the subsequent picture may be referred to as a backward (reference) picture. The reference picture list L0 may also include a picture after the current picture according to the output order as a reference picture. In this case, within the reference picture list L0, the preceding picture may be indexed first, and the succeeding picture may be indexed next. The reference picture list L1 may also include a picture preceding the current picture in the output order as a reference picture. In this case, within the reference picture list 1, the succeeding picture may be indexed first, and the preceding picture may be indexed next. Herein, the output order may correspond to a picture order count (POC) order.

[0118] Figure 4 is a diagram schematically showing an inter-frame prediction unit 180 of the image encoding device 100, Figure 5 is a flowchart illustrating a method for encoding an image based on inter-frame prediction.

[0119] The image encoding device 100 may perform inter prediction on the current block (S510). The image encoding device 100 may derive the inter prediction mode and motion information of the current block, and may generate a prediction sample of the current block. Herein, the processes of inter prediction mode determination, motion information derivation, and prediction sample generation may be performed simultaneously, or any one process may be performed before the other processes. For example, the inter prediction unit 180 of the image encoding device 100 may include a prediction mode determination unit 181, a motion information derivation unit 182, and a prediction sample derivation unit 183. The prediction mode determination unit 181 may determine the prediction mode of the current block. The motion information derivation unit 182 may derive the motion information of the current block. The prediction sample derivation unit 183 may derive the prediction sample of the current block. For example, the inter prediction unit 180 of the image encoding device 100 may search for a block similar to the current block in a predetermined area (search area) of the reference picture through motion estimation, and may derive a reference block having the smallest difference with the current block or less than or equal to a predetermined standard. Based on this, a reference picture index indicating a reference picture in which a reference block is located can be derived, and a motion vector can be derived based on a position difference between the reference block and the current block. The image encoding apparatus 100 can determine a mode applied to the current block among various prediction modes. The image encoding apparatus 100 can compare RD costs for various prediction modes, and can determine an optimal prediction mode for the current block.

[0120] For example, when the skip mode or merge mode is applied to the current block, the image encoding device 100 may construct a merge candidate list described later, and may derive a reference block having the smallest difference with the current block or less than or equal to a predetermined standard among the reference blocks indicated by the merge candidates included in the merge candidate list. In this case, a merge candidate associated with the derived reference block may be selected, and merge index information indicating the selected merge candidate may be generated and signaled to the decoding device. The motion information of the current block may be derived using the motion information of the selected merge candidate.

[0121] As another example, when the (A)MVP mode is applied to the current block, the image encoding device 100 may construct an (A)MVP candidate list described later, and may use the motion vector of the MVP candidate selected from among the motion vector predictor (MVP) candidates included in the (A)MVP candidate list as the MVP of the current block. In this case, for example, a motion vector indicating a reference block derived by the above-mentioned motion estimation may be used as the motion vector of the current block. Among the MVP candidates, the MVP candidate having a motion vector with the smallest difference from the motion vector of the current block may be the selected MVP candidate. A motion vector difference (MVD) as a difference obtained by subtracting the MVP from the motion vector of the current block may be derived. In this case, information about the MVD may be notified to the image decoding device 200 by a signal. In addition, when the (A)MVP mode is applied, the value of the reference picture index may be constructed as reference picture index information, and may be separately notified to the image decoding device 200 by a signal.

[0122] The image encoding apparatus 100 may induce a residual sample based on the prediction sample (S520). The image encoding apparatus 100 may compare the prediction sample with an original sample of the current block to induce the residual sample.

[0123] The image encoding device 100 may encode the image information including prediction information and residual information (S530). The image encoding device may output the encoded image information in the form of a bitstream. The prediction information is information related to the prediction process, and may include prediction mode information (e.g., a skip flag, a merge flag, or a mode index) and information about motion information. The information about the motion information may include candidate selection information (e.g., a merge index, an mvp flag, or an mvp index) as information for deriving a motion vector. In addition, the information about the motion information may include the above-mentioned information about the MVD and / or the reference picture index information. In addition, the information about the motion information may include information indicating whether L0 prediction, L1 prediction, or dual prediction is applied. The residual information is information about the residual sample. The residual information may include information about the quantized transform coefficients used for the residual sample.

[0124] The output bit stream may be stored in a (digital) storage medium and transmitted to the decoding device, or may be transmitted to the image decoding device 200 via a network.

[0125] In addition, as described above, the image encoding device 100 may generate a reconstructed picture (including a reconstructed sample and a reconstructed block) based on the reference sample and the residual sample. This is to derive the same prediction result as the prediction result performed in the image decoding device 200 by the image encoding device 100, thereby increasing the encoding efficiency. Therefore, the image encoding device 100 may store the reconstructed picture (or reconstructed sample, reconstructed block) in a memory, and may use it as a reference picture for inter-frame prediction. As described above, the in-loop filtering process may also be applied to the reconstructed picture.

[0126] Figure 6 is a diagram schematically showing an inter-frame prediction unit 260 of the image decoding apparatus 200, Figure 7 is a flowchart illustrating a method of decoding an image based on inter-frame prediction.

[0127] The image decoding apparatus 200 may perform an operation corresponding to the operation performed by the image encoding apparatus 100. The image decoding apparatus 200 may perform prediction on the current block based on the received prediction information and may derive a prediction sample.

[0128] Specifically, the image decoding apparatus 200 may determine a prediction mode of a current block based on the received prediction information (S710). The image decoding apparatus 200 may determine which inter prediction mode is applied to the current block based on prediction mode information in the prediction information.

[0129] For example, based on the merge flag, it can be determined whether to apply the merge mode to the current block or to determine the (A) MVP mode. Alternatively, one of the various inter-frame prediction mode candidates can be selected based on the mode index. The inter-frame prediction mode candidates may include a skip mode, a merge mode, and / or an (A) MVP mode or may include various inter-frame prediction modes described later.

[0130] The image decoding device 200 may derive motion information of the current block based on the determined inter prediction mode (S720). For example, when the skip mode or merge mode is applied to the current block, the image decoding device 200 may construct a merge candidate list described later, and may select a merge candidate from the merge candidates included in the merge candidate list. The selection may be performed based on the above-mentioned selection information (merge index). The motion information of the selected merge candidate may be used to derive the motion information of the current block. The motion information of the selected merge candidate may be used as the motion information of the current block.

[0131] As another example, when the (A)MVP mode is applied to the current block, the image decoding device 200 may construct the (A)MVP candidate list described later, and may use the motion vector of the MVP candidate selected from the MVP candidates included in the (A)MVP candidate list as the motion vector predictor (MVP) of the current block. The selection may be performed based on the above-mentioned selection information (MVP flag or MVP index). In this case, the MVD of the current block may be derived based on the information about the MVD, and the motion vector of the current block may be derived based on the MVP and MVD of the current block. In addition, the reference picture index of the current block may be derived based on the reference picture index information. The picture indicated by the reference picture index in the reference picture list related to the current block may be derived as the reference picture referenced by the inter-frame prediction of the current block.

[0132] In addition, as will be described later, the motion information of the current block can be derived without constructing a candidate list. In this case, the motion information of the current block can be derived according to the process described in the prediction mode described later. In this case, the candidate list configuration as described above can be omitted.

[0133] The image decoding apparatus 200 may generate a prediction sample of the current block based on the motion information of the current block (S730). In this case, a reference picture may be derived based on a reference picture index of the current block, and a sample of the reference block indicated by a motion vector of the current block on the reference picture may be used to derive the prediction sample of the current block. In this case, as described later, in some cases, a prediction sample filtering process may also be performed on all or some of the prediction samples of the current block.

[0134] For example, the inter prediction unit 260 of the image decoding device 200 may include a prediction mode determination unit 261, a motion information derivation unit 262, and a prediction sample derivation unit 263. The prediction mode determination unit 181 may determine the prediction mode of the current block based on the received prediction mode information. The motion information derivation unit 182 may derive motion information (motion vector and / or reference picture index) of the current block based on the received information about the motion information. The prediction sample derivation unit 183 may derive the prediction sample of the current block.

[0135] The image decoding device 200 may generate a residual sample of the current block based on the received residual information (S740). The image decoding device 200 may generate a reconstructed sample of the current block based on the predicted sample and the residual sample, and may generate a reconstructed picture based thereon (S750). Thereafter, as described above, an in-loop filtering process may be further applied to the reconstructed picture.

[0136] Reference Figure 8The inter-frame prediction process may include the steps of determining an inter-frame prediction mode (S810), deriving motion information according to the determined prediction mode (S810), and performing prediction (generating prediction samples) based on the derived motion information (S830). As described above, the inter-frame prediction process may be performed in the image encoding apparatus 100 and the image decoding apparatus 200.

[0137] Inter prediction mode determination

[0138] Various inter prediction modes can be used for the prediction of the current block in the picture. For example, various modes such as merge mode, skip mode, motion vector prediction (MVP) mode, affine mode, sub-block merge mode, and merge with MVD (MMVD) mode can be used. Decoder-side motion vector refinement (DMVR) mode, adaptive motion vector resolution (AMVR) mode, dual prediction with CU-level weights (BCW), bidirectional optical flow (BDOF), etc. can also be used in addition or alternatively as additional modes. Affine mode can be referred to as affine motion prediction mode. MVP mode can be referred to as advanced motion vector prediction (AMVP) mode. In this document, some modes and / or motion information candidates derived from some modes can be included as one of the motion information candidates of other modes. For example, an HMVP candidate can be added as a merge candidate in merge / skip mode, or can be added as an MVP candidate in MVP mode.

[0139] Prediction mode information indicating the inter prediction mode of the current block may be signaled from the image encoding device 100 to the image decoding device 200. The prediction mode information may be included in a bitstream and received by the image decoding device 200. The prediction mode information may include index information indicating one of a plurality of candidate modes. Alternatively, the inter prediction mode may be indicated by hierarchical signaling of flag information. In this case, the prediction mode information may include one or more flags. For example, a skip flag may be signaled to indicate whether the skip mode is applied, and if the skip mode is not applied, a merge flag may be signaled to indicate whether the merge mode is applied, and if the merge mode is not applied, an MVP mode may be indicated to be applied or a flag for additional classification may be further signaled. The affine mode may be signaled in an independent mode, or may be signaled in a mode depending on the merge mode or the MVP mode. For example, the affine mode may include an affine merge mode and an affine MVP mode.

[0140] Derivation of motion information

[0141] Inter-frame prediction can be performed using the motion information of the current block. The image encoding device 100 can derive the optimal motion information of the current block through a motion estimation process. For example, the image encoding device 100 can use the original block in the original picture of the current block to search for a similar reference block with high correlation in units of partial pixels within a predetermined search range in the reference picture, thereby deriving motion information. The similarity of the blocks can be derived based on the difference in sample values ​​based on the phase. For example, the similarity of the blocks can be calculated based on the SAD between the current block (or the template of the current block) and the reference block (or the template of the reference block). In this case, the motion information can be derived based on the reference block with the minimum SAD in the search area. The derived motion information can be signaled to the image decoding device 200 according to various methods based on the inter-frame prediction mode.

[0142] Generation of prediction samples

[0143] The prediction block of the current block may be derived based on the motion information derived according to the prediction mode. The prediction block may include prediction samples (prediction sample array) of the current block. When the motion vector of the current block indicates a partial sample unit, an interpolation process may be performed, whereby the prediction sample of the current block may be derived based on the reference sample of the partial sample unit within the reference picture. When affine inter prediction is applied to the current block, the prediction sample may be generated based on the sample / sub-block unit MV. When bi-prediction is applied, the prediction sample derived by weighting or weighted averaging (according to the phase) of the prediction sample derived based on the L0 prediction (i.e., prediction using the reference picture in the reference picture list L0 and MVL0) and the prediction sample derived based on the L1 prediction (i.e., prediction using the reference picture in the reference picture list L1 and MVL1) may be used as the prediction sample of the current block. When bi-prediction is applied, if the reference picture for L0 prediction and the reference picture for L1 prediction are located in different time directions relative to the current picture (i.e., bi-prediction and bi-directional prediction), it may be referred to as true bi-prediction.

[0144] As described above, reconstructed samples and reconstructed pictures may be generated based on the derived prediction samples, after which processes such as in-loop filtering may be performed.

[0145] Template Matching(TM)

[0146] Fig. 9 2 is a diagram for explaining an encoding / decoding method based on template matching according to the present disclosure.

[0147] Template matching (TM) is a motion vector derivation method performed at the decoder stage, and is a method of refining motion information of a current block by finding a template (hereinafter referred to as a "reference template") that is most similar to a template (hereinafter referred to as a "current template") adjacent to a current block (e.g., a current coding unit, a current CU) in a reference picture. The current template may be an upper neighboring block and / or a left neighboring block of the current block, or may be some of these neighboring blocks. In addition, the reference template may be determined to have the same size as the current template.

[0148] like Fig. 9 As shown, when the initial motion vector of the current block is derived, a search for a better motion vector can be performed in the surrounding area of ​​the initial motion vector. For example, the range of the surrounding area where the search is performed can be within a [-8, +8] pixel search area centered on the initial motion vector. In addition, the size of the search step for performing the search can be determined based on the AMVR mode of the current block. In addition, template matching can be continuously performed in a bilateral matching process in a merge mode.

[0149] If the prediction mode of the current block is the AMVP mode, a motion vector predictor candidate (MVP candidate) may be determined based on a template matching error. For example, a motion vector predictor candidate (MVP candidate) that minimizes an error between a current template and a reference template may be selected. Thereafter, template matching for refining a motion vector may be performed on the selected motion vector predictor candidate. At this time, template matching for refining a motion vector may not be performed on unselected motion vector predictor candidates.

[0150] More specifically, the refinement of the selected motion vector predictor candidate can use an iterative diamond search starting from full pixel (integer pixel) precision within the [–8, +8] pixel search area. Alternatively, in the case of a 4-pixel AMVR mode, it can start from 4-pixel precision. Thereafter, a search with half-pixel and / or quarter-pixel precision can be performed according to the AMVR mode. According to the search process, the motion vector predictor candidate can maintain the same motion vector precision indicated by the AMVR mode even after the template matching process. During the iterative search process, if the difference between the previous minimum cost and the current minimum cost is less than an arbitrary threshold, the search process terminates. The threshold can be equal to the area of ​​the block, that is, the number of samples in the block. Table 1 shows an example of a search pattern according to the AMVR mode and the merge mode accompanying the AMVR.

[0151] [Table 1]

[0152]

[0153] If the prediction mode of the current block is the merge mode, a similar search method can be applied to the merge candidate indicated by the merge index. As shown in Table 1 above, template matching can be performed up to 1 / 8 pixel accuracy, or half-pixel accuracy or lower can be skipped, which can be determined according to whether an alternative interpolation filter is used based on the merged motion information. In this case, the alternative interpolation filter can be the filter used when the AMVR is in half-pixel mode. In addition, if template matching is available, depending on whether bilateral matching (BM) is available, template matching can be operated as an independent process, or can be operated as an additional motion vector refinement process between block-based bilateral matching and sub-block-based bilateral matching. Whether template matching is available and / or whether bilateral matching is available can be determined based on an availability condition check. In the above, the accuracy of the motion vector may refer to the accuracy of the motion vector difference (MVD).

[0154] Hereinafter, an image encoding / decoding method according to various embodiments of the present disclosure will be described in detail.

[0155] The present disclosure relates to illumination compensation, and more particularly, to an illumination compensation method and an illumination compensation candidate reordering method.

[0156] Implementation Method 1

[0157] An equation for compensating for the illumination difference between a reference picture and a current picture according to the present disclosure may be as shown in Equation 1 below.

[0158] [Formula 1]

[0159]

[0160] In Formula 1, a and b may be parameters for illumination compensation (hereinafter, referred to as "illumination compensation parameters"). x may be a signal of a reference picture, and y may mean a signal of a current picture or a signal of an original image. The difference between the two sides in Formula 1 may be referred to as an error, and the image encoding apparatus 100 or the image decoding apparatus 200 may obtain illumination compensation parameters a and / or b that may minimize the error.

[0161] The illumination compensation parameters may be generated based on various units such as pictures, tiles, slices, CTUs, CUs, sub-CUs, etc. For convenience of explanation, the following description is based on CUs.

[0162] There are three methods to obtain the lighting compensation parameters.

[0163] - [Method 1] The illumination compensation parameters may be calculated from the original image pixels of the current CU to which illumination compensation is to be applied and the pixel information of the CU in the reference picture.

[0164] - [Method 2] The illumination compensation parameters may be calculated from neighboring pixel information of the current CU to which illumination compensation is to be applied and the reference picture CU.

[0165] -[Method 3] The illumination compensation parameters can be calculated by selectively combining Method 1 and Method 2.

[0166] In the case of method 1, according to formula 1, y is the original image pixel corresponding to the current CU, and a CU block close to the original image can be generated from the combination of the pixel information of the reference picture CU and the illumination compensation parameters a and b. Therefore, when method 1 is used, it may be useful for reducing the residual signal. However, from the perspective of the image decoding device 200, since there is no original image, the image encoding device 100 may have to encode and transmit the generated illumination compensation parameters a and b.

[0167] In the case of method 2, y may be a neighboring pixel of the current CU, and x may be a neighboring pixel of the reference picture CU according to equation 1. Unlike method 1, since the illumination compensation parameters a and b are obtained using the relationship between the neighboring pixels, the neighboring pixels may exist even from the perspective of the image decoding apparatus 200. Therefore, illumination compensation information may be generated without directly encoding the illumination compensation parameters a and b.

[0168] The derived illumination compensation parameters a, b may always be applied to the CU to which illumination compensation is applied. Alternatively, one or more derived illumination compensation parameters a, b may not be used, or may be replaced with fixed values. Alternatively, whether to use the illumination compensation parameters a and b may be determined according to predefined conditions. If whether to use the illumination compensation parameters is determined according to predefined conditions, even if some compression efficiency improvements are sacrificed, the calculation and implementation complexity may be reduced. That is, if the degree of compression efficiency improvement obtained by applying illumination compensation parameters for illumination compensation is small, or if the calculation and implementation complexity is unnecessarily increased, it may be determined not to use the illumination compensation parameters, thereby reducing the calculation and implementation complexity.

[0169] Fig.10 is a diagram showing sample positions within a reference region for deriving illumination compensation parameters according to an embodiment of the present disclosure. When using neighboring samples of a current CU and a reference CU in order to generate illumination compensation parameters, the neighboring samples of the reference CU may be selected in various ways as follows.

[0170] (a) All neighboring samples of the reference CU are used, but more neighboring samples than the size of the reference CU may be used (1010).

[0171] (b) All neighboring samples of the reference CU are used, but only neighboring samples within the same size range as the reference CU may be used (1020).

[0172] (c) Only some of one or more neighboring samples of the reference CU may be used (1030).

[0173] (d) Only some of the one or more neighboring samples of the reference CU are used, but some of the one or more neighboring samples of the reference CU may be used in a down-sampled form (1040).

[0174] (e) Only some of the one or more neighboring samples of the reference CU may be used, but some of the one or more neighboring samples of the reference CU may be used in an irregular form (1050).

[0175] (f) Only specific samples representing neighboring samples of the reference CU may be used (1060). For example, only two neighboring samples may be used, but the values ​​may be the maximum and minimum values ​​among the available pixels, respectively.

[0176] (g) The above methods (a) to (f) may be used in optional combination.

[0177] As a method of selecting neighboring samples of the reference CU, the width and / or height of the block can be used as a criterion. For example, the size of the largest available block can be arbitrarily determined so that all neighboring samples are used up to a certain width or height, and if the width or height is greater than the width or height, only some samples can be used. As another example, the downsampling rate can be determined so that some samples can be adaptively selected according to the size of the width or height of the block. If the downsampling rate is 2 and the width or height of the block is 4, only 2 samples can be used. Alternatively, if the downsampling rate is 2 and the width or height of the block is 8, only 4 samples can be used.

[0178] As another example, an arbitrary threshold value may be used as a method for selecting neighboring samples of a reference CU. That is, the values ​​of neighboring samples of the reference CU are compared with an arbitrary threshold value, and only samples corresponding to sample values ​​greater than or less than the threshold value may be used. Optionally, the methods for selecting neighboring samples of a reference CU mentioned in the present disclosure may be combined.

[0179] The downsampling rate or arbitrary threshold may be pre-defined in the image encoding apparatus 100 and / or the image decoding apparatus 200. Alternatively, the downsampling rate or arbitrary threshold may be transmitted in units of a specific header (SPS, PPS, picture header, slice header, etc.).

[0180] Fig.11 is a diagram showing the positions of sample rows in a reference region for deriving illumination compensation parameters according to an embodiment of the present disclosure. According to one embodiment of the present disclosure, the positions or number of sample rows in a neighborhood of a reference CU for deriving illumination compensation parameters may vary.

[0181] (a) Neighboring samples of a reference CU for deriving illumination compensation parameters may be selected from a region consisting of 1 row of samples adjacent to the reference CU (1110).

[0182] (b) Neighboring samples of the reference CU for deriving illumination compensation parameters may be selected from a region consisting of 1 row of samples that are not adjacent to the reference CU (1120).

[0183] (c) Neighboring samples of the reference CU for deriving illumination compensation parameters may be selected from a region consisting of any number of rows of samples adjacent to the reference CU (1130).

[0184] (d) The above-mentioned methods (a) to (c) may be optionally used.

[0185] According to one embodiment of the present disclosure, as a method of selecting the area to which neighboring samples belong, the width and / or height of the block can be used as a criterion. For example, the minimum number of samples required to obtain the illumination compensation parameters can be determined arbitrarily. In this case, for a CU with a specific width or height, the corresponding number of samples can be ensured by only one row of sample areas. In this case, one row can mean adjacent or non-adjacent rows of neighboring samples. For a CU whose width or height is less than a specific width or height, neighboring samples included in multiple rows of sample areas can be used.

[0186] As another example, an arbitrary threshold value may be used as a method for selecting neighboring samples. That is, by comparing the value of the neighboring sample with an arbitrary threshold value, only the neighboring sample may be used when the value of the neighboring sample is greater than or less than the threshold value. In this case, if the required number of samples in a 1-row sample area adjacent or non-adjacent is met, samples may be selected only in the 1-row sample area, otherwise, samples included in multiple rows of sample areas may be used to obtain illumination compensation parameters. Optionally, the methods for selecting sample areas for selecting neighboring samples of a reference CU mentioned in the present disclosure may be combined.

[0187] Information for selecting a sample region may be previously commonly defined in the image encoding apparatus 100 and / or the image decoding apparatus 200. Alternatively, information for selecting a sample region may be transmitted in units of a specific header (SPS, PPS, picture header, slice header, etc.).

[0188] Implementation Method 2

[0189] According to one embodiment of the present disclosure, multiple modes can be used to compensate for illumination changes of a reference picture. In addition, reference samples for deriving multiple modes can be selected based on position. Illumination compensation parameters can be generated based on various units such as pictures, tiles, slices, CTUs, CUs, sub-CUs, etc. However, for ease of explanation, the present disclosure will be described based on CUs.

[0190] The degree of illumination compensation may depend on illumination compensation parameters a and b. That is, if one parameter set (a, b) is derived from samples around the current CU and the reference CU corresponding thereto, illumination compensation may be performed in only one form. If multiple illumination compensation parameter sets are derived from neighboring samples, illumination compensation may be performed in various forms.

[0191] Fig.12 is a diagram illustrating an illumination compensation candidate mode according to an embodiment of the present disclosure. According to an embodiment of the present disclosure, the present disclosure may divide neighboring samples into n sets to derive illumination compensation parameters for generating a plurality of illumination compensation candidate modes. Fig.12 A method of generating multiple illumination compensation candidate modes according to the positions of neighboring samples is shown. Illumination compensation candidate mode (a) 1210 may use all neighboring samples of the current CU and the reference CU as sample regions. Illumination compensation candidate mode (b) 1220 may use only left neighboring samples as sample regions. Illumination compensation candidate mode (c) 1230 may use only upper neighboring samples as sample regions. Fig.12 This is an example of generating a plurality of candidate illumination compensation modes, and the illumination compensation parameters may be derived in various ways using the method described in Embodiment 1.

[0192] Implementation 3

[0193] When multiple illumination compensation candidate modes are used, the present disclosure may define the number of illumination compensation candidate modes to be used. Multiple illumination compensation candidate modes are not limited to three as in Embodiment 2, and the number of illumination compensation candidate modes may be used by determining the same as N in the image encoding device 100 and / or the image decoding device 200. Here, N may be a natural number. Alternatively, the maximum number of illumination compensation candidate modes possible in the high-level syntax may be transmitted.

[0194] According to one embodiment of the present disclosure, a flag indicating whether lighting compensation is available may be sent in the SPS, and a syntax indicating the maximum number of available lighting compensation candidate modes may be sent. Table 2 is a syntax showing a method of sending a flag indicating whether lighting compensation is available and a syntax indicating the maximum number of available lighting compensation candidate modes.

[0195] [Table 2]

[0196]

[0197] In the syntax of Table 2, sps_illumination_compensation_enabled_flag may indicate whether illumination compensation is performed for a CU performing inter prediction. When the value of sps_illumination_compensation_enabled_flag is 1, it may indicate that a CU performing inter prediction for CLVS may perform illumination compensation. When the value of sps_illumination_compensation_enabled_flag is 0, it may indicate that a CU performing inter prediction for CLVS may not perform illumination compensation.

[0198] In the syntax of Table 1, sps_max_num_ic_cand may indicate the maximum number of illumination compensation candidates supported by SPS. Table 2 shows a transmission method in SPS, and the number of illumination compensation candidate modes may be transmitted in various header positions (VPS, PPS, picture header, slice header, etc.) other than SPS.

[0199] According to another embodiment of the present disclosure, the number of illumination compensation candidate modes may be determined according to an additional criterion in the same reference unit. Various characteristics such as block size (e.g., block width / height), prediction type, partition type, and transform type may be used as additional criteria. For example, when the block size is used as an additional criterion, the number of illumination compensation candidate modes may be defined according to the same criterion previously set by the image encoding device 100 and / or the image decoding device 200. Alternatively, the number of illumination compensation candidate modes may be defined according to whether it is a square block having an N×N shape or a non-square block having an M×N shape. Alternatively, the number of illumination compensation candidate modes may be defined according to the number of samples included in the block. The number of illumination compensation candidate modes according to the additional criteria is not limited to the above examples and may be defined differently according to other combinations.

[0200] Implementation 4

[0201] This embodiment relates to a method of sending an index when multiple illumination compensation candidate modes are used. According to one embodiment of the present disclosure, a flag indicating whether illumination compensation is used may be sent in a CU unit. Table 3 below shows a method of sending an index when illumination compensation is used.

[0202] [Table 3]

[0203]

[0204] cu_ic_flag is a flag indicating whether illumination compensation is applied to the current CU. If the value of cu_ic_flag is 1, it may indicate that illumination compensation is applied to the current CU. cu_ic_idx may be an index indicating an illumination compensation candidate mode in an illumination compensation list. cu_ic_idx may be defined as shown in Table 4 below.

[0205] [Table 4]

[0206] cu_ic_idx Association Name 0 IC_TOP_LEFT 1 IC_TOP 2 IC_LEFT

[0207] When cu_ic_idx is 0, both the upper sample and the left sample may be used to derive the illumination compensation parameters. When cu_ic_idx is 1, only the upper sample may be used to derive the illumination compensation parameters. When cu_ic_idx is 2, only the left sample may be used to derive the illumination compensation parameters.

[0208] According to another embodiment of the present disclosure, whether illumination compensation is applied to a CU and index information may be integrated into a single syntax and transmitted. In this case, one of the index entries may indicate that illumination compensation is not applied, and the remaining index entries may indicate a specific mode among multiple illumination compensation candidate modes. In this case, the entry indicating that illumination compensation is not applied may be the first (0th) entry. Table 5 below shows a method of integrating whether illumination compensation is applied and index information into a single syntax and transmitting it.

[0209] [Table 5]

[0210]

[0211] The meaning of cu_ic_idx in Table 5 may be defined as in Table 6 below.

[0212] [Table 6]

[0213] cu_ic_idx Association Name 0 IC_NO_USE 1 IC_TOP_LEFT 2 IC_TOP 3 IC_LEFT

[0214] An example of index transmission of the illumination compensation candidate mode may be an example of a case where three illumination compensation candidate modes are used as in Embodiment 2. When the maximum number of illumination compensation candidate modes is defined according to Embodiment 3, the index may be transmitted according to the corresponding number. That is, the cu_ic_idx value may be less than or equal to sps_max_num_ic_cand. The index transmission of the illumination compensation candidate mode according to the present disclosure is not limited to the above example, and may be transmitted in other forms.

[0215] Implementation method 5

[0216] The present embodiment relates to a method for constructing an index candidate list when multiple illumination compensation candidate modes are used. Embodiment 4 relates to a case where the position of the illumination compensation candidate mode used for deriving illumination compensation parameters according to the index position is predefined and fixed. However, the present disclosure can reorder the illumination compensation candidate modes according to the template cost.

[0217] Fig.13 1 is a flowchart illustrating a method for reordering candidate illumination compensation modes according to an embodiment of the present disclosure. Hereinafter, the image encoding device 100 will be described as a main body, but it is obvious that the image decoding device 200 may also be a main body.

[0218] The image encoding apparatus 100 may derive parameters of the illumination compensation candidate (S1310). That is, the image encoding apparatus 100 may derive illumination compensation parameters of each illumination compensation candidate mode. When {IC_TOP_LEFT, IC_TOP, IC_LEFT} is used as an illumination compensation candidate mode, illumination compensation parameters {a, b} may be derived using samples at corresponding positions.

[0219] The image encoding device 100 may apply illumination compensation to the template area (S1320). That is, the illumination compensation parameters may be applied to the template area of ​​the reference block. Here, the template area may be a predetermined adjacent area adjacent to the reference block. Thereafter, the image encoding device 100 may calculate the template cost (S1330). Specifically, the image encoding device 100 may calculate the illumination difference (template cost or template error) between the template area of ​​the current block and the template area of ​​the reference block to which illumination compensation is applied. At this time, the template cost may be obtained using SAD (Sum of Absolute Difference), SATD (Sum of Absolute Transform Difference), SSD (Sum of Square Difference), etc.

[0220] Fig.14 14 is a diagram showing a template position for template cost calculation according to an embodiment of the present disclosure. The template 1410 of the current CU may be a left sample and an upper sample adjacent to the current CU, and the template 1420 of the reference block may be a left sample and an upper sample adjacent to the reference block.

[0221] The image encoding device 100 may reorder the illumination compensation candidates (S1340). Specifically, the image encoding device 100 may reorder the illumination compensation candidate modes based on the template cost. Here, reordering may mean sorting the template cost in order from small to large. The illumination compensation candidate list may be constructed in the order of illumination compensation candidate modes to which illumination compensation may be applied by reordering based on the template cost. After performing the illumination compensation candidate reordering, the image encoding device 100 may send an index indicating the illumination compensation candidate mode as in embodiment 4. At this time, the index indicating the illumination compensation candidate mode may be sent for all possible illumination compensation candidate modes, or may be sent only for some candidates in order to reduce flag transmission bits.

[0222] The method of sending the syntax representing the lighting compensation index according to the present disclosure may be as shown in Table 7 below.

[0223] [Table 7]

[0224]

[0225] In Table 7, if cu_ic_flag is 1, it indicates that illumination compensation can be applied to the current CU. If cu_ic_idx_flag is 0, it may indicate that the first illumination compensation candidate mode in the reordered illumination compensation candidate list is used. If cu_ic_idx_flag is 1, it may indicate that the second illumination compensation candidate mode in the reordered illumination compensation candidate list is used. The meaning of cu_ic_idx_flag may be defined as in Table 8 below.

[0226] [Table 8]

[0227] cu_ic_idx_flag Association Name 0 No. 1 1 No. 2

[0228] When cu_ic_idx_flag is 0, the first candidate of the reordered illumination compensation candidate list may be selected. When cu_ic_idx_flag is 1, the second candidate of the reordered illumination compensation candidate list may be selected. The index transmission of the illumination compensation candidate mode according to the present disclosure is not limited to the above example, and the range of the transmitted index value may be less than or equal to the maximum number of illumination compensation candidate modes.

[0229] Implementation 6

[0230] The present embodiment relates to a method for deriving an illumination compensation candidate mode when the prediction mode of the current block is a merge mode. When the current CU is in merge mode, the illumination compensation candidate mode information of the selected merge candidate may be used unchanged. At this time, the illumination compensation candidate mode information may indicate whether the illumination compensation candidate mode is applied and illumination compensation parameter derivation position information. Here, the position information may indicate the position of neighboring samples required when calculating the illumination compensation parameters. The illumination compensation parameters of the current CU may be calculated directly from the neighboring samples of the current block. Alternatively, the illumination compensation parameters of the current CU may use the illumination compensation parameters of neighboring blocks.

[0231] According to another embodiment of the present disclosure, when the current CU is in merge mode, whether to apply the illumination compensation candidate mode may be derived only from the selected merge candidate. When illumination compensation is used, the image encoding device 100 and / or the image decoding device 200 may derive a plurality of illumination compensation candidate modes and reorder the derived illumination compensation candidate list as in Embodiment 5. By reordering the illumination compensation candidate list, illumination compensation may be performed using a candidate with a minimum template cost.

[0232] According to another embodiment of the present disclosure, when the current CU is in merge mode, it is possible to adaptively determine whether to use the illumination compensation candidate mode information based on the illumination compensation candidate mode information of the selected merge candidate and the additional criteria of the block. The additional criteria may include various characteristics such as block size (e.g., block width and / or height), prediction type, partition type, transform type, etc. Alternatively, it may be determined whether to apply illumination compensation based on the template cost before and after illumination compensation.

[0233] Fig.15 is a flowchart illustrating a method for applying adaptive lighting compensation according to an embodiment of the present disclosure. Fig.15 In the description of the image encoding device 100 as the main body, it is obvious that the image decoding device 200 may also be the main body. The image encoding device 100 may calculate the template cost C1 before illumination compensation (S1510). Specifically, the image encoding device 100 may calculate the template difference (template cost) C1 between the template composed of neighboring samples of the current CU and the template composed of neighboring samples of the reference block. Here, the template of the reference block may be in a state where illumination compensation is not applied.

[0234] The image encoding apparatus 100 may apply illumination compensation to the template area (S1520). Specifically, the image encoding apparatus 100 may obtain information about illumination compensation from the selected merge mode. Thereafter, the image encoding apparatus 100 may use the sample at the position indicated by the information about illumination compensation to obtain illumination compensation parameters.

[0235] The image encoding device 100 may apply illumination compensation to the template area (S1530). That is, the illumination compensation parameter may be applied to the template of the reference block. Thereafter, the image encoding device 100 may calculate the template cost C2 after illumination compensation (S1540). Specifically, the image encoding device 100 may calculate the template cost C2 between the template composed of neighboring samples of the current CU and the template composed of neighboring samples of the reference block to which illumination compensation is applied.

[0236] The image encoding device 100 may determine whether to apply illumination compensation (S1550). Specifically, the image encoding device 100 may compare the difference between C1 and C2 and determine whether to apply illumination compensation according to a specific threshold. For example, if the value of C2 / C1 is greater than 0.9, illumination compensation may be applied. The present disclosure is not limited to the above example, and any real value between 0 and 10 may be used as a threshold for determining whether to apply illumination compensation.

[0237] Fig.16 16 is a flowchart illustrating a method for reordering an illumination compensation list in an image encoding device according to an embodiment of the present disclosure. The image encoding device 100 may encode information about illumination compensation of a current block (S1610). At this time, the information about illumination compensation may include at least one of information indicating whether illumination compensation can be performed on the current block, information indicating whether illumination compensation is applied to the current block, or an index indicating one of the illumination compensation candidate modes. For example, the information indicating whether illumination compensation can be performed on the current block may be sps_illumonation_compensation_enable_flag. The information indicating whether illumination compensation is applied to the current block may be cu_ic_flag. The index may be cu_ic_idx_flag.

[0238] The image encoding apparatus 100 may derive an illumination compensation parameter for each of two or more illumination compensation candidate modes for illumination compensation (S1620). Here, the illumination compensation mode may include at least one of a first mode using both left and upper neighboring regions of the current block and the reference block, a second mode using only the left neighboring region of the current block and the reference block, or a third mode using only the upper neighboring region of the current block and the reference block.

[0239] The image encoding apparatus 100 may obtain an illumination-compensated first adjacent region by applying illumination compensation to a predetermined first adjacent region adjacent to a reference block of the current block (S1630). Specifically, the image encoding apparatus 100 may obtain an illumination-compensated first adjacent region by applying illumination compensation to the first adjacent region based on illumination compensation parameters of each illumination compensation candidate mode. Here, the first adjacent region may be a template region of the reference block.

[0240] The image encoding device 100 may calculate the final error value of each illumination compensation candidate mode (S1640). Specifically, the image encoding device 100 may obtain the final error value of each illumination compensation candidate mode based on the error between the sample value in the illumination-compensated first adjacent region and the sample value in the predetermined second adjacent region adjacent to the current block. Here, the second adjacent region may be a template region of the current block. In addition, the first adjacent region and the second adjacent region may be located at corresponding positions. The final error value may be a template cost.

[0241] The image encoding apparatus 100 may reorder the illumination compensation candidate modes (S1650). Specifically, the illumination compensation candidate modes may be reordered based on the final error values ​​of the respective illumination compensation candidate modes. For example, the reordering of the illumination compensation candidate modes may be a process of sorting the final error values ​​in ascending order.

[0242] The image encoding apparatus 100 may determine an illumination compensation candidate mode of the current block (S1660). Specifically, the image encoding apparatus 100 may determine an illumination compensation candidate mode of the current block based on the reordered illumination compensation candidate modes and the information about illumination compensation.

[0243] According to another embodiment of the present disclosure, when the prediction mode of the current block is the merge mode, the information about the illumination compensation can be obtained from the information about the illumination compensation of the selected merge candidate of the current block. Here, the information about the illumination compensation of the selected merge candidate of the current block can be obtained based on at least one of the size, prediction type, partition type, or transform type of the current block.

[0244] According to another embodiment of the present disclosure, information indicating whether illumination compensation is applied to the current block may be obtained based on the first error value and the final error value of the illumination compensation candidate mode calculated based on the first adjacent area and the second adjacent area before illumination compensation. At this time, the acquisition of the information indicating whether illumination compensation is applied to the current block may be further determined based on a threshold. For example, the acquisition of the information indicating whether illumination compensation is applied to the current block may be performed by comparing the difference between the final error value and the first error value with the threshold. If the difference between the final error value and the first error value is greater than the threshold, information indicating whether illumination compensation is applied to the current block may be obtained, and if the difference between the final error value and the first error value is less than or equal to the threshold, information indicating whether illumination compensation is applied to the current block may not be obtained. Alternatively, there may be a situation opposite to the above example. For example, if the difference between the final error value and the first error value is greater than the threshold, information indicating whether illumination compensation is applied to the current block may not be obtained, and if the difference between the final error value and the first error value is less than or equal to the threshold, information indicating whether illumination compensation is applied to the current block may be obtained.

[0245] Fig.17 2 is a flowchart illustrating a method for reordering an illumination compensation list in an image decoding device according to an embodiment of the present disclosure. The image decoding device 200 may obtain information about illumination compensation for a current block (S1710). At this time, the information about illumination compensation may include at least one of information indicating whether illumination compensation can be performed on the current block, information indicating whether illumination compensation is applied to the current block, or an index indicating one of the illumination compensation candidate modes. For example, the information indicating whether illumination compensation can be performed on the current block may be sps_illumonation_compensation_enable_flag. The information indicating whether illumination compensation is applied to the current block may be cu_ic_flag. The index may be cu_ic_idx_flag.

[0246] The image decoding apparatus 200 may derive an illumination compensation parameter for each of two or more illumination compensation candidate modes for illumination compensation (S1720). Here, the illumination compensation mode may include at least one of a first mode using both left and upper neighboring regions of the current block and the reference block, a second mode using only the left neighboring region of the current block and the reference block, or a third mode using only the upper neighboring region of the current block and the reference block.

[0247] The image decoding apparatus 200 may obtain an illumination-compensated first adjacent region by applying illumination compensation to a predetermined first adjacent region adjacent to a reference block of the current block (S1730). Specifically, the image decoding apparatus 200 may obtain an illumination-compensated first adjacent region by applying illumination compensation to the first adjacent region based on illumination compensation parameters of each illumination compensation candidate mode. Here, the first adjacent region may be a template region of the reference block.

[0248] The image decoding device 200 may calculate a final error value for each illumination compensation candidate mode (S1740). Specifically, the image decoding device 200 may obtain a final error value for each illumination compensation candidate mode based on an error between a sample value in a first adjacent region that has been illumination compensated and a sample value in a predetermined second adjacent region that is adjacent to the current block. Here, the second adjacent region may be a template region of the current block. In addition, the first adjacent region and the second adjacent region may be located at corresponding positions. The final error value may be a template cost.

[0249] The image decoding apparatus 200 may reorder the illumination compensation candidate modes (S1750). Specifically, the illumination compensation candidate modes may be reordered based on the final error values ​​for the respective illumination compensation candidate modes. For example, the reordering of the illumination compensation candidate modes may be a process of sorting the final error values ​​in ascending order.

[0250] The image decoding apparatus 200 may determine an illumination compensation candidate mode for the current block (S1760). Specifically, the image decoding apparatus 200 may determine an illumination compensation candidate mode for the current block based on the reordered illumination compensation candidate modes and the information on illumination compensation.

[0251] According to another embodiment of the present disclosure, when the prediction mode of the current block is the merge mode, the information about the illumination compensation can be obtained from the information about the illumination compensation of the selected merge candidate of the current block. Here, the information about the illumination compensation of the selected merge candidate of the current block can be obtained based on at least one of the size, prediction type, partition type, or transform type of the current block.

[0252] According to another embodiment of the present disclosure, information indicating whether illumination compensation is applied to the current block may be obtained based on the first error value and the final error value for the illumination compensation candidate mode calculated based on the first adjacent area and the second adjacent area before illumination compensation. At this time, the acquisition of information indicating whether illumination compensation is applied to the current block may be further determined based on a threshold. For example, the acquisition of information indicating whether illumination compensation is applied to the current block may be performed by comparing the difference between the final error value and the first error value with the threshold. If the difference between the final error value and the first error value is greater than the threshold, information indicating whether illumination compensation is applied to the current block may be obtained, and if the difference between the final error value and the first error value is less than or equal to the threshold, information indicating whether illumination compensation is applied to the current block may not be obtained. Alternatively, there may be a situation opposite to the above example. For example, if the difference between the final error value and the first error value is greater than the threshold, information indicating whether illumination compensation is applied to the current block may not be obtained, and if the difference between the final error value and the first error value is less than or equal to the threshold, information indicating whether illumination compensation is applied to the current block may be obtained.

[0253] Although for the sake of clarity of description, the exemplary method of the present disclosure described above is represented as a series of operations, it is not intended to limit the order of executing the steps, and these steps can be performed simultaneously or in different orders when necessary. In order to implement the method according to the present invention, the steps described may further include other steps, may include the remaining steps except some steps, or may include other additional steps except some steps.

[0254] In the present disclosure, an image encoding device or an image decoding device that performs a predetermined operation (step) may perform an operation (step) of confirming an execution condition or situation of the corresponding operation (step). For example, if it is described that a predetermined operation is performed when a predetermined condition is met, the image encoding device or the image decoding device may perform the predetermined operation after determining whether the predetermined condition is met.

[0255] The various embodiments of the present disclosure are not a list of all possible combinations and are intended to describe representative aspects of the present disclosure, and matters described in the various embodiments may be applied independently or in combination of two or more.

[0256] Various embodiments of the present disclosure may be implemented in hardware, firmware, software or a combination thereof. In the case of implementing the present disclosure in hardware, the present disclosure may be implemented in an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a general purpose processor, a controller, a microcontroller, a microprocessor, etc.

[0257] In addition, the image decoding device and the image encoding device to which the embodiments of the present disclosure are applied may be included in a multimedia broadcast transmission and reception device, a mobile communication terminal, a home theater video device, a digital theater video device, a surveillance camera, a video chat device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camera, a video on demand (VoD) service provider, an OTT video (over the top video) device, an Internet streaming service provider, a three-dimensional (3D) video device, a video phone video device, a medical video device, etc., and may be used to process a video signal or a data signal. For example, an OTT video device may include a game console, a Blu-ray player, an Internet access TV, a home theater system, a smart phone, a tablet PC, a digital video recorder (DVR), etc.

[0258] Fig.18 is a diagram showing a content streaming system to which an embodiment of the present disclosure is applicable.

[0259] like Fig.18 As shown in , a content streaming system to which the embodiments of the present disclosure are applied may mainly include an encoding server, a streaming server, a network server, a media storage device, a user device, and a multimedia input device.

[0260] The encoding server compresses the content input from a multimedia input device such as a smart phone, camera, or camcorder into digital data to generate a bitstream and sends the bitstream to the streaming server. As another example, when a multimedia input device such as a smart phone, camera, or camcorder directly generates a bitstream, the encoding server can be omitted.

[0261] The bitstream may be generated by the image encoding method or the image encoding device to which the embodiments of the present disclosure are applied, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

[0262] The streaming server sends multimedia data to the user device based on the user's request through the network server, and the network server is used as a medium to inform the user of the service. When the user requests the required service from the network server, the network server can deliver it to the streaming server, and the streaming server can send the multimedia data to the user. In this case, the content streaming system may include a separate control server. In this case, the control server is used to control the command / response between the devices in the content streaming system.

[0263] The streaming server may receive content from a media storage device and / or an 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 within a predetermined time.

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

[0265] Each server in the content streaming system may operate as a distributed server, in which case data received from each server may be distributed.

[0266] The scope of the present disclosure includes software or machine-executable commands (e.g., operating systems, applications, firmware, programs, etc.) for enabling operations of methods according to various embodiments to be performed on a device or computer, and non-transitory computer-readable media having such software or commands stored thereon and executable on a device or computer.

[0267] Industrial Applicability

[0268] The embodiments of the present disclosure may be used to encode or decode an image.

Claims

1. An image decoding method performed by an image decoding device, the image decoding method comprising the following steps: Obtaining information about the lighting compensation of the current block; deriving an illumination compensation parameter for each of two or more illumination compensation candidate modes of the illumination compensation; obtaining an illumination-compensated first neighboring region by applying illumination compensation to a predetermined first neighboring region adjacent to a reference block of the current block based on the illumination compensation parameter; obtaining a final error value for each of the illumination compensation candidate modes based on an error between a sample value in the illumination compensated first adjacent area and a sample value in a predetermined second adjacent area adjacent to the current block; reordering the illumination compensation candidate modes based on the final error value; as well as determining an illumination compensation candidate mode for the current block based on the reordered illumination compensation candidate modes and the information about illumination compensation, The first adjacent area and the second adjacent area are located at corresponding positions.

2. The image decoding method according to claim 1, wherein: The information about the illumination compensation includes at least one of information indicating whether illumination compensation can be performed on the current block, information indicating whether illumination compensation is applied to the current block, or an index indicating one of the illumination compensation candidate modes.

3. The image decoding method according to claim 1, wherein: The illumination compensation candidate modes include at least one of a first mode using both the left neighboring area and the upper neighboring area of ​​the current block and the reference block, a second mode using only the left neighboring area of ​​the current block and the reference block, or a third mode using only the upper neighboring area of ​​the current block and the reference block.

4. The image decoding method according to claim 1, wherein: The reordering means sorting the final error values ​​in ascending order.

5. The image decoding method according to claim 2, wherein: The information about the illumination compensation is obtained from information about illumination compensation of a selected merge candidate of the current block based on that a prediction mode of the current block is a merge mode.

6. The image decoding method according to claim 5, wherein: The information about illumination compensation of the selected merge candidate of the current block is obtained based on at least one of a size, a prediction type, a partition type, or a transform type of the current block.

7. The image decoding method according to claim 5, wherein: The information indicating whether illumination compensation is applied to the current block is obtained according to a first error value for the illumination compensation candidate mode calculated based on the first neighboring area and the second neighboring area before illumination compensation and the final error value.

8. The image decoding method according to claim 7, wherein: The obtaining of the information indicating whether to apply the illumination compensation to the current block is further determined based on a threshold.

9. The image decoding method according to claim 8, wherein: The obtaining of the information indicating whether the illumination compensation is applied to the current block is performed by comparing a difference between the final error value and the first error value with the threshold value.

10. An image encoding method performed by an image encoding device, the image encoding method comprising the following steps: encoding information about illumination compensation of the current block; deriving an illumination compensation parameter for each of two or more illumination compensation candidate modes of the illumination compensation; obtaining an illumination-compensated first neighboring region by applying illumination compensation to a predetermined first neighboring region adjacent to a reference block of the current block based on the illumination compensation parameters for each of the illumination compensation candidate modes; obtaining a final error value for each of the illumination compensation candidate modes based on an error between a sample value in the illumination compensated first adjacent area and a sample value in a predetermined second adjacent area adjacent to the current block; reordering the illumination compensation candidate modes based on the final error value for each of the illumination compensation candidate modes; as well as determining an illumination compensation candidate mode for the current block based on the reordered illumination compensation candidate modes and the information about illumination compensation, The first adjacent area and the second adjacent area are located at corresponding positions.

11. A method for transmitting a bit stream generated by an image encoding method, the image encoding method comprising the following steps: encoding information about illumination compensation of the current block; deriving an illumination compensation parameter for each of two or more illumination compensation candidate modes of the illumination compensation; obtaining an illumination-compensated first neighboring region by applying illumination compensation to a predetermined first neighboring region adjacent to a reference block of the current block based on the illumination compensation parameters for each of the illumination compensation candidate modes; obtaining a final error value for each of the illumination compensation candidate modes based on an error between a sample value in the illumination compensated first adjacent area and a sample value in a predetermined second adjacent area adjacent to the current block; reordering the illumination compensation candidate modes based on the final error value for each of the illumination compensation candidate modes; as well as determining an illumination compensation candidate mode for the current block based on the reordered illumination compensation candidate modes and the information about illumination compensation, The first adjacent area and the second adjacent area are located at corresponding positions.