Intra prediction mode-based image encoding / decoding method and apparatus using multiple reference line (MRL), and recording medium storing bit stream

By using multi-reference line (MRL) technology in image encoding/decoding, using intra prediction mode and multiple reference sample lines to generate and fuse prediction blocks, the problem of low image encoding/decoding efficiency in the prior art is solved, and more efficient image processing and storage is achieved.

CN119769094APending Publication Date: 2025-04-04LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380061698.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-08-25
Filing Date
2023-08-25
Publication Date
2025-04-04

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 multiple reference lines (MRL), multiple prediction blocks are generated through intra prediction mode and multiple reference sample lines, and weighted fusion is performed to improve encoding/decoding efficiency.

Benefits of technology

Improves the efficiency of image encoding/decoding, reduces transmission and storage costs, and supports the use of intra prediction mode and multiple reference lines, enhancing the flexibility of image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119769094A_ABST
    Figure CN119769094A_ABST
Patent Text Reader

Abstract

Provided are an image encoding / decoding method and apparatus. An image decoding method according to the present disclosure may comprise the steps of: obtaining a plurality of intra prediction modes and a plurality of reference sample lines of a current block; generating a plurality of prediction blocks of the current block based on the plurality of intra prediction modes and the plurality of reference sample lines; and generating a final prediction block of the current block based on the weighted sum of the plurality of prediction blocks.
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, an apparatus, and a recording medium for storing a bit stream, and more specifically, to a multi-reference line (MRL)-based image encoding / decoding method, an apparatus, and a recording medium for storing a bit stream generated by the image encoding method / apparatus 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, the present disclosure is directed to providing an image encoding / decoding method and apparatus for performing an intra-frame prediction mode.

[0007] In addition, the present disclosure is directed to providing an image encoding / decoding method and apparatus for performing an intra prediction mode using MRL (Multi-Reference Line).

[0008] In addition, the present disclosure aims to provide an image encoding / decoding method and apparatus for fusing a plurality of prediction blocks generated using MRL.

[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 apparatus 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 herein will be apparent to those skilled in the art through the following description.

[0013] Technical Solution

[0014] According to one embodiment of the present disclosure, an image decoding method performed by an image decoding device may include the following steps: obtaining multiple intra-frame prediction modes and multiple reference sample lines of a current block; generating multiple prediction blocks of the current block based on the multiple intra-frame prediction modes and the multiple reference sample lines; and generating a final prediction block of the current block based on a weighted sum of the multiple prediction blocks.

[0015] According to one embodiment of the present disclosure, based on information indicating that a second intra prediction mode among multiple intra prediction modes is not obtained from a bitstream, the second prediction mode may be derived as one of a predetermined mode or a most probable mode (MPM) candidate mode.

[0016] According to an embodiment of the present disclosure, based on the intra prediction mode of the current block and the intra prediction mode of the neighboring block, a second reference sample line among the plurality of reference sample lines may be determined based on the size of the neighboring block.

[0017] According to one embodiment of the present disclosure, based on the existence of two or more neighboring blocks having the same intra prediction mode as that of the current block, a second reference sample line among multiple reference sample lines may be determined based on widths and heights of the neighboring blocks.

[0018] According to one embodiment of the present disclosure, the neighboring blocks may include a left neighboring block and an upper neighboring block, and based on the width of the left neighboring block being less than or equal to the height of the upper neighboring block, the second reference sample line may be determined as a reference sample line that is separated from the current block by the width of the left neighboring block, and based on the width of the left neighboring block being greater than the height of the upper neighboring block, the second reference sample line may be determined as a reference sample line that is separated from the current block by the height of the upper neighboring block.

[0019] According to one embodiment of the present disclosure, the weight may be determined based on at least one of the size of the current block, the shape of the current block, the intra prediction mode of the current block, the distance between the current block and the reference sample line, or the cost based on template matching.

[0020] According to one embodiment of the present disclosure, multiple prediction blocks may include a first prediction block generated based on a first reference sample line and a second prediction block generated based on a second reference sample line, the first reference sample line may be located closer to the current block than the second reference sample line, and based on the size of the current block being greater than or equal to a threshold, a first weight applied to the first prediction block may be less than a second weight applied to the second prediction block, and based on the size of the current block being less than the threshold, the first weight may be greater than the second weight.

[0021] According to one embodiment of the present disclosure, multiple prediction blocks may include a first prediction block generated based on a first reference sample line and a second prediction block generated based on a second reference sample line, the first reference sample line may be located closer to the current block than the second reference sample line, and based on the intra-frame prediction mode of the current block being a DC mode or a planar mode, a first weight applied to the first prediction block may be greater than a second weight applied to the second prediction block.

[0022] According to one embodiment of the present disclosure, multiple prediction blocks may include a first prediction block generated using a directional prediction mode in a vertical direction and a second prediction block generated using a directional prediction mode in a horizontal direction, and based on the width of the current block being greater than or equal to the height of the current block, the first weight applied to the first prediction block may be greater than the second weight applied to the second prediction block, and based on the width of the current block being less than the height of the current block, the first weight may be less than the second weight.

[0023] According to one embodiment of the present disclosure, the weight may be determined based on the distance between the position of the sample included in the current block and the reference sample line.

[0024] According to one embodiment of the present disclosure, the cost based on template matching may include a first template cost calculated based on a first reference sample line and a second template cost calculated based on a second reference sample line, and the weight may be determined based on a comparison of the first template cost and the second template cost.

[0025] According to one embodiment of the present disclosure, an image encoding method performed by an image encoding device may include the following steps: obtaining multiple intra-frame prediction modes and multiple reference sample lines of a current block; generating multiple prediction blocks of the current block based on the multiple intra-frame prediction modes and the multiple reference sample lines; and generating a final prediction block of the current block based on a weighted sum of the multiple prediction blocks.

[0026] According to one embodiment of the present disclosure, a computer-readable recording medium storing a bit stream generated by an image encoding method may be included.

[0027] According to one embodiment of the present disclosure, in a method for sending a bit stream generated by an image encoding method, the image encoding method may include the following steps: obtaining multiple intra-frame prediction modes and multiple reference sample lines of a current block; generating multiple prediction blocks of the current block based on the multiple intra-frame prediction modes and the multiple reference sample lines; and generating a final prediction block of the current block based on a weighted sum of the multiple prediction blocks.

[0028] Beneficial Effects

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

[0030] In addition, according to the present disclosure, it is possible to provide an image encoding / decoding method and apparatus for performing an intra prediction mode.

[0031] In addition, according to the present disclosure, it is possible to provide an image encoding / decoding method and apparatus for performing an intra prediction mode using MRL (Multi-Reference Line).

[0032] In addition, the present disclosure aims to provide an image encoding / decoding method and apparatus that fuses a plurality of prediction blocks generated using MRL.

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

[0034] Furthermore, according to the present disclosure, 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 can be provided.

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

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

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

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

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

[0040] Figure 4 is a flowchart illustrating a video / image encoding method based on intra-frame prediction.

[0041] Figure 5 is a diagram illustrating a configuration of an intra prediction unit according to the present disclosure.

[0042] Figure 6 is a flowchart illustrating a video / image decoding method based on intra-frame prediction.

[0043] Figure 7 is a diagram illustrating a configuration of an intra prediction unit according to the present disclosure.

[0044] Figure 8 is a diagram illustrating a template region and a reference sample used in TIMD according to the present disclosure.

[0045] Fig. 9 is a diagram illustrating a method of constructing a Histogram of Gradients (HoG) in a DIMD mode according to the present disclosure.

[0046] Fig.10 is a diagram illustrating a method of constructing a prediction block when a DIMD mode is applied according to the present disclosure.

[0047] Fig.11 is a diagram illustrating multiple reference sample lines for fusing a prediction block according to the present disclosure.

[0048] Fig.12 and Fig.13 is a flowchart illustrating a method of signaling and obtaining an intra prediction mode and a reference sample line index according to the present disclosure.

[0049] Figures 14 to 17 is a diagram illustrating an example of a method of deriving a reference sample line according to the present disclosure.

[0050] Figures 18 to 21 is a diagram illustrating an example of a method of determining a weight applied when fusing a plurality of prediction blocks according to the present disclosure.

[0051] Fig. 22 is a diagram illustrating a template area for acquiring a template cost according to the present disclosure.

[0052] Fig.23 is a flowchart of an image encoding method according to the present disclosure.

[0053] Fig.24 is a flowchart of an image decoding method according to the present disclosure.

[0054] Fig.25 is a diagram showing a content streaming system to which an embodiment of the present disclosure is applicable. DETAILED DESCRIPTION

[0055] 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 may be implemented in various forms and is not limited to the embodiments described herein.

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

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

[0058] In the present disclosure, the terms first, second, etc. may be 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.

[0059] 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 otherwise specified, these embodiments in which the components are integrated or the components are distributed are also included in the scope of the present disclosure.

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

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

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

[0063] In the present disclosure, "picture" generally means the basis of representing an image within a specific time period, and a slice / tile is a coding unit that constitutes a part of a picture. 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).

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

[0065] 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 ​​the picture and information related to the area. A unit may include a luminance block and two chrominance (e.g., Cb, Cr) blocks. 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.

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

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

[0068] In the present disclosure, the slash " / " or "," should be interpreted as indicating "and / or". For example, the expressions "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".

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

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

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

[0072] Overview of Video Coding Systems

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

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

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

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

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

[0078] The transmitter 13 may transmit the encoded video / image information or data output in the form of a bit stream to the receiver 21 of the decoding device 20 in the form of a file or stream through a digital storage medium or a network. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The 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 encoder 12. In this case, the transmitting device includes: at least one processor that obtains the encoded video / image information or data output in the form of a bit stream; and a transmitter that delivers the encoded video / image information or data in the form of a file or stream. The receiver 21 may extract / receive a bit stream from a storage medium or a network and transmit the bit stream to the decoder 22.

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

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

[0081] Overview of Image Coding Equipment

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

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

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

[0085] 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 the binary tree structure and / or the ternary tree structure may be applied later. 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.

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

[0087] The intra prediction unit 185 can predict the current block by referring to the samples in the current picture. Depending on the intra prediction mode and / or the 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.

[0088] The inter prediction unit 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 sent in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may also include inter prediction direction (L0 prediction, L1 prediction, Bi 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 co-located 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 configure a motion information candidate list based on the neighboring blocks and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes. 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, a residual signal may not be sent. 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.

[0089] The prediction unit may generate a prediction signal based on various prediction methods and prediction techniques described below. For example, the prediction unit may apply not only intra prediction or inter prediction, but also both intra prediction and inter prediction at the same time to predict the current block. The prediction method of applying both intra prediction and inter prediction 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 of the inter prediction techniques described in the present disclosure.

[0090] 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 sent to the transformer 120.

[0091] 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 rather than square.

[0092] The quantizer 130 may quantize the transform coefficients and send 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.

[0093] The entropy encoder 190 may perform various encoding methods, such as, for example, 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.

[0094] The bit stream may be transmitted through 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) that transmits a signal output from the entropy encoder 190 and / or a storage unit (not shown) that stores 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.

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

[0096] 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 the case where 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.

[0097] In addition, as described below, chroma scaling and luminance mapping (LMCS) is applied to the picture coding process.

[0098] 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 send 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.

[0099] The modified reconstructed picture transmitted 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.

[0100] 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 for deriving (or encoding) the motion information in the current picture and / or the motion information of the reconstructed block in the picture. The stored motion information may be sent 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.

[0101] Overview of Image Decoding Equipment

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

[0103] 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 260 and the intra-frame prediction unit 265 may be collectively referred to as a "prediction unit". The dequantizer 220 and the inverse transformer 230 may be included in a residual processor.

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

[0105] 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 100. Therefore, the processing unit of decoding may be, for example, a coding unit. The coding unit may be obtained by partitioning a coding tree unit or a 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).

[0106] 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 200 may also decode the picture based on the information about the parameter set and / or the general constraint information. The signaled / received information and / or syntax elements 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 prediction among 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 (ie, quantized transform coefficient and related parameter information) for which entropy decoding is performed in the entropy decoder 210 can be input to the dequantizer 220. In addition, the information about filtering among 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 100 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 .

[0107] In addition, the image decoding device 200 according to the present disclosure may be referred to as a video / image / picture decoding device. The image decoding device 200 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.

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

[0109] The inverse transformer 230 may perform an inverse transformation on the transformation coefficients to obtain a residual signal (residual block, residual sample array).

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

[0111] 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) to be described later.

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

[0113] 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 sent 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, Bi 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.

[0114] 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-prediction unit 265). If the block to be processed has no residual, such as when the skip mode is applied, the prediction block can be used as the 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.

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

[0116] The (modified) reconstructed picture stored in the DPB of the memory 250 can be used as a reference picture in the inter-frame prediction unit 260. The memory 250 can store the motion information of the block for deriving (or decoding) the motion information in the current picture and / or the motion information of the reconstructed block in the picture. The stored motion information can be sent 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 can store the reconstructed samples of the reconstructed block in the current picture and transmit the reconstructed samples to the intra-frame prediction unit 265.

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

[0118] Overview of intra prediction

[0119] Hereinafter, intra prediction according to the present disclosure will be described.

[0120] Intra-frame prediction may refer to a prediction for generating a prediction sample of a current block based on a reference sample in a picture to which the current block belongs (hereinafter referred to as the current picture). When intra-frame prediction is applied to the current block, neighboring reference samples to be used for intra-frame prediction of the current block may be derived. The neighboring reference samples of the current block may include: a total of 2×nh samples including a sample of size nW×nH adjacent to the left boundary of the current block and a sample adjacent to the lower left, a total of 2×nW samples including a sample adjacent to the upper boundary of the current block and a sample adjacent to the upper right, and a sample adjacent to the upper left of the current block. Alternatively, the neighboring reference samples of the current block may include multiple columns of upper neighboring samples and multiple rows of left neighboring samples. In addition, the neighboring reference samples of the current block may include: a total of nH samples of size nW×nH adjacent to the right boundary of the current block, a total of nW samples adjacent to the lower boundary of the current block, and a sample adjacent to the lower right of the current block.

[0121] However, some neighboring reference samples of the current block have not been decoded or may not be available. In this case, the image decoding device 200 can construct neighboring reference samples to be used for prediction by replacing unavailable samples with available samples. Alternatively, the neighboring reference samples to be used for prediction can be constructed by interpolation of available samples.

[0122] When deriving neighboring reference samples, (i) the prediction sample may be derived based on an average or interpolation of neighboring reference samples of the current block, and (ii) the prediction sample may be derived based on reference samples existing in a specific (prediction) direction relative to the prediction sample among neighboring reference samples of the current block. The case of (i) may be referred to as a non-directional mode or a non-angular mode, and the case of (ii) may be referred to as a directional mode or an angular mode.

[0123] In addition, the prediction sample can be generated by interpolating the first neighboring sample set in the prediction direction of the intra prediction mode of the current block based on the prediction target sample of the current block among the neighboring reference samples and the second neighboring sample set in the opposite direction thereof. The above situation can be called linear interpolation intra prediction (LIP).

[0124] In addition, a linear model can be used to generate chrominance prediction samples based on luma samples. This case can be called LM (linear model) mode.

[0125] In addition, the temporary prediction sample of the current block can be derived based on the filtered neighboring reference sample, and the prediction sample of the current block can be derived by the weighted sum of at least one reference sample derived according to the intra prediction mode among the temporary prediction sample and the existing neighboring reference sample (that is, the unfiltered neighboring reference sample). The above situation can be called position-dependent intra prediction (PDPC).

[0126] In addition, a reference sample line with the highest prediction accuracy is selected from a plurality of adjacent reference sample lines of the current block to derive a prediction sample using a reference sample located in the prediction direction in the corresponding line, and at this time, information about the reference sample line used (e.g., intra_luma_ref_idx) may be encoded in the bitstream and signaled. This situation may be referred to as multi-reference line (MRL) intra prediction or MRL-based intra prediction. When MRL is not applied, reference samples may be derived from reference sample lines directly adjacent to the current block, and in this case, information about the reference sample line may not be signaled.

[0127] In addition, the current block can be divided into vertical or horizontal sub-partitions, and for each sub-partition, intra prediction can be performed based on the same intra prediction mode. In this case, the neighboring reference samples for intra prediction can be derived in units of sub-partitions. That is, the reconstructed samples of the previous sub-partition in the encoding / decoding order can be used as neighboring reference samples for the current sub-partition. In this case, the intra prediction mode of the current block is equally applied to the sub-partitions, but in some cases, the intra prediction performance can be improved by deriving and using neighboring reference samples in units of sub-partitions. This prediction method may be referred to as intra sub-partitioning (ISP) or intra prediction based on ISP.

[0128] These intra-frame prediction techniques may be referred to as intra-frame prediction types or additional intra-frame prediction modes to distinguish them from directional or non-directional intra-frame prediction modes. Intra-frame prediction techniques (intra-frame prediction types, additional intra-frame prediction modes, etc.) may be referred to as various terms such as intra-frame prediction techniques or additional intra-frame prediction modes. For example, the intra-frame prediction type (or additional intra-frame prediction mode, etc.) may include at least one of the above-mentioned LIP, LM, PDPC, MRL or ISP. Common intra-frame prediction methods that exclude specific intra-frame prediction types such as LIP, LM, PDPC, MRL and ISP may be referred to as normal intra-frame prediction types. Normal intra-frame prediction types can generally be applied when the above specific intra-frame prediction types are not applied, and predictions can be performed based on the above intra-frame prediction modes. In addition, if necessary, post-processing filtering may be performed on the derived prediction samples.

[0129] Specifically, the intra prediction process may include an intra prediction mode / type determination step, a neighboring reference sample derivation step, and a prediction sample derivation step based on the intra prediction mode / type. In addition, if necessary, a post-filtering step may be performed on the derived prediction samples.

[0130] In addition, in addition to the above-mentioned intra prediction types, affine linear weighted intra prediction (ALWIP) can also be used. ALWIP can also be called linear weighted intra prediction (LWIP) or matrix weighted intra prediction (MWIP) or matrix-based intra prediction (MIP). If MIP is applied to the current block, i) use the neighboring reference samples for which the averaging process has been performed, ii) perform the matrix vector multiplication process, and iii) further perform the horizontal / vertical interpolation process when necessary to derive the prediction sample for the current block. The intra prediction mode for MIP can be configured to be different from the intra prediction mode used in LIP, PDPC, MRL, ISP intra prediction or normal intra prediction. The intra prediction mode for MIP can be called MIP intra prediction mode, MIP prediction mode or MIP mode. For example, the matrix and offset used in the matrix vector multiplication can be set differently according to the intra prediction mode for MIP. Here, the matrix can be called a (MIP) weighting matrix, and the offset can be called a (MIP) offset vector or a (MIP) offset vector. The specific MIP method will be described later.

[0131] Will refer to later Figure 4 and Figure 5 A block reconstruction process based on intra prediction and intra prediction units in an encoding device is described.

[0132] Figure 4 is a flowchart illustrating a video / image encoding method based on intra-frame prediction.

[0133] Can be Figure 2 The image encoding device 100 performs Figure 4 Coding method. Specifically, step S410 can be performed by the intra prediction unit 185, and step S420 can be performed by the residual processor. Specifically, step S420 can be performed by the subtractor 115. Step S430 can be performed by the entropy encoder 190. The prediction information of step S430 can be derived by the intra prediction unit 185, and the residual information of step S430 can be derived by the residual processor. The residual information is information about the residual sample. The residual information may include information about the quantized transform coefficient of the residual sample. As described above, the residual sample can be derived as a transform coefficient by the transformer 120 of the image encoding device 100, and the transform coefficient can be derived as a quantized transform coefficient by the quantizer 130. The information about the quantized transform coefficient can be encoded by the entropy encoder 190 through the residual encoding process.

[0134] The image encoding apparatus 100 may perform intra prediction for the current block (S410). The image encoding apparatus 100 may derive an intra prediction mode / type of the current block, derive neighboring reference samples of the current block, and generate prediction samples in the current block based on the intra prediction mode / type and the neighboring reference samples. Here, the process for determining the intra prediction mode / type, the process for deriving neighboring reference samples, and the process for generating prediction samples may be performed simultaneously, or any one process may be performed before the other process.

[0135] Figure 5 is a diagram illustrating a configuration of the intra prediction unit 185 according to the present disclosure.

[0136] like Figure 5 As shown, the intra prediction unit 185 of the image encoding device 100 may include an intra prediction mode / type determination unit 186, a reference sample derivation unit 187, and a prediction sample derivation unit 188. The intra prediction mode / type determination unit 186 may determine the intra prediction mode / type of the current block, the reference sample derivation unit 187 may derive the neighboring reference samples of the current block, and the prediction sample derivation unit 188 may derive the prediction sample of the current block. In addition, although not shown, when performing the prediction sample filtering process described below, the intra prediction unit 185 may further include a prediction sample filter (not shown).

[0137] The image encoding apparatus 100 may determine a mode / type applied to a current block from among a plurality of intra prediction modes / types. The encoding apparatus 100 may compare RD costs of intra prediction modes / types and determine an optimal intra prediction mode / type for the current block.

[0138] In addition, the image encoding device 100 may perform a prediction sample filtering process. Prediction sample filtering may be referred to as post-filtering. Some or all of the prediction samples may be filtered by the prediction sample filtering process. In some cases, the prediction sample filtering process may be omitted.

[0139] Refer again Figure 4 , the image encoding apparatus 100 may generate a residual sample of the current block based on the prediction sample or the filtered prediction sample (S420). The image encoding apparatus 100 may derive the residual sample by subtracting the prediction sample from the original sample of the current block. That is, the image encoding apparatus 100 may derive the residual sample value by subtracting the prediction sample value from the original sample value.

[0140] The image encoding device 100 may encode image information including information about intra prediction (prediction information) and residual information of residual samples (S430). The prediction information may include intra prediction mode information and intra prediction type information. The image encoding device 100 may output the encoded image information in the form of a bit stream. The output bit stream may be sent to the image decoding device 200 via a storage medium or a network.

[0141] The residual information may include the following residual encoding syntax. The image encoding apparatus 100 may transform / quantize the residual samples to derive quantized transform coefficients. The residual information may include information about the quantized transform coefficients.

[0142] In addition, as described above, the image encoding device 100 can generate a reconstructed picture (including reconstructed samples and reconstructed blocks). To this end, the image encoding device 100 can perform dequantization / inverse transformation on the quantized transform coefficients again to derive (modified) residual samples. The residual samples are transformed / quantized and then dequantized / inverse transformed to derive residual samples that are the same as the residual samples derived in the image decoding device 200 as described above. The image encoding device 100 can generate a reconstructed block including reconstructed samples of the current block based on the predicted samples and the (modified) residual samples. A reconstructed picture of the current picture can be generated based on the reconstructed block. As described above, the in-loop filtering process is further applicable to the reconstructed picture.

[0143] Figure 6 is a flowchart illustrating a video / image decoding method based on intra-frame prediction.

[0144] The image decoding apparatus 200 may perform an operation corresponding to an operation performed by the image encoding apparatus 100 .

[0145] Figure 6 The decoding method can be obtained by Figure 3 The image decoding device 200 is performed. S610 to S630 can be performed by the intra prediction unit 265 of the decoding device, and the prediction information of S610 and the residual information of S640 can be obtained from the bit stream by the entropy decoder 210. The residual processor of the image decoding device 200 can derive the residual samples of the current block based on the residual information (S640). Specifically, the dequantizer 220 of the residual processor can perform dequantization based on the quantized transform coefficient derived from the residual information to derive the transform coefficient, and the inverse transformer 230 of the residual processor can perform inverse transform on the transform coefficient to derive the residual sample of the current block. Step S650 can be performed by the adder 235 or the reconstructor of the decoding device.

[0146] Specifically, the image decoding device 200 can derive the intra prediction mode / type of the current block based on the received prediction information (intra prediction mode / type information) (S610). The image decoding device 200 can derive the neighboring reference samples of the current block (S620). The image decoding device 200 can generate the prediction samples in the current block based on the intra prediction mode / type and the neighboring reference samples (S630). In this case, the image decoding device 200 can perform a prediction sample filtering process. Prediction sample filtering can be referred to as post filtering. Some or all of the prediction samples in the prediction sample can be filtered by the prediction sample filtering process. In some cases, the prediction sample filtering process can be omitted.

[0147] The image decoding device 200 generates a residual sample of the current block based on the received residual information (S640). The image decoding device 200 can generate a reconstructed sample of the current block based on the predicted sample and the residual sample, and derive a reconstructed block including the reconstructed sample (S650). A reconstructed picture of the current picture can be generated based on the reconstructed block. As described above, the in-loop filtering process is further applicable to the reconstructed picture.

[0148] Figure 7 is a diagram illustrating a configuration of the intra prediction unit 265 according to the present disclosure.

[0149] like Figure 7 As shown, the intra prediction unit 265 of the image decoding device 200 may include an intra prediction mode / type determination unit 266, a reference sample derivation unit 267, and a prediction sample derivation unit 268. The intra prediction mode / type determination unit 266 may determine the intra prediction mode / type of the current block based on the intra prediction mode / type information obtained by the intra prediction mode / type determination unit 186 of the image encoding device 100, the reference sample derivation unit 267 may derive the neighboring reference samples of the current block, and the prediction sample derivation unit 268 may derive the prediction sample of the current block. In addition, although not shown, when performing the above-mentioned prediction sample filtering process, the intra prediction unit 265 may further include a prediction sample filter (not shown).

[0150] The intra-frame prediction mode information may include flag information (e.g., intra_luma_mpm_flag) specifying whether the most probable mode (MPM) or the remaining modes are applied to the current block, and when MPM is applied to the current block, the intra-frame prediction mode information may also include index information (e.g., intra_luma_mpm_idx) specifying one of the intra-frame prediction mode candidates (MPM candidates). The intra-frame prediction mode candidates (MPM candidates) may be configured as an MPM candidate list or an MPM list. In addition, when MPM is not applied to the current block, the intra-frame prediction mode information may also include remaining mode information (e.g., intra_luma_mpm_remainder) specifying one of the remaining intra-frame prediction modes other than the intra-frame prediction mode candidates (MPM candidates). The image decoding device 200 may determine the intra-frame prediction mode of the current block based on the intra-frame prediction mode information.

[0151] In addition, the intra-frame prediction technology information can be implemented in various forms. For example, the intra-frame prediction technology information may include intra-frame prediction technology index information specifying one of the intra-frame prediction technologies. As another example, the intra-frame prediction technology information may include reference sample line information (e.g., intra_luma_ref_idx) specifying whether MRL is applied to the current block and which reference sample line to use if applied, ISP flag information (e.g., intra_subpartitions_mode_flag) specifying whether ISP is applied to the current block, ISP type information (e.g., intra_subpartitions_split_flag) specifying the type of division of the sub-partition when ISP is applied, specifying whether PDCP is applied or at least one of flag information specifying whether LIP is applied. In addition, the intra-frame prediction type information may include a MIP flag specifying whether MIP is applied to the current block. In the present disclosure, the ISP flag information may be referred to as an ISP application indicator.

[0152] The intra-frame prediction mode information and / or the intra-frame prediction type information may be encoded / decoded by the encoding method described in the present disclosure. For example, the intra-frame prediction mode information and / or the intra-frame prediction type information may be encoded / decoded by entropy encoding (e.g., CABAC or CAVLC) based on a truncated binary code.

[0153] In addition, in addition to the planar mode, DC mode and directional intra prediction mode, the intra prediction mode may also include a cross-component linear model (CCLM) mode for chroma samples. The CCLM mode may be divided into L_CCLM, T_CCLM, LT_CCLM according to whether the left sample, the upper sample or both are considered for CCLM parameter derivation, and may be applied only to the chroma component.

[0154] The intra prediction modes may be indexed, for example, as shown in Table 1 below.

[0155] [Table 1]

[0156] Intra prediction mode Association Name 0 INTRA_PLANAR 1 INTRA_DC 2..66 INTRA_ANGULAR2..INTRA_ANGULAR66 81..83 INTRA_LT_CCLM,INTRA_L_CCLM,INTRA_T_CCLM

[0157] In addition, the intra prediction type (or additional intra prediction mode) may include at least one of LIP, PDPC, MRL, ISP, or MIP. The intra prediction type may be indicated based on the intra prediction type information, and the intra prediction type information may be implemented in various forms. For example, the intra prediction type information may include intra prediction type index information indicating one of the intra prediction types. As another example, the intra prediction type information may include at least one of the following items: reference sample line information indicating whether MRL is applied to the current block and which reference sample line is used if applicable (e.g., intra_luma_ref_idx); ISP flag information indicating whether ISP is applied to the current block (e.g., Intra_subpartitions_mode_flag); ISP type information indicating the split type of the sub-partition when applying ISP (e.g., Intra_subpartitions_split_flag); flag information indicating whether PDCP is applied; or flag information indicating whether LIP is applied. In addition, the intra prediction type information may include a MIP flag (or referred to as intra_mip_flag) indicating whether MIP is applied to the current block.

[0158] Overview of Template-based Intra Mode Derivation (TIMD)

[0159] Figure 8 8 is a diagram showing a template region and reference samples used in TIMD according to the present disclosure. TIMD may be a mode in which, for intra prediction modes (IPMs) of adjacent intra blocks and inter blocks, the sum of absolute transform differences (SATD) between the predicted blocks predicted from the template region 810 and the actual reconstructed samples is calculated, and then the mode with the smallest SATD is selected as the intra mode of the current block.

[0160] According to another embodiment of the present disclosure, the present disclosure may select two modes with minimum SATD, and then generate prediction blocks for the two selected prediction modes respectively. The prediction block of the current block may be generated by fusing the two generated prediction blocks using a weighted sum method. Here, the method of fusing the two modes may be performed when the condition of the following formula 1 is satisfied.

[0161] [Formula 1]

[0162] costMode2<2*costMode1

[0163] Herein, costMode1 may refer to a mode having the smallest SATD. In addition, costMode2 may refer to a mode having the second smallest SATD.

[0164] If the condition of Mathematical Expression 1 is satisfied, the final prediction block can be generated by mixing the prediction blocks generated by the two modes. Otherwise, the final prediction block can be generated using only one mode with the minimum SATD value.

[0165] When a prediction block generated by two prediction modes with the minimum SATD is mixed, the weight ratio applied may be as shown in Equation 2 below.

[0166] [Formula 2]

[0167] weight1=costMode2 / (costMode1+costMode2)

[0168] weight2=1-weight1

[0169] Herein, weight1 may mean a weight applied to a prediction block generated based on a mode with the smallest SATD. In addition, weight2 may mean a weight applied to a prediction block generated based on a mode with the second smallest SATD.

[0170] Overview of Decoder-side Intra Mode Derivation (DIMD)

[0171] Fig. 9 2 is a diagram illustrating a method of constructing a gradient histogram (HoG) in a DIMD mode according to the present disclosure. The DIMD mode according to the present disclosure can be derived and used in the image encoding device 100 and the image decoding device 200 without directly transmitting the intra prediction mode information. The DIMD mode can be performed by obtaining a horizontal gradient and a vertical gradient from a second neighboring reference row and column adjacent to the current block and thereby constructing a HoG.

[0172] Reference Fig. 9 , the HoG may be obtained by applying a Sobel filter around the current block using 3-pixel L-shaped columns and rows 910. At this time, if the boundaries of the blocks exist in different CTUs, the neighboring pixels of the current block may not be used for texture analysis.

[0173] In addition, the Sobel filter may also be referred to as a Sobel operator, which may be an efficient filter for detecting edges. When using the Sobel filter, two types of Sobel filters may be used: a Sobel filter for a vertical direction and a Sobel filter for a horizontal direction.

[0174] Fig.10is a diagram illustrating a method of constructing a prediction block when a DIMD mode is applied according to the present disclosure. Fig.10 , the DIMD mode can construct a final prediction block 1050 by selecting two intra modes 1010 with the largest histogram size, mixing prediction blocks 1020 and 1030 predicted by the two selected intra modes and a prediction block 1040 predicted in the planar mode. At this time, the weight applied when mixing the prediction blocks can be derived from the histogram size 1060. In addition, a DIMD flag can be sent in units of blocks to check whether DIMD is used.

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

[0176] Implementation Method 1

[0177] An embodiment according to the present disclosure may be a method for fusing a plurality of prediction blocks predicted using an intra prediction mode and a reference sample line.

[0178] Fig.11 is a diagram illustrating a plurality of reference sample lines for fusing a prediction block according to the present disclosure. Fig.11 , the present disclosure may generate a prediction block using the reference sample line α1110. In addition, the present disclosure may generate a prediction block using the reference sample line β1120. A new prediction block (final prediction block) may be generated by fusing the prediction block generated using the reference sample line α1110 and the prediction block generated using the reference sample line β1120. Here, α and β may be integers greater than or equal to 0.

[0179] According to another embodiment of the present disclosure, when fusion is applied to k prediction blocks, the final prediction block Pred Final It can be derived as shown in the following formula 3.

[0180] [Formula 3]

[0181]

[0182] Among them, Pred i It can be the kth prediction block predicted using the intra prediction mode and the reference sample line. i The weight used for the fusion of the prediction block may be represented. The intra prediction mode used in the present disclosure may include a planar mode, a DC mode, and a directional mode, and 0 or more reference sample lines may be used. Here, the 0th reference sample line may mean a reference sample line with an index of 0. That is, the 0th reference sample line may mean the first reference sample line closest to the current block. In addition, each prediction block Pred iDifferent intra prediction modes and different reference sample lines can be used for prediction.

[0183] According to another embodiment of the present disclosure, when fusion is applied to two prediction blocks, the final prediction block Pred Final It can be derived as shown in the following formula 4.

[0184] [Formula 4]

[0185] Pred Final =w×Pred m,α +(1-w)×Pred n,β

[0186] Among them, Pred m,α It can represent the predicted block predicted using intra prediction mode m and reference sample line α. n,β may represent a prediction block predicted using intra prediction mode n and reference sample line β. In addition, w may represent a weight used for fusion. In this case, m and n may be the same or different, and α and β may also be the same or different.

[0187] For example, when the prediction block Pred is predicted using a reference sample line α greater than 0 and a directional mode m m,α , and the prediction block Pred using reference sample line 0 and planar mode (or DC mode) prediction planar,0 When fusion is applied, the final prediction block can be derived as shown in Equation 5 below.

[0188] [Formula 5]

[0189] Pred Final =w×Pred m,α +(1-w)×Pred Planar,0

[0190] According to another embodiment of the present disclosure, when fusion is applied to three prediction blocks, the final prediction block Pred Final It can be derived as shown in the following formula 6.

[0191] [Formula 6]

[0192] Pred Final =w1×Pred m,α +w2×Pred n,β +w3×Pred l,γ

[0193] Among them, Pred m,α It can represent the prediction block predicted using intra prediction mode m and reference sample line α. n,βIt can represent the prediction block predicted using intra prediction mode n and reference sample line β. l,γ It can represent a prediction block predicted using intra prediction mode l and reference sample line γ. In addition, w1, w2, w3 can be weights used to merge the prediction blocks. In this case, w1+w2+w3 can be 1. In addition, m, n, l can be the same or different, and α, β, γ can also be the same or different.

[0194] According to one embodiment of the present disclosure, when the intra prediction modes used to predict each prediction block are different from each other, one intra prediction mode may be signaled, and the image decoding device 200 may derive the remaining intra prediction modes without signaling. For example, the intra mode may be derived using DIMD or TIMD. In addition, the remaining intra prediction modes may be determined by an agreement between the image encoding device 100 and the image decoding device 200.

[0195] As another example, one intra prediction mode may be signaled to predict each prediction block, and the remaining intra prediction modes may be fixed as a plane mode or a DC mode. Alternatively, one intra prediction mode may be signaled to predict each prediction block, and the remaining intra prediction modes may be signaled as one of a most probable mode (MPM) candidate list. That is, the remaining intra prediction modes may be determined from the MPM candidates in the MPM candidate list. In this case, the MPM candidate list may consist of the intra prediction modes of the neighboring blocks of the prediction block. That is, the MPM candidate list may consist of the intra prediction modes of the neighboring blocks of the current block to be predicted.

[0196] Alternatively, one intra prediction mode may be signaled to predict each prediction block, and the remaining intra prediction modes may be transmitted as one mode in a specific mode list. For example, the specific mode list may be composed of modes 0, 1, 18, 50, 34, and 66 regardless of neighboring modes, and the image encoding apparatus 100 and the image decoding apparatus 200 may signal and obtain one of them.

[0197] Fig.12 is a flowchart illustrating a method of signaling and obtaining an intra prediction mode and a reference sample line index according to the present disclosure. Fig.12 The subject may be the image encoding device 100 or the image decoding device 200.

[0198] according to Fig.12, the image encoding apparatus 100 and the image decoding apparatus 200 may signal and obtain a first intra prediction mode and mrl_idx (S1210). Here, mrl_idx may be an index indicating a first reference sample line. That is, the image encoding apparatus 100 and the image decoding apparatus 200 may signal and obtain an intra prediction mode and a reference sample line index for generating a first prediction block.

[0199] The image encoding apparatus 100 and the image decoding apparatus 200 may signal and obtain the second intra prediction mode and mrl_idx2 (S1220). Here, mrl_idx2 may be an index indicating the second reference sample line. That is, the image encoding apparatus 100 and the image decoding apparatus 200 may signal and obtain the intra prediction mode and the reference sample line index mrl_idx2 used to generate the second prediction block.

[0200] The image encoding apparatus 100 and the image decoding apparatus 200 may fuse the intra prediction blocks (S1230). That is, the first prediction block generated using the first intra prediction mode and mrl_idx and the second prediction block generated using the second intra prediction mode and mrl_idx2 may be fused. At this time, the image encoding apparatus 100 and the image decoding apparatus 200 may use weights.

[0201] The order of signaling and obtaining n intra prediction modes may be determined by the agreement between the image encoding device 100 and the image decoding device 200. At this time, n may be a natural number. Various prediction blocks may be generated using p intra prediction modes and q reference sample lines, and the method of generating and fusing the prediction blocks may be determined by the agreement between the image encoding device 100 and the image decoding device 200. At this time, p and q may be natural numbers.

[0202] According to another embodiment of the present disclosure, mrl_idx2 may not be signaled and obtained. In this case, the reference sample line may be derived in the image decoding apparatus 200, and each prediction block may be generated using a different reference sample line.

[0203] As another example, Fig.12The step (S1220) of signaling the second intra prediction mode and mrl_idx2 in can be omitted. Therefore, obtaining the second intra prediction mode and mrl_idx2 can also be omitted. In this case, the image encoding device 100 and the image decoding device 200 can generate a prediction block using an intra prediction mode such as the first intra prediction mode and a reference sample line different from the reference sample line indicated by mrl_idx. That is, mrl_idx can be signaled and obtained, and mrl_idx2 can be derived in the image encoding device 100 and the image decoding device 200. Alternatively, the image encoding device 100 and the image decoding device 200 can derive the intra prediction mode so that a prediction block can be generated using an intra prediction mode different from the first intra prediction mode.

[0204] Fig.13 is a flowchart illustrating a method of signaling and obtaining an intra prediction mode and a reference sample line index according to the present disclosure. Fig.13 The subject may be the image encoding device 100 or the image decoding device 200.

[0205] according to Fig.13 , the image encoding apparatus 100 and the image decoding apparatus 200 may signal and obtain a first intra prediction mode, mrl_idx, and mrl_idx2 (S1310). That is, the image encoding apparatus 100 and the image decoding apparatus 200 may signal and obtain an intra prediction mode and a reference sample line index mrl_idx for generating a first prediction block and a reference sample index mrl_idx2 for generating a second prediction block.

[0206] The image encoding apparatus 100 and the image decoding apparatus 200 may signal and obtain the second intra prediction mode (S1320). That is, the image encoding apparatus 100 and the image decoding apparatus 200 may signal and obtain the intra prediction mode used to generate the second prediction block.

[0207] The image encoding apparatus 100 and the image decoding apparatus 200 may fuse the intra prediction blocks (S1330). That is, the image encoding apparatus 100 and the image decoding apparatus 200 may fuse the prediction blocks generated using the first intra prediction mode and mrl_idx and the prediction blocks generated using the second intra prediction mode and mrl_idx2. At this time, the generated multiple prediction blocks may be fused using weights. By fusing the prediction blocks using weights, a final prediction block may be generated.

[0208] According to another embodiment of the present disclosure, the step of signaling the second intra prediction mode (S1320) may be omitted. Therefore, obtaining the second intra prediction mode may also be omitted. In this case, the second intra prediction mode may be derived in the image encoding device 100 and the image decoding device 200. In addition, the signaling and obtaining of mrl_idx2 may also be omitted. In this case, the reference sample line for generating the second prediction block may be derived in the image encoding device 100 and the image decoding device 200.

[0209] The order of signaling and obtaining n intra prediction modes may be determined by the agreement between the image encoding device 100 and the image decoding device 200. At this time, n may be a natural number. Various prediction blocks may be generated using p intra prediction modes and q reference sample lines, and the method of generating and fusing the prediction blocks may be determined by the agreement between the image encoding device 100 and the image decoding device 200. At this time, p and q may be natural numbers.

[0210] Implementation Method 2

[0211] According to the present disclosure, the reference sample line used to generate each prediction block for fusion may be signaled, acquired, or derived in the image encoding device 100 or the image decoding device 200 .

[0212] According to one embodiment of the present disclosure, when two prediction blocks are used to generate a final prediction block, information indicating one reference sample line may be signaled and obtained, and information indicating the remaining reference sample lines may not be signaled and obtained. When the information indicating the remaining reference sample lines is not obtained, the information indicating the remaining reference sample lines may be derived in the image encoding device 100 or the image decoding device 200. At this time, the remaining reference sample line may use the reference sample line 0 adjacent to the current prediction block. That is, the remaining reference sample line may be the reference sample line closest to the current block to be predicted.

[0213] According to another embodiment of the present disclosure, when two prediction blocks are used to generate a final prediction block, information indicating one reference sample line may be signaled and obtained, and the remaining reference sample line may be a reference sample line +t or -t corresponding to the reference sample line signaled and obtained. Here, t may be a natural number. For example, when an index indicating reference sample line 2 is signaled and obtained and t is 1, the remaining reference sample line may be reference sample line 3 or reference sample line 1. That is, the remaining reference sample line may be one of the two reference sample lines closest to reference sample line 2.

[0214] According to another embodiment of the present disclosure, when a final prediction block is generated using two prediction blocks, both information indicating two reference sample lines may be signaled and obtained as shown in Table 2 below.

[0215] [Table 2]

[0216] … if(sps_mrl_enabled_flag&&((y0%CtbSizeY)>0)){ intra_luma_ref_idx intra_luma_ref_idx2 } … if (intra_luma_ref_idx == 0) intra_luma_not_planar_flag[x0][y0] if(intra_luma_not_planar_flag[x0][y0]) intra_luma_mpm_idx[x0][y0] …

[0217] In Table 2, intra_luma_ref_idx may represent a reference sample line index used to generate a first prediction block. In addition, intra_luma_ref_idx2 may represent a reference sample line index used to generate a second prediction block.

[0218] Fig.14 is a diagram illustrating an example of a method for deriving a reference sample line according to the present disclosure. According to one embodiment of the present disclosure, a reference sample line required for generating a prediction block can be derived by utilizing information of a previously reconstructed block close to the current block. For example, when the intra prediction modes of the current block and the neighboring block are the same, a reference sample line separated from the current block by the width or height of the neighboring block can be used to generate the prediction block.

[0219] Specifically, when the intra prediction mode of the current block is the same as the intra prediction mode of the upper previous reconstruction block 1410, the height H of the upper previous reconstruction block 1410 spaced from the current block may be used. Above In addition, when the intra prediction mode of the current block is the same as the intra prediction mode of the left previous reconstruction block 1430, the width W of the left reconstruction block 1430 separated from the current block can be used. Left The reference sample line 1440 is used to generate the prediction block.

[0220] Fig.15 is a diagram illustrating an example of a method for deriving a reference sample line according to the present disclosure. According to one embodiment of the present disclosure, when the intra prediction modes of the current block and the neighboring block are the same, one reference sample line may be reference sample line 0, and the remaining reference sample lines may be reference sample lines separated from the current block by the width or height of the neighboring block. The image encoding apparatus 100 and the image decoding apparatus 200 may generate a prediction block using reference sample line 0 and reference sample lines separated from the current block by the width or height of the neighboring block.

[0221] Specifically, when the intra prediction mode of the current block is the same as the intra prediction mode of the upper previous reconstructed block 1510, the reference sample line 0 1520 and the height H of the upper previous reconstructed block 1510 spaced from the current block can be used. AboveThereafter, the image encoding apparatus 100 and the image decoding apparatus 200 may fuse the reference sample line 0 1520 and the height H of the previously reconstructed block 1510 above the current block. Above The prediction block generated by the reference sample line 1530.

[0222] In addition, when the intra prediction mode of the current block is the same as the intra prediction mode of the left reconstructed block 1540, the reference sample line 0 1550 and the width W of the previous reconstructed block 1540 on the left side of the current block may be used. Left Thereafter, the image encoding apparatus 100 and the image decoding apparatus 200 may fuse the reference sample line 01550 and the width W of the previous reconstructed block 1540 spaced above the current block. Left The prediction block generated by the reference sample line 1560. At this time, the prediction block can be fused using Formula 4.

[0223] Fig.16 is a diagram illustrating an example of a method for deriving a reference sample line according to the present disclosure. Fig.16 When the intra prediction modes of the current block and the upper previously reconstructed block 1610 are the same, the image encoding apparatus 100 and the image decoding apparatus 200 may use the intra prediction mode of the block above the current block spaced H apart. Above The prediction block is generated by using the reference sample line 1630 of the current block and the reference sample line 1620 which is spaced 0 from the left side of the current block.

[0224] Alternatively, if the intra prediction modes of the current block and the left previously reconstructed block 1640 are the same, the image encoding apparatus 100 and the image decoding apparatus 200 may use a reference sample line 1650 spaced 0 from the upper side of the current block and a reference sample line 1650 spaced W from the left side of the current block. Left The reference sample line 1660 is used to generate the prediction block.

[0225] Fig.17 FIG. 1 is a diagram illustrating an example of a method for deriving a reference sample line according to the present disclosure. Fig.17 When there are multiple previously reconstructed blocks having the same intra prediction mode as the current block, the image encoding device 100 and the image decoding device 200 can generate a prediction block using a reference sample line with the smallest width or height among the widths or heights of the previously reconstructed blocks separated from the current block.

[0226] Specifically, when the intra prediction mode of the left previous reconstructed block 1710 and the upper previous reconstructed block 1720 of the current block is the same as the intra prediction mode of the current block, the image encoding apparatus 100 and the image decoding apparatus 200 may compare the width W of the left previous reconstructed block 1710. Left and the height H of the previous reconstruction block 1720 on the upper sideAbove When W Left <H Above When the image encoding device 100 and the image decoding device 200 are separated from the current block by W Left On the other hand, when W Left >H Above When the image encoding device 100 and the image decoding device 200 can use the current block separated by H Above The reference sample line is used to generate the prediction block.

[0227] Implementation 3

[0228] The present disclosure relates to a method for obtaining weights for fusing a plurality of prediction blocks generated using a plurality of reference sample lines. At this time, the weights may be used or derived as values ​​agreed upon between the image encoding apparatus 100 / the image decoding apparatus 200 .

[0229] According to one embodiment of the present disclosure, weights may be applied variably according to the size of the current block. For example, when the width×height of the current block is less than or equal to a specific threshold, the image encoding device 100 and the image decoding device 200 may apply a larger weight to a prediction block generated using a reference sample line close to the current block. Alternatively, when the width×height of the current block is greater than a specific threshold, the image encoding device 100 and the image decoding device 200 may apply a smaller weight to a prediction block generated using a reference sample line close to the current block. Here, a reference sample line close to the current block means a reference sample line close to the current block among a plurality of reference sample lines used when forming a plurality of prediction blocks.

[0230] According to another embodiment of the present disclosure, the image encoding device 100 and the image decoding device 200 may variably apply weights according to the intra prediction mode of the current block. For example, when the intra prediction mode of the current block is the planar mode or the DC mode, the image encoding device 100 and the image decoding device 200 may apply a larger weight to a prediction block generated using a reference sample line close to the current block.

[0231] According to another embodiment of the present disclosure, the image encoding device 100 and the image decoding device 200 may variably apply weights according to the shape of the current block. For example, if the width of the current block is greater than or equal to the height, a first prediction block is generated based on a vertical prediction mode, and a second prediction block is generated based on a horizontal prediction mode, the image encoding device 100 and the image decoding device 200 may apply a larger weight to the first prediction block.

[0232] Alternatively, if the width of the current block is smaller than the height, a first prediction block is generated based on a directional pattern in the horizontal direction, and a second prediction block is generated based on a directional pattern in the vertical direction, and the image encoding device 100 and the image decoding device 200 may apply a larger weight to the first prediction block.

[0233] Here, the directional mode in the vertical direction may include one of intra prediction modes 34 to 66, and the directional prediction mode in the horizontal direction may include one of intra prediction modes 2 to 33.

[0234] According to another embodiment of the present disclosure, when fusing a plurality of prediction blocks, the image encoding device 100 and the image decoding device 200 may apply weights fixedly regardless of neighboring information. The weights applied to various embodiments of the present disclosure and the above-mentioned formulas 3 to 6 may have values ​​of 0, 1 / 4, 1 / 2, 3 / 4, and 1. Alternatively, the weights applied to various embodiments of the present disclosure and formulas 3 to 6 may have values ​​of 0, 1 / 8, 1 / 4, 3 / 8, 1 / 2, 5 / 8, 3 / 4, 7 / 8, and 1.

[0235] Fig.18 is a diagram illustrating an example of a method for determining a weight applied when fusing a plurality of prediction blocks according to the present disclosure. Fig.18 , a weight may be applied based on the distance between the current block and the reference sample line without signaling. For example, if there is a reference sample line 1810 spaced α from the boundary of the current block and a reference sample line 1820 spaced β from the boundary of the current block, the weight applied to each prediction block generated based on each reference sample line may be calculated using a ratio of α:β, as shown in Equation 7 below.

[0236] [Formula 7]

[0237]

[0238] That is, it is applied to the prediction block Pred generated based on the reference sample line 1810 separated from the boundary of the current block by α. m,α The weight of may be β / (α+β). In addition, the prediction block Pred generated based on the reference sample line 1820 separated from the boundary of the current block by β is applied. n,β The weight of can be α / (α+β).

[0239] Fig.19 is a diagram illustrating an example of a method for determining a weight applied when fusing a plurality of prediction blocks according to the present disclosure. Fig.19, the weight can be determined by the distance difference between the position of the sample in the current block and the reference sample line. Specifically, when the position of the upper left corner sample of the current block is (0,0), for the prediction block generated using the reference sample line 1920 separated by α+y (or α+x) from the sample 1910 at the position (x,y) in the current block and the prediction block generated using the reference sample line 1930 separated by β+y (or β+x) from the sample 1910 at the position (x,y) in the current block, the image encoding device 100 and the image decoding device 200 can use the ratio of (α+y):(β+y) (or (α+x):(β+x)) to obtain the weight, as shown in Formula 8 below.

[0240] [Formula 8]

[0241]

[0242] That is, it is applied to the prediction block Pred generated using the reference sample line 1920 separated by α+y from the (x, y) sample 1910 in the current block. m,α The weight of may be (β+y) / (α+β+2y). In addition, it is applied to the prediction block Pred generated using the reference sample line 1930 separated by β+y from the (x, y) sample 1910 in the current block. n,β The weight of can be (α+y) / (α+β+2y).

[0243] Alternatively, the prediction block Pred is generated using a reference sample line 1920 that is spaced α+x from the (x, y) sample 1910 in the current block. m, The weight of α may be (β+x) / (α+β+2x). In addition, the prediction block Pred generated using the reference sample line 1930 spaced β+x from the (x, y) sample 1910 in the current block is applied. n,β The weight of can be (α+x) / (α+β+2x).

[0244] Fig. 20 is a diagram illustrating an example of a method for determining a weight applied when fusing a plurality of prediction blocks according to the present disclosure. Fig. 20 , the image encoding device 100 and the image decoding device 200 can obtain the sum of absolute differences (SAD) between the predicted samples and the reconstructed samples in the template area 2010 predicted by the reference sample line α2020. In addition, the image encoding device 100 and the image decoding device 200 can obtain the SAD between the predicted samples and the reconstructed samples in the template area 2010 predicted by the reference sample line β2030.

[0245] When the template costs obtained by each SAD are Cost α Cost βWhen the image encoding device 100 and the image decoding device 200 can use Cost α :Cost β The weight is obtained by the ratio of . At this time, the present disclosure may use one of SATD (sum of absolute transform differences) or SSD (sum of square differences) instead of SAD to obtain the weight. The final prediction sample according to the present disclosure may be calculated using the following formula 9.

[0246] [Formula 9]

[0247]

[0248] According to Equation 9, the weight applied to the prediction block PredA generated using the reference sample line α2020 can be Cost β / (Cost α +Cost β ). In addition, the weight applied to the prediction block PredB generated using the reference sample line β2030 can be Cost α / (Cost α +Cost β ). In other words, a higher weight can be applied to a prediction block with a smaller template cost.

[0249] Fig.21 is a diagram illustrating an example of a method for determining a weight applied when fusing a plurality of prediction blocks according to the present disclosure. Fig.21 In order to obtain the template cost in the template area using the reference sample lines 0 2120 and 2150, the image encoding device 100 and the image decoding device 200 may use only the top template area 2110 or the left template area 2140, and generate the template cost using the template and the previously reconstructed reference samples adjacent to the current block.

[0250] For example, when the intra prediction mode of the current block is intra prediction mode 2 to 18, the image encoding device 100 and the image decoding device 200 can generate prediction samples in the top template area by using the reference sample line 0 (RefLine=0) 2120, and then obtain Cost0. In addition, the image encoding device 100 and the image decoding device 200 can generate prediction samples in the same template area by using the reference sample line β (RefLine=β) 2130, and then obtain Cost β The image encoding device 100 and the image decoding device 200 can be configured by converting Cost0 and Cost β Applied to Equation 9 to generate the final prediction block.

[0251] As another example, when the intra prediction mode of the current block is intra prediction mode 50 to 66, the image encoding device 100 and the image decoding device 200 may generate a prediction sample in the left template area using the reference sample line 0 (RefLine=0) 2150, and then obtain Cost0. In addition, the image encoding device 100 and the image decoding device 200 may generate a prediction sample in the same template area using the reference sample line β (RefLine=β) 2160, and then obtain Cost β The image encoding device 100 and the image decoding device 200 can be configured by converting Cost0 and Cost β Applied to Equation 9 to generate the final prediction block.

[0252] According to another embodiment of the present disclosure, the predicted samples predicted in the template area using the reference sample line α and the reference sample line β can be fused by applying the weights defined in the following Table 3. Thereafter, the image encoding device 100 and the image decoding device 200 can obtain the SAD with the reconstructed samples in the template area. That is, the image encoding device 100 and the image decoding device 200 can obtain the SAD with the fused predicted samples and the reconstructed samples based on Table 3.

[0253] The image encoding device 100 and the image decoding device 200 may use the weight with the lowest SAD as the weight for predicting the final prediction block. That is, the weight with the lowest SAD among the weights for predicting samples in the fusion template area may be used as the weight for predicting the final prediction block. The weights in Table 3 below may be defined identically between the image encoding device 100 and the image decoding device 200.

[0254] [Table 3]

[0255] index Weight 0 1 / 4 1 1 / 2 2 3 / 4 … …

[0256] Fig. 22 is a diagram illustrating a template area for obtaining a template cost according to the present disclosure. Fig. 22 , the template area according to the present disclosure can be divided into an upper left "AL" area 2210, a left "L" area 2220, and an upper "A" area 2230 of the current block. Areas "A" 2230, "L" 2220, and "AL" 2210 can all be used to obtain the template cost, or can be partially used.

[0257] Here, area "A" (W A ×H A )2230 width W A can be equal to or different from the width W of the current block, and the height H A can be greater than or equal to 1. In addition, the area "L" (W L ×HL )2220 height H L Can be equal to or different from the height H of the current block, and the width W L Can be greater than or equal to 1. In addition, the area "AL" (W AL ×H AL )2210W AL can be greater than or equal to 1, and W AL Can be equal to or different from H A In addition, the H AL can be greater than or equal to 1, and H AL Can be equal to or different from W L .

[0258] Fig.23 1 is a flowchart of an image encoding method according to the present disclosure. The image encoding device 100 may determine multiple intra-frame prediction modes and multiple reference sample lines of a current block (S2310). The image encoding device 100 may generate multiple prediction blocks of the current block based on the multiple intra-frame prediction modes and the multiple reference sample lines (S2320). At this time, the multiple intra-frame prediction modes may include a first intra-frame prediction mode and a second intra-frame prediction mode. In addition, the multiple reference sample lines may include a first reference sample line and a second reference sample line. A first prediction block may be generated based on the first intra-frame prediction mode and the first reference sample line, and a second prediction block may be generated based on the second intra-frame prediction mode and the second reference sample line.

[0259] The image encoding apparatus 100 may generate a final prediction block of the current block based on a weighted sum of the plurality of prediction blocks (S2330). For example, the final prediction block of the current block may be generated by a weighted sum of the first prediction block and the second prediction block.

[0260] According to one embodiment of the present disclosure, at least one of the first intra prediction mode, the second intra prediction mode, the information indicating the first reference sample line, or the information indicating the second reference sample line may be encoded into a bitstream. At this time, the information indicating the first reference sample line may be mrl_idx, and the information indicating the second reference sample line may be mrl_idx2. Alternatively, the information indicating the first reference sample line may be intra_luma_ref_idx, and the information indicating the second reference sample line may be intra_luma_ref_idx2.

[0261] According to another embodiment of the present disclosure, if information indicating a second intra prediction mode among multiple intra prediction modes is not obtained from the bitstream, the second prediction mode may be derived as a predetermined mode or one of the MPM candidate modes. Here, the predetermined mode may be a plane mode or a DC mode. In addition, the MPM candidate mode may be configured as an intra prediction mode of a neighboring block of the current block.

[0262] According to one embodiment of the present disclosure, if the intra prediction mode of the current block is the same as the intra prediction mode of the neighboring block, the second reference sample line among the multiple reference sample lines can be determined based on the size of the neighboring block. For example, if the intra prediction mode of the current block is the same as the intra prediction mode of the upper neighboring block, the second reference sample line can be determined as a reference sample line that is separated from the current block by the height of the upper neighboring block. Alternatively, if the intra prediction mode of the current block is the same as the intra prediction mode of the left neighboring block, the second reference sample line can be determined as a reference sample line that is separated from the current block by the width of the left neighboring block. In this case, the first reference sample line can be determined as reference sample line 0. Reference sample line 0 may mean the first neighboring reference sample line closest to the current block.

[0263] According to another embodiment of the present disclosure, if there are two or more neighboring blocks with the same intra prediction mode as the current block, a second reference sample line among the multiple reference sample lines can be determined based on the width and height of the neighboring blocks. For example, if the neighboring blocks include a left neighboring block and an upper neighboring block, and the width of the left neighboring block is less than or equal to the height of the upper neighboring block, the second reference sample line can be determined as a reference sample line separated from the current block by the width of the left neighboring block.

[0264] Alternatively, if the neighboring blocks include a left neighboring block and an upper neighboring block, and the width of the left neighboring block is greater than the height of the upper neighboring block, the second reference sample line may be determined as a reference sample line spaced apart from the current block by the height of the upper neighboring block.

[0265] According to one embodiment of the present disclosure, the weight used for the fused prediction block can be determined based on at least one of the size of the current block, the shape of the current block, the intra-frame prediction mode of the current block, the distance between the current block and the reference sample line, and the cost based on template matching.

[0266] For example, if the first reference sample line is located closer to the current block than the second reference sample line, based on the size of the current block being greater than or equal to the threshold, the first weight applied to the first prediction block may be less than the second weight applied to the second prediction block. Alternatively, based on the size of the current block being less than the threshold, the first weight may be greater than the second weight. In other words, the weight may be determined based on the size of the current block. In this case, the threshold may be determined by an agreement between the image encoding device 100 / image decoding device 200, or may be derived from other information.

[0267] As another example, if the first reference sample line is located closer to the current block than the second reference sample line, based on the intra prediction mode of the current block being the DC mode or the planar mode, the first weight applied to the first prediction block may be greater than the second weight applied to the second prediction block. That is, the weight may be determined based on the intra prediction mode of the current block.

[0268] As another example, if the first prediction block is generated using a directional mode in the vertical direction and the second prediction block is generated using a directional prediction mode in the horizontal direction, based on the width of the current block being greater than or equal to the height, the first weight applied to the first prediction block may be greater than the second weight applied to the second prediction block. Alternatively, based on the width of the current block being less than the height, the first weight may be less than the second weight. In other words, the weight may be determined based on the shape of the current block.

[0269] Here, the directional mode in the vertical direction may be one of intra prediction modes 34 to 66. Also, the directional prediction mode in the horizontal direction may be one of intra prediction modes 2 to 33.

[0270] As another example, the weight for fusing the first prediction block and the second prediction block may be determined based on the distance between the position of the sample included in the current block and the reference sample line. Specifically, the weight may be determined based on the ratio of the distance from the position of the sample in the current block to the first reference sample line to the distance from the position of the sample in the current block to the second reference sample line.

[0271] As another example, the weight for fusing the first prediction block and the second prediction block can be determined based on the distance from the current block to the reference sample line. Specifically, the weight can be determined based on the ratio of the distance from the current block to the first reference sample line to the distance from the current block to the second reference sample line.

[0272] As another example, the weight may be determined based on a cost based on template matching. In this case, the cost based on template matching may include a first template cost calculated based on the first reference sample line and a second template cost calculated based on the second reference sample line.

[0273] The weight according to the present disclosure may be determined based on a comparison of the first template cost and the second template cost. Specifically, the weight may be determined as a ratio of the first template cost to the second template cost. In this case, a larger weight may be applied to a prediction block with a smaller template cost.

[0274] Here, the first template cost can be calculated based on one of the SAD, SATD or SSD of the predicted samples and the reconstructed samples in the template area generated according to the first reference sample line. In addition, the second template cost can be calculated based on one of the SAD, SATD or SSD of the predicted samples and the reconstructed samples in the template area generated according to the second reference sample line.

[0275] Fig.24 4 is a flowchart of an image decoding method according to the present disclosure. The image decoding device 200 may obtain multiple intra-frame prediction modes and multiple reference sample lines of the current block (S2410). The image decoding device 200 may generate multiple prediction blocks of the current block based on the multiple intra-frame prediction modes and the multiple reference sample lines (S2420). At this time, the multiple intra-frame prediction modes may include a first intra-frame prediction mode and a second intra-frame prediction mode. In addition, the multiple reference sample lines may include a first reference sample line and a second reference sample line. A first prediction block may be generated based on the first intra-frame prediction mode and the first reference sample line, and a second prediction block may be generated based on the second intra-frame prediction mode and the second reference sample line.

[0276] The image decoding apparatus 200 may generate a final prediction block of the current block based on the weighted sum of the plurality of prediction blocks (S2430). For example, the final prediction block of the current block may be generated by the weighted sum of the first prediction block and the second prediction block.

[0277] The image decoding process of the image decoding device 200 according to the present disclosure can be the same as that according to Fig.23 The encoding process of the image encoding device 100 described above is the same.

[0278] 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 disclosure, 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.

[0279] In the present disclosure, the image encoding device 100 or the image decoding device 200 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 satisfied, the image encoding device 100 or the image decoding device 200 may perform the predetermined operation after determining whether the predetermined condition is satisfied.

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

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

[0282] In addition, the image decoding device 200 and the image encoding device 100 to which the embodiments of the present disclosure are applied may be included in a multimedia broadcast sending and receiving 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 providing device, an OTT video (over the top video) device, an Internet streaming service providing device, 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.

[0283] Fig.25 is a diagram showing a content streaming system to which an embodiment of the present disclosure can be applied.

[0284] like Fig.25 As shown, the 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.

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

[0286] A bitstream may be generated by the image encoding method or the image encoding apparatus 100 to which the present disclosure is applied, and a streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.

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

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

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

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

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

[0292] Industrial Applicability

[0293] 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: Obtain multiple intra-frame prediction modes and multiple reference sample lines of the current block; generating a plurality of prediction blocks of the current block based on the plurality of intra prediction modes and the plurality of reference sample lines; as well as A final prediction block of the current block is generated based on a weighted sum of the multiple prediction blocks.

2. The image decoding method according to claim 1, wherein: Based on the fact that information indicating the second intra prediction mode among the plurality of intra prediction modes is not obtained from the bitstream, the second prediction mode is derived as one of the predetermined mode or the most probable mode (MPM) candidate modes.

3. The image decoding method according to claim 1, wherein: Based on the intra prediction mode of the current block and the intra prediction mode of the neighboring block, a second reference sample line among the plurality of reference sample lines is determined based on the size of the neighboring block.

4. The image decoding method according to claim 1, wherein: Based on the presence of two or more neighboring blocks having the same intra prediction mode as that of the current block, a second reference sample line among the plurality of reference sample lines is determined based on widths and heights of the neighboring blocks.

5. The image decoding method according to claim 4, in, The neighboring blocks include a left neighboring block and an upper neighboring block, Wherein, based on the width of the left neighboring block being less than or equal to the height of the upper neighboring block, the second reference sample line is determined to be a reference sample line separated from the current block by the width of the left neighboring block, and Wherein, based on the fact that the width of the left neighboring block is greater than the height of the upper neighboring block, the second reference sample line is determined to be a reference sample line that is separated from the current block by the height of the upper neighboring block.

6. The image decoding method according to claim 1, wherein: The weight is determined based on at least one of a size of the current block, a shape of the current block, an intra prediction mode of the current block, a distance between the current block and a reference sample line, or a cost based on template matching.

7. The image decoding method according to claim 6, in, The plurality of prediction blocks include a first prediction block generated based on a first reference sample line and a second prediction block generated based on a second reference sample line, The first reference sample line is located closer to the current block than the second reference sample line, and Wherein, based on the size of the current block being greater than or equal to a threshold, the first weight applied to the first prediction block is less than the second weight applied to the second prediction block, and based on the size of the current block being less than the threshold, the first weight is greater than the second weight.

8. The image decoding method according to claim 6, in, The plurality of prediction blocks include a first prediction block generated based on a first reference sample line and a second prediction block generated based on a second reference sample line, The first reference sample line is located closer to the current block than the second reference sample line, and Wherein, based on the intra-frame prediction mode of the current block being a DC mode or a planar mode, a first weight applied to the first prediction block is greater than a second weight applied to the second prediction block.

9. The image decoding method according to claim 6, in, The plurality of prediction blocks include a first prediction block generated using a directional prediction mode in a vertical direction and a second prediction block generated using a directional prediction mode in a horizontal direction, and In which, based on the width of the current block being greater than or equal to the height of the current block, the first weight applied to the first prediction block is greater than the second weight applied to the second prediction block, and based on the width of the current block being less than the height of the current block, the first weight is less than the second weight.

10. The image decoding method according to claim 6, wherein: The weight is determined based on a distance between a position of a sample included in the current block and the reference sample line.

11. The image decoding method according to claim 6, in, The cost based on template matching includes a first template cost calculated based on the first reference sample line and a second template cost calculated based on the second reference sample line, and The weight is determined based on a comparison between the first template cost and the second template cost.

12. An image encoding method performed by an image encoding device, the image encoding method comprising the following steps: Obtain multiple intra-frame prediction modes and multiple reference sample lines of the current block; Generate a plurality of prediction blocks of the current block based on the plurality of intra prediction modes and the plurality of reference sample lines; as well as A final prediction block of the current block is generated based on a weighted sum of the multiple prediction blocks.

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

14. A method for transmitting a bit stream generated by an image encoding method, the image encoding method comprising the following steps: Obtain multiple intra-frame prediction modes and multiple reference sample lines of the current block; Generate a plurality of prediction blocks of the current block based on the plurality of intra prediction modes and the plurality of reference sample lines; as well as A final prediction block of the current block is generated based on a weighted sum of the multiple prediction blocks.