Image encoding / decoding method and device based on intra prediction, and recording medium storing bit stream

By selecting and deriving reference sample lines, generating an intra-frame prediction candidate list and calculating the template matching cost, the low efficiency problem in high-resolution and high-quality image encoding/decoding is solved, and adaptive intra-frame prediction and efficient image reconstruction are achieved.

CN120642336APending Publication Date: 2025-09-12LG ELECTRONICS INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202480011985.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-01-10
Filing Date
2024-01-10
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

In the existing technology, in the high-resolution and high-quality image encoding/decoding process, the encoding/decoding efficiency is low, it is difficult to effectively generate reference samples and multiple reference sample line candidate lists, and the use of intra-frame prediction mode is not adaptive enough.

Method used

Adaptive intra prediction is achieved by selecting a first reference sample line, determining its availability, deriving a second reference sample line, determining reference sample values ​​using distance and direction, generating an intra prediction candidate list, and calculating the template matching cost in a template-based multi-reference line intra prediction mode.

Benefits of technology

It improves the efficiency of image encoding/decoding, effectively generates reference samples and multiple reference sample line candidate lists, realizes adaptive intra-frame prediction, and improves encoding/decoding efficiency and image reconstruction quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120642336A_ABST
    Figure CN120642336A_ABST
Patent Text Reader

Abstract

An image encoding / decoding method and apparatus are provided. An image decoding method according to the present disclosure may comprise the steps of: selecting a first reference sample line for a current block; determining whether some reference samples within the first reference sample line are available; and deriving a second reference sample line for the current block based on the determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a method and apparatus for encoding / decoding an image and a recording medium for storing a bitstream, and more particularly, to a method and apparatus for encoding / decoding an image based on intra-frame prediction and a recording medium for storing a bitstream generated using the image encoding method / apparatus of the present disclosure. Background Art

[0002] Recently, demand for high-resolution and high-quality images, such as high-definition (HD) and ultra-high-definition (UHD), is increasing across various fields. As the resolution and quality of image data improve, the amount of information or bits transmitted increases relative to existing image data. This increase in the amount of information or bits transmitted leads to increased transmission and storage costs.

[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] The present disclosure is directed to providing an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.

[0006] The present disclosure is also directed to providing an image encoding / decoding method and apparatus for efficiently generating reference samples to perform intra-frame prediction.

[0007] The present disclosure is also directed to providing an image encoding / decoding method and apparatus for efficiently generating a multi-reference sample line candidate list.

[0008] The present disclosure is also directed to providing an image encoding / decoding method and apparatus for adaptively using an intra-frame prediction mode.

[0009] The present disclosure is also directed to providing an image encoding / decoding method and apparatus for performing intra prediction in a template-based multiple reference line intra prediction (TMRL) or template-based intra mode derivation (TIMD) mode.

[0010] The present disclosure is also directed to providing a non-transitory computer-readable recording medium for storing a bitstream generated using the image encoding method or apparatus according to the present disclosure.

[0011] The present disclosure is also directed to providing a non-transitory computer-readable recording medium for storing a bit stream received and decoded by the image decoding apparatus according to the present disclosure and used for image reconstruction.

[0012] The present disclosure is also directed to providing a method for transmitting a bitstream generated using the image encoding method or apparatus according to the present disclosure.

[0013] The technical objectives to be achieved by the present disclosure are not limited to the above-mentioned objectives, and those skilled in the art in the technical field to which the present disclosure pertains will clearly understand other technical objectives that have not been described from the following description.

[0014] Technical Solution

[0015] According to an embodiment of the present disclosure, a method for decoding an image performed by an image decoding device includes: selecting a first reference sample line for a current block; determining whether some reference samples in the first reference sample line are available; and deriving a second reference sample line for the current block based on the determination.

[0016] According to an embodiment of the present disclosure, based on at least one reference sample being unavailable in the first reference sample line, a second reference sample line may be acquired by deriving a value of at least one reference sample using reference sample lines other than the first reference sample line.

[0017] According to an embodiment of the present disclosure, a reference sample used to derive a value of at least one of reference samples in another reference sample line may be determined based on a distance from at least one reference sample.

[0018] According to an embodiment of the present disclosure, the reference sample used to derive the value of at least one reference sample value may be determined as a reference sample closest to the at least one reference sample.

[0019] According to an embodiment of the present disclosure, a reference sample used to derive at least one reference sample value may be determined based on any one of a horizontal distance from at least one reference sample, a vertical distance from at least one reference sample, and a distance in a direction of an intra-prediction mode of at least one reference sample.

[0020] According to an embodiment of the present disclosure, the method may further include: generating a reference sample line list including a second reference sample line based on at least one reference sample being unavailable in the first reference sample line. The first reference sample line may not be included in the reference sample line list.

[0021] According to an embodiment of the present disclosure, the second reference sample line may be composed of available samples.

[0022] According to an embodiment of the present disclosure, whether reference samples in the first reference sample line are available may be determined based on whether the samples included in the first reference sample line are located outside a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a virtual pipeline data unit (VPDU) boundary, or a coding tree unit (CTU) boundary.

[0023] According to an embodiment of the present disclosure, the method may further include generating an intra prediction candidate list for the current block. Based on at least one reference sample being unavailable in the first reference sample line, the intra prediction candidate list may consist of intra prediction modes that do not reference the unavailable reference samples.

[0024] According to an embodiment of the present disclosure, the intra prediction mode may be determined as template-based intra mode derivation (TIMD) or template-based multi-reference line intra prediction (TMRL). Based on the unavailability of at least one reference sample in a first reference sample line, a template matching (TM) cost for predicting the current block may be calculated using reference samples in a second reference sample line.

[0025] According to an embodiment of the present disclosure, an intra prediction mode may be determined as template-based intra mode derivation (TIMD) or template-based multi-reference line intra prediction (TMRL). Based on the unavailability of at least one reference sample in a first template region used to calculate a template matching (TM) cost for a current block, a second template region may be used to calculate the TM cost.

[0026] According to an embodiment of the present disclosure, a method for encoding an image performed by an image encoding device includes: selecting a first reference sample line for a current block; determining whether some reference samples in the first reference sample line are available; and deriving a second reference sample line for the current block based on the determination.

[0027] According to an embodiment of the present disclosure, there is provided a computer-readable recording medium for storing a bitstream generated using a method of encoding an image.

[0028] According to an embodiment of the present disclosure, a method for transmitting a bitstream generated using an image encoding method includes: selecting a first reference sample line for a current block; determining whether some reference samples in the first reference sample line are available; and deriving a second reference sample line for the current block based on the determination.

[0029] Beneficial effects

[0030] According to the present disclosure, it is possible to provide an image encoding / decoding method and apparatus with improved encoding / decoding efficiency.

[0031] According to the present disclosure, it is also possible to provide an image encoding / decoding method and apparatus for efficiently generating reference samples to perform intra prediction.

[0032] According to the present disclosure, an image encoding / decoding method and apparatus for efficiently generating a multi-reference sample line candidate list can also be provided.

[0033] According to the present disclosure, it is also possible to provide an image encoding / decoding method and apparatus for adaptively using an intra-frame prediction mode.

[0034] According to the present disclosure, it is also possible to provide an image encoding / decoding method and apparatus for performing intra prediction in a template-based multi-reference line intra prediction (TMRL) or template-based intra mode derivation (TIMD) mode.

[0035] According to the present disclosure, it is also possible to provide a non-transitory computer-readable recording medium for storing a bit stream generated using the image encoding method or apparatus according to the present disclosure.

[0036] According to the present disclosure, it is also possible to provide a non-transitory computer-readable recording medium for storing a bit stream received and decoded by the image decoding device according to the present disclosure and used for image reconstruction.

[0037] According to the present disclosure, it is also possible to provide a method for transmitting a bit stream generated using the image encoding method or apparatus according to the present disclosure.

[0038] Effects of the present disclosure are not limited to the above-described effects, and other effects that have not been described will be clearly understood from the following description by those skilled in the art to which the present disclosure pertains. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 FIG. 1 is a diagram schematically illustrating a video encoding system to which embodiments of the present disclosure are applicable.

[0040] Figure 2 FIG. 1 is a diagram schematically showing an image encoding device to which an embodiment of the present disclosure is applicable.

[0041] Figure 3 FIG. 1 is a diagram schematically showing an image decoding device to which an embodiment of the present disclosure is applicable.

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

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

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

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

[0046] Figure 8is a diagram illustrating a plurality of reference lines for intra prediction according to an embodiment of the present disclosure.

[0047] Figure 9 is a diagram illustrating a template region used in a template-based intra mode derivation (TIMD) mode according to the present disclosure.

[0048] Figure 10 is a diagram illustrating a Template Matching (TM) based encoding / decoding method according to the present disclosure.

[0049] Figure 11 is a diagram illustrating a template region in a template-based multi-reference line intra mode (TMRL) according to the present disclosure.

[0050] Figure 12 is a diagram illustrating a reference sample line for generating an intra prediction block according to the present disclosure.

[0051] Figure 13 is a diagram illustrating a method of padding reference samples according to an embodiment of the present disclosure.

[0052] Figure 14 is a diagram illustrating a method of filling reference samples located outside a vertical boundary according to an embodiment of the present disclosure.

[0053] Figure 15 is a diagram illustrating a method of filling reference samples located outside a horizontal boundary according to an embodiment of the present disclosure.

[0054] Figure 16 is a flowchart of a method for filling reference samples according to an embodiment of the present disclosure.

[0055] Figure 17 is a diagram illustrating a method of filling reference samples located outside a vertical boundary according to an embodiment of the present disclosure.

[0056] Figure 18 is a diagram illustrating a method of filling reference samples located outside a horizontal boundary according to an embodiment of the present disclosure.

[0057] Figure 19 4 is a flowchart of a method for filling reference samples based on intra prediction mode according to an embodiment of the present disclosure.

[0058] Figure 20 is a diagram illustrating a multi-reference sample line according to an embodiment of the present disclosure.

[0059] Figure 21 and Figure 22 is a diagram illustrating a reference sample line replacement method according to an embodiment of the present disclosure.

[0060] Figure 23is a flowchart of a method of generating a multiple reference line (MRL) list according to an embodiment of the present disclosure.

[0061] Figure 24 is a diagram of a reference sample line according to an embodiment of the present disclosure.

[0062] 25A and 25B are diagrams illustrating reference sample lines according to an embodiment of the present disclosure.

[0063] Figure 26 is a diagram illustrating a template area according to an embodiment of the present disclosure.

[0064] Figure 27 is a diagram illustrating a method of filling a reference sample line crossing a vertical boundary according to an embodiment of the present disclosure.

[0065] Figure 28 is a diagram illustrating a method of filling a reference sample line crossing a horizontal boundary according to an embodiment of the present disclosure.

[0066] Figure 29 is a diagram illustrating a method of padding reference samples based on sample distances when the reference samples are located outside a boundary according to an embodiment of the present disclosure.

[0067] Figure 30 is a diagram illustrating a method of padding reference samples based on an intra prediction mode when the reference samples are located outside a boundary according to an embodiment of the present disclosure.

[0068] Figure 31 is a diagram illustrating a method of padding reference samples based on an intra prediction mode when the reference samples are located outside a boundary according to an embodiment of the present disclosure.

[0069] Figure 32 is a diagram illustrating a method of padding reference samples based on sample distances when the reference samples are located outside a boundary in a TIMD mode according to an embodiment of the present disclosure.

[0070] Figure 33 is a diagram illustrating a template area outside a boundary according to an embodiment of the present disclosure.

[0071] Figure 34 is a flowchart of a method of encoding / decoding an image according to an embodiment of the present disclosure.

[0072] Figure 35 is a diagram illustrating a content streaming system to which an embodiment of the present disclosure is applicable. DETAILED DESCRIPTION

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

[0074] 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, its detailed description will be omitted. In the drawings, parts not related to the description of the present disclosure are omitted, and like reference numerals are given to like parts.

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

[0076] In the present disclosure, the terms first, second, etc. may be used only to distinguish 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, the first component in one embodiment may be referred to as the second component in another embodiment, and similarly, the second component in one embodiment may be referred to as the first component in another embodiment.

[0077] In this disclosure, components that are distinguished from each other are intended to clearly describe each feature and do not necessarily mean that the components must be separated. That is, multiple components can be integrated and implemented in a single hardware or software unit, or a single component can be distributed and implemented in multiple hardware or software units. Therefore, even if not otherwise specified, embodiments in which components are integrated or distributed are also included in the scope of this disclosure.

[0078] In the present disclosure, the components described in the various embodiments are not necessarily essential components, and some components may be optional components. Therefore, embodiments consisting of a subset of the components described in the embodiments are also included in the scope of the present disclosure. In addition, embodiments that include other components in addition to the components described in the various embodiments are included in the scope of the present disclosure.

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

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

[0081] In this disclosure, a "picture" generally refers to a single image within a specific time period, while a slice or tile is a coding unit that constitutes a portion of a picture. A picture may be composed of one or more slices or tiles. In addition, a slice or tile may include one or more coding tree units (CTUs).

[0082] In this disclosure, "pixel" or "picture element (PEL)" may refer to the smallest unit constituting a picture (or image). Furthermore, "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 luma component or only a pixel / pixel value of a chroma component.

[0083] In this disclosure, a "unit" may refer to a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. A unit may include a luma block and two chroma (e.g., Cb, Cr) blocks. In some cases, the term "unit" may be used interchangeably with terms such as "sample array," "block," or "region." Generally, an M×N block may include M columns and N rows of samples (or a sample array) or a set (or array) of transform coefficients.

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

[0085] In addition, in the present disclosure, unless explicitly stated as a chroma block, the "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, the "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").

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

[0087] In this disclosure, the term "or" should be interpreted as meaning "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 this disclosure, the term "or" should be interpreted as meaning "additionally or alternatively."

[0088] 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.” Additionally, “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.”

[0089] Parentheses used in this disclosure may mean "for example." For example, if "prediction (intra-frame prediction)" is indicated, "intra-frame prediction" may be provided as an example of "prediction." In other words, "prediction" in this disclosure is not limited to "intra-frame prediction," and "intra-frame prediction" may be provided as an example of "prediction." Furthermore, even when "prediction (i.e., intra-frame prediction)" is indicated, "intra-frame prediction" may be provided as an example of "prediction."

[0090] Overview of Video Coding Systems

[0091] Figure 1 FIG. 1 is a diagram schematically illustrating a video encoding system to which embodiments of the present disclosure are applicable.

[0092] 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 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 stream.

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

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

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

[0096] Transmitter 13 can transmit the encoded video / image information or data output as a bitstream to receiver 21 of decoding device 20 via a digital storage medium or network in the form of a file or stream. Digital storage media can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. Transmitter 13 can include components for generating media files using a predetermined file format and can also include components for transmitting via a broadcast / communication network. Transmitter 13 can be provided as a transmitting device separate from encoder 12. In this case, the transmitting device includes: at least one processor that obtains the encoded video / image information or data output as a bitstream; and a transmitter that delivers the encoded video / image information or data in the form of a file or stream. Receiver 21 can extract / receive the bitstream from the storage medium or network and transmit the bitstream to decoder 22.

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

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

[0099] Overview of Image Coding Devices

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

[0101] like Figure 2As shown, the image encoding apparatus 100 may include an image splitter 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 further include a subtractor 115.

[0102] In some embodiments, all or at least some of the components configuring the image encoding apparatus 100 may be configured by one hardware component (eg, the image encoding apparatus 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.

[0103] The image splitter 110 can split the input image (or picture or frame) input to the image encoding device 100 into one or more processing units. For example, a processing unit can be called a coding unit (CU). A coding unit can be obtained by recursively splitting a coding tree unit (CTU) or a largest coding unit (LCU) according to a quadtree, binary tree, or ternary tree (QT / BT / TT) structure. For example, a coding unit can be split into multiple coding units of a greater depth based on a quadtree structure, a binary tree structure, and / or a ternary tree structure. The quadtree structure can be applied first to split the coding unit, followed by a binary tree structure and / or a ternary tree structure. The encoding process according to the present disclosure can be performed based on the final coding unit that is no longer split. The maximum coding unit can be used as the final coding unit, or a coding unit of a greater depth obtained by splitting the maximum coding unit can be used as the final coding unit. The encoding process can include the prediction, transform, and reconstruction processes described later. As another example, the processing unit of the encoding process can be a prediction unit (PU) or a transform 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.

[0104] The prediction unit (inter-frame prediction unit 180 or intra-frame prediction unit 185) can 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 can determine whether to apply intra-frame prediction or inter-frame prediction based on the current block or CU. The prediction unit can 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 can be encoded in the entropy encoder 190 and output in the form of a bitstream.

[0105] The intra-frame prediction unit 185 can predict the current block by referring to samples in the current picture. Depending on the intra-frame prediction mode and / or intra-frame prediction technology, the reference samples can be located in the neighborhood of the current block or can be placed separately. The intra-frame 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 planar 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 merely an example, and more or fewer directional prediction modes may be used depending on the settings. The intra-frame prediction unit 185 may determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.

[0106] The inter-frame prediction unit 180 can derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector in a reference picture. To reduce the amount of motion information transmitted in inter-frame prediction mode, motion information can be predicted on a block, sub-block, or sample basis based on the correlation of motion information between neighboring blocks and the current block. Motion information can include a motion vector and a reference picture index. It can also include information about the inter-frame prediction direction (e.g., L0 prediction, L1 prediction, or Bi prediction). In the case of inter-frame prediction, neighboring blocks can include spatially neighboring blocks in the current picture and temporally neighboring blocks in the reference picture. The reference picture containing the reference block and the reference picture containing the temporally neighboring block can be the same or different. Temporally neighboring blocks can be referred to as collocated reference blocks, co-located CUs (colCUs), etc. A reference picture containing temporally neighboring blocks can be referred to as a collocated picture (colPic). For example, the inter-frame prediction unit 180 can configure a motion information candidate list based on the neighboring blocks and generate information indicating which candidate to use to derive the motion vector and / or reference picture index for the current block. Inter-frame prediction can be performed based on various prediction modes. For example, in skip mode and merge mode, the inter-frame prediction unit 180 can use the motion information of the neighboring blocks as the motion information of the current block. In skip mode, unlike merge mode, a residual signal may not be transmitted. In motion vector prediction (MVP) mode, the motion vector of the neighboring blocks can be used as a motion vector predictor, and the motion vector of the current block can be signaled by encoding a motion vector difference and an indicator of the motion vector predictor. The motion vector difference may refer to the difference between the motion vector of the current block and the motion vector predictor.

[0107] The prediction unit can generate a prediction signal based on various prediction methods and techniques described below. For example, the prediction unit can apply not only intra-frame prediction or inter-frame prediction, but also both intra-frame and inter-frame prediction simultaneously to predict the current block. This prediction method of simultaneously applying both intra-frame and inter-frame prediction to predict the current block is referred to as combined inter-frame and intra-frame prediction (CIIP). Furthermore, the prediction unit can perform intra-frame block copying (IBC) to predict the current block. Intra-frame block copying can be used for content image / video coding, such as gaming, such as screen content coding (SCC). IBC is a method that uses a previously reconstructed reference block in the current picture at a predetermined distance from the current block to predict the current picture. When IBC is applied, the position of the reference block in the current picture can be encoded as a vector (block vector) corresponding to the predetermined distance. IBC essentially performs prediction within the current picture, but can be performed similarly to inter-frame prediction because the reference block is derived within the current picture. That is, IBC can use at least one of the inter-frame prediction techniques described in this disclosure.

[0108] The prediction signal generated by the prediction unit can be used to generate a reconstructed signal or 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.

[0109] Transformer 120 can 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). GBT refers to a transform obtained from a graph when the 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. Furthermore, the transform process can be applied to square pixel blocks of uniform size or to blocks of variable size other than square.

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

[0111] The entropy encoder 190 can perform various encoding methods, such as Exponential Golomb, Context-Adaptive Variable Length Coding (CAVLC), and Context-Adaptive Binary Arithmetic Coding (CABAC). The entropy encoder 190 can encode information required for video / image reconstruction (e.g., syntax element values, etc.) in addition to quantized transform coefficients, either together or separately. The encoded information (e.g., encoded video / image information) can be transmitted or stored in the form of a bitstream using a Network Abstraction Layer (NAL) as a unit. The video / image information may also include information about various parameter sets, such as an Adaptation Parameter Set (APS), a Picture Parameter Set (PPS), a Sequence Parameter Set (SPS), or a Video Parameter Set (VPS). In addition, the video / image information may also include general constraint information. The signaled information, transmitted information, and / or syntax elements described in this disclosure may be encoded through the above-described encoding process and included in the bitstream.

[0112] The bitstream may be transmitted via a network or 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 the 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, the transmitter may be provided as a component of the entropy encoder 190.

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

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

[0115] Additionally, as described below, chroma scaling and luma mapping (LMCS) is applied to the picture coding process.

[0116] 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 bitstream.

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

[0118] 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 motion information of blocks used to derive (or encode) motion information in the current picture and / or motion information of already reconstructed blocks in the picture. The stored motion information may be sent to the inter-frame prediction unit 180 and used as motion information for spatially neighboring blocks or motion information for temporally neighboring blocks. The memory 170 may store reconstructed samples of the reconstructed blocks in the current picture and may transmit the reconstructed samples to the intra-frame prediction unit 185.

[0119] Overview of Image Decoding Equipment

[0120] Figure 3 FIG. 1 is a diagram schematically showing an image decoding device to which an embodiment of the present disclosure is applicable.

[0121] like Figure 3 As shown, the image decoding apparatus 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.

[0122] According to an embodiment, all or at least some of the components configuring the image decoding apparatus 200 may be configured by hardware components (eg, the image decoding apparatus 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.

[0123] The image decoding apparatus 200 having received a bit stream including video / image information may decode the image by performing the same operation as that performed by Figure 2 The image is reconstructed using processing corresponding to the processing performed by the image encoding device 100. For example, the image decoding device 200 may perform decoding using the processing unit applied in the image encoding device 100. Therefore, the processing unit for decoding may be, for example, a coding unit. A coding unit may be obtained by dividing 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).

[0124] The image decoding device 200 can receive the image in the form of a bit stream from Figure 2The received signal is output by the image encoding device 100. The entropy decoder 210 can decode the received signal. For example, the entropy decoder 210 can parse the bitstream to derive information required for image reconstruction (or picture reconstruction) (e.g., video / image information). The video / image information may also include information about various parameter sets, such as the Adaptation Parameter Set (APS), Picture Parameter Set (PPS), Sequence Parameter Set (SPS), or Video Parameter Set (VPS). In addition, the video / image information may also include general constraint information. The image decoding device 200 can also decode the picture based on the parameter set information and / or general constraint information. The signaled / received information and / or syntax elements described in this disclosure can be decoded and obtained from the bitstream through a decoding process. For example, the entropy decoder 210 decodes the information in the bitstream based on a coding method such as Exponential Golomb coding, CAVLC, or CABAC, and outputs the values ​​of the syntax elements required for image reconstruction and the quantized values ​​of the residual transform coefficients. More specifically, the CABAC entropy decoding method receives a bin corresponding to each syntax element in the bitstream, determines a context model using information about the target syntax element, decoded information about neighboring blocks and the target block, or information about a symbol / bin decoded at a previous stage. Based on the determined context model, the bin is arithmetic decoded by predicting the probability of occurrence of the bin, and then generates a symbol corresponding to the value of each syntax element. After determining the context model, the CABAC entropy decoding method updates the context model by applying the decoded symbol / bin information to the context model for the next symbol / bin. Information related to prediction within the information decoded by the entropy decoder 210 is provided to the prediction units (inter-frame prediction unit 260 and intra-frame prediction unit 265), and the residual values ​​(i.e., quantized transform coefficients and related parameter information) entropy-decoded by the entropy decoder 210 are input to the dequantizer 220. Furthermore, information regarding filtering within the information decoded by the entropy decoder 210 is 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 .

[0125] 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 an intra-frame prediction unit 265.

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

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

[0128] 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 prediction information output from the entropy decoder 210, and may determine a specific intra / inter prediction mode (prediction technique).

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

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

[0131] The inter-frame prediction unit 260 can derive a prediction block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. In this case, to reduce the amount of motion information transmitted in inter-frame prediction mode, motion information can be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can also include information about the inter-frame prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter-frame prediction, the neighboring blocks can include spatially neighboring blocks in the current picture and temporally neighboring blocks in the reference picture. For example, the inter-frame prediction unit 260 can configure a motion information candidate list based on the neighboring blocks and derive the motion vector and / or reference picture index for the current block based on received candidate selection information. Inter-frame prediction can be performed based on various prediction modes, and information regarding the prediction can include information indicating the inter-frame prediction mode for the current block.

[0132] The adder 235 can generate a reconstructed 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 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 referred to as a reconstructor or a reconstructed block generator. The generated reconstructed signal can be used for intra-frame prediction of the next block to be processed in the current picture, and can be used for inter-frame prediction of the next picture through filtering as described below.

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

[0134] 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 motion information of blocks used to derive (or decode) motion information in the current picture and / or motion information of reconstructed blocks in the picture. The stored motion information can be sent to the inter-frame prediction unit 260 to be used as motion information of spatially adjacent blocks or motion information of temporally adjacent blocks. The memory 250 can store reconstructed samples of the reconstructed blocks in the current picture and transmit the reconstructed samples to the intra-frame prediction unit 265.

[0135] In the present disclosure, the embodiments 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 applied equally or correspondingly to the filter 240, the inter-frame prediction unit 260 and the intra-frame prediction unit 265 of the image decoding device 200.

[0136] Overview of Intra Prediction

[0137] Intra prediction according to the present disclosure will be described below.

[0138] Intra-frame prediction may refer to the generation of prediction samples for the current block based on reference samples within the picture to which the current block belongs (hereinafter, 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: samples adjacent to / adjacent to the left boundary of the current block having a size of nW×nH and a total of 2×nH samples adjacent to the lower left side; samples adjacent to / adjacent to the upper boundary of the current block and a total of 2×nH samples adjacent to the upper right side; and one sample adjacent to the upper left side 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 adjacent to the right boundary of the current block having a size of nW×nH, a total of nW samples adjacent to the lower boundary of the current block, and one sample adjacent to the lower right side of the current block.

[0139] However, some neighboring reference samples of the current block may not have been decoded or may be unavailable. In this case, the decoder 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 based on available samples.

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

[0141] In addition, the prediction sample can be generated by interpolating between a first neighboring sample existing in the prediction direction of the intra prediction mode of the current block and a second neighboring sample existing in the opposite direction among the neighboring reference samples of the current block. The above situation can be called linear interpolation intra prediction (LIP).

[0142] Alternatively, a linear model can be used to generate chroma prediction samples based on luma samples. This is referred to as linear model (LM) mode.

[0143] In addition, the prediction sample of the current block can be derived based on the filtered neighboring reference samples, and the weight of at least one reference sample derived according to the intra prediction mode among the existing neighboring reference samples (i.e., unfiltered neighboring reference samples) and the temporary prediction sample can be calculated to derive the prediction sample for the current block. This situation can be called position-dependent intra prediction (PDPC).

[0144] Alternatively, a reference sample line with the highest prediction accuracy can be selected from multiple reference sample lines adjacent to the current block, and reference samples from the selected reference sample line in the prediction direction can be used to derive prediction samples. Here, information about the reference sample line used (e.g., intra_luma_ref_idx) can be encoded in the bitstream and signaled. This can be multi-reference line (MRL) intra prediction or MRL-based intra prediction. When MRL is not applied, reference samples can 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.

[0145] In addition, the current block can be divided into vertical or horizontal sub-partitions, and intra prediction can be performed on each sub-partition based on the same intra prediction mode. Here, the neighboring reference samples for intra prediction can be derived in units of sub-partitions. In other words, the reconstructed samples of the previous sub-partition in the encoding / decoding order can be used as the neighboring reference samples of the current sub-partition. In this case, the intra prediction mode for the current block is uniformly applied to the sub-partitions, and the neighboring reference samples are derived and used in units of sub-partitions, so that the intra prediction performance can be improved in some cases. This prediction method can be called intra sub-partitioning (ISP) or ISP-based intra prediction.

[0146] The above-mentioned intra-frame prediction technology can be referred to by various terms, such as intra-frame prediction type, additive intra-frame prediction mode, etc., to distinguish the intra-frame prediction technology from the directional or non-directional intra-frame prediction mode. For example, the intra-frame prediction technology (intra-frame prediction type, additive intra-frame prediction mode, etc.) may include at least one of the above-mentioned LIP, LM, PDPC, MRL and ISP. Ordinary intra-frame prediction methods, rather than specific intra-frame prediction types such as LIP, LM, PDPD, MRL, ISP, etc., may be referred to as regular intra-frame prediction types. When these specific intra-frame prediction types are not applied, regular intra-frame prediction types may generally be applied, and prediction may be performed based on the above-mentioned intra-frame prediction modes. At the same time, post-filtering may be performed on the derived prediction samples when necessary.

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

[0148] In addition to the aforementioned intra prediction types, affine linear weighted intra prediction (ALWIP) can be used. ALWIP may also be referred to as linear weighted intra prediction (LWIP), matrix weighted intra prediction (MIP), or matrix-based intra prediction (MIP). When MIP is applied to the current block, i) neighboring reference samples on which an averaging process has been performed may be used; ii) matrix-vector multiplication may be performed; and iii) horizontal / vertical interpolation may be further performed, if necessary, to derive prediction samples for the current block. The intra prediction mode used for MIP may differ from the intra prediction modes used in the aforementioned LIP, PDPC, MRL, and ISP intra predictions, or from the intra prediction modes used in conventional intra prediction. The intra prediction mode used for MIP may be referred to as MIP intra prediction mode, MIP prediction mode, or MIP mode. For example, the matrix and offset used in the matrix-vector multiplication may be set differently depending on the intra prediction mode for the MIP. Here, the matrix may be referred to as a (MIP) weight matrix, and the offset may be referred to as a (MIP) offset vector or a (MIP) bias vector. The detailed MIP method will be described below.

[0149] The following will refer to Figure 4 and Figure 5 The present invention describes a block reconstruction process based on intra-frame prediction and an intra-frame prediction unit in an encoding device.

[0150] Figure 4 The present invention is a flowchart of a method for encoding a video / image based on intra-frame prediction.

[0151] Figure 4 The encoding method can be Figure 2 The image encoding device may perform the above operation. Specifically, operation S410 may be performed by the intra prediction unit 185, and operation S420 may be performed by the residual processor. Specifically, operation S420 may be performed by the subtractor 115. Operation S430 may be performed by the entropy encoder 190. The prediction information of operation S430 may be derived by the intra prediction unit 185, and the residual information of operation S430 may be derived by the residual processor. The residual information is information about the residual samples. The residual information may include information about the quantized transform coefficients of the residual samples. As described above, the residual samples may be derived as transform coefficients by the transformer 120 of the image encoding device, and the transform coefficients may be derived as quantized transform coefficients by the quantizer 130. The entropy encoder 190 may encode the information of the quantized transform coefficients through the residual encoding process.

[0152] The image encoding apparatus may perform intra prediction on the current block (S410). The image encoding apparatus may determine an intra prediction mode / type for the current block, derive neighboring reference samples for the current block, and then generate prediction samples for the current block based on the intra prediction mode / type and the neighboring reference samples. Here, the intra prediction mode / type determination process, the neighboring reference sample derivation process, and the prediction sample generation process may be performed simultaneously, or any one process may be performed before the other.

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

[0154] like Figure 5 As shown in FIG, the intra-frame prediction unit 185 of the image encoding device may include an intra-frame prediction mode / type determiner 186, a reference sample deriver 187, and / or a prediction sample deriver 188. The intra-frame prediction mode / type determiner 186 may determine the intra-frame prediction mode / type for the current block. The reference sample deriver 187 may derive neighboring reference samples of the current block. The prediction sample deriver 188 may derive the prediction sample of the current block. Meanwhile, although not shown in the figure, when performing the prediction sample filtering process described below, the intra-frame prediction unit 185 may further include a prediction sample filter (not shown).

[0155] The image encoding apparatus may determine a mode / type to be applied to a current block among a plurality of intra prediction modes / types. The image encoding apparatus may compare rate-distortion (RD) costs of the intra prediction modes / types with each other and determine an optimal intra prediction mode / type for the current block.

[0156] At the same time, the image encoding device can perform a prediction sample filtering process. Prediction sample filtering can be called post-filtering. Some or all of the prediction samples can be filtered through the prediction sample filtering process. In some cases, the prediction sample filtering process can be omitted.

[0157] Reference again Figure 4 , the image encoding apparatus may generate residual samples for the current block based on the prediction samples or the filtered prediction samples (S420). The image encoding apparatus may subtract the prediction samples from the original samples of the current block to derive the residual samples. In other words, the image encoding apparatus may derive the residual sample values ​​by subtracting the corresponding prediction sample values ​​from the original sample values.

[0158] The image encoding apparatus may encode image information including intra-frame prediction information (prediction information) and residual information of residual samples (S430). The prediction information may include intra-frame prediction mode information and / or intra-frame prediction technique information. The image encoding apparatus may output the encoded image information in the form of a bitstream. The output bitstream may be forwarded to the image decoding apparatus via a storage medium or a network.

[0159] The residual information may include a residual coding syntax to be described below. The image encoding apparatus may derive quantized transform coefficients by transforming / quantizing the residual samples. The residual information may include information about the quantized transform coefficients.

[0160] At the same time, as described above, the image encoding device can generate a reconstructed picture (including reconstructed samples and a reconstructed block). To this end, the image encoding device can derive (corrected) residual samples by dequantizing / inverse transforming the quantized transform coefficients. The reason for transforming / quantizing the residual samples and then performing dequantization / inverse transform is to derive residual samples that are identical to the residual samples derived by the image decoding device. The image encoding device can generate a reconstructed block including reconstructed samples for the current block based on the predicted samples and the (corrected) residual samples. A reconstructed picture for the current picture can be generated based on the reconstructed block. As described above, processes such as loop filtering can also be applied to the reconstructed picture.

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

[0162] The image decoding device can perform an operation corresponding to the operation performed by the image encoding device.

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

[0164] Specifically, the image decoding device may derive the intra-prediction mode / type for the current block based on the received prediction information (intra-prediction mode / type information) (S610). Furthermore, the image decoding device may derive neighboring reference samples for the current block (S620). The image decoding device may generate 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 may perform a prediction sample filtering process. Prediction sample filtering may be referred to as post-filtering. Some or all prediction samples may be filtered through the prediction sample filtering process. In some cases, the prediction sample filtering process may be omitted.

[0165] The image decoding apparatus may generate residual samples for the current block based on the received residual information (S640). The image decoding apparatus may generate reconstructed samples for the current block based on the predicted samples and the residual samples, and derive a reconstructed block including the reconstructed samples (S650). A reconstructed picture for the current picture may be generated based on the reconstructed block. As described above, a loop filtering process, etc., may be further applied to the reconstructed picture.

[0166] Figure 7 A diagram showing a configuration of the intra prediction unit 265 according to the present disclosure.

[0167] like Figure 7 As shown in FIG, the intra-frame prediction unit 265 of the image decoding device may include an intra-frame prediction mode / type determiner 266, a reference sample deriver 267, and a prediction sample deriver 268. The intra-frame prediction mode / type determiner 266 may determine the intra-frame prediction mode / type for the current block based on the intra-frame prediction mode / type information generated and signaled by the intra-frame prediction mode / type determiner 186, and the reference sample deriver 266 may derive the neighboring reference samples of the current block from the reference area reconstructed in the current picture. The prediction sample deriver 268 may derive the prediction sample of the current block. Meanwhile, although not shown in the figure, when performing the above-mentioned prediction sample filtering process, the intra-frame prediction unit 265 may further include a prediction sample filter (not shown).

[0168] The intra-frame prediction mode information may include flag information (e.g., intra_luma_mpm_flag) indicating, for example, whether the most probable mode (MPM) or the residual mode is applied to the current block. When MPM is applied to the current block, the intra-frame prediction mode information may further include index information (e.g., intra_luma_mpm_idx) indicating one of the intra-frame prediction mode candidates (MPM candidate). The intra-frame prediction model candidates (MPM candidate) may constitute an MPM candidate list or an MPM list. When MPM is not applied to the current block, the intra-frame prediction mode information may further include residual mode information (e.g., intra_luma_mpm_remainder) indicating one of the intra-frame prediction modes other than the intra-frame prediction mode candidate (MPM candidate). The image decoding device may determine the intra-frame prediction mode of the current block based on the intra-frame prediction mode information.

[0169] In addition, the intra-frame prediction technology information can be generated in various forms. For example, the intra-frame prediction technology information may include intra-frame prediction technology index information indicating one of the intra-frame prediction technologies. As another example, the intra-frame prediction technology information may include at least one of the following: reference sample line information indicating whether MRL is applied to the current block and which reference sample line is used when MRL is applied (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 partition type of the sub-partition when ISP is applied (e.g., intra_subparititions_split_flag), and flag information indicating whether PDPC is applied or flag information indicating whether LIP is applied. In addition, the intra-frame prediction type information may include a MIP flag indicating 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.

[0170] The intra-frame prediction mode information and / or the intra-frame prediction technique information may be encoded / decoded using the coding method described in the present disclosure. For example, the intra-frame prediction mode information and / or the intra-frame prediction technique information may be encoded / decoded using entropy coding based on truncated (Rician) binary code (e.g., CABAC or CAVLC).

[0171] Meanwhile, in addition to the planar mode, direct current (DC) mode, and directional intra prediction mode, intra prediction modes may include a cross-component linear model (CCLM) mode for chroma samples. To derive CCLM parameters, the CCLM mode can be classified into L_CCLM, T_CCLM, and LT_CCLM when only the left sample is considered, when only the top sample is considered, and when samples on both sides are considered, respectively. The CCLM mode can be applied only to chroma components.

[0172] For example, the intra prediction modes may be indexed as shown in Table 1 below.

[0173] [Table 1]

[0174]

[0175] At the same time, the intra-frame prediction type (or additive intra-frame prediction mode, etc.) may include at least one of the above-mentioned LIP, PDPC, MRL, and ISP. The intra-frame prediction type may be indicated based on the intra-frame prediction type information, which may be generated in various forms. As an example, the intra-frame prediction type information may include intra-frame prediction type index information indicating one of the intra-frame prediction types. As another example, the intra-frame prediction type information may include at least one of the following: reference sample line information (e.g., intra_luma_ref_idx) indicating whether MRL is applied to the current block and which reference sample line is used when MRL is applied, ISP flag information (e.g., intra_subpartitions_mode_flag) indicating whether ISP is applied to the current block, ISP type information (e.g., intra_subparititions_split_flag) indicating the partition type of the sub-partition when ISP is applied, and flag information indicating whether PDPC is applied or flag information indicating whether LIP is applied. In addition, the intra-frame prediction type information may include a MIP flag indicating whether MIP is applied to the current block.

[0176] MRL intra prediction

[0177] Figure 8 is a diagram illustrating a plurality of reference lines for intra prediction according to an embodiment of the present disclosure.

[0178] According to conventional intra-frame prediction, only the neighboring samples in the first row from the top and the first row from the left of the current block are used as reference samples for intra-frame prediction. On the other hand, according to the MRL method, intra-frame prediction can be performed using neighboring samples in a sample line that is one to three samples away from the top edge and / or left edge of the current block as reference samples. Alternatively, intra-frame prediction using the MRL method can be performed using neighboring samples in a sample line that is N samples away from the top edge and / or left edge of the current block as reference samples. Figure 8 An example of multiple reference lines is shown, and an MRL index (eg, mrl_idx) indicates which line is used for intra prediction of a current block.

[0179] For example, the MRL index may be signaled using coding unit syntax as shown in Table 2. The MRL index may be generated in the form of a syntax element intra_luma_ref_idx.

[0180] [Table 2]

[0181]

[0182] intra_luma_ref_idx[x0][y0] may indicate the intra-frame reference line index IntraLumaRefLineIdx[x0][y0]. When intra_luma_ref_idx[x0][y0] does not exist, its value may be inferred to be 0. intra_luma_ref_idx may be referred to as the (intra-frame) reference sample line index or mrl_idx. In addition, intra_luma_ref_idx may be referred to as intra_luma_ref_line_idx. Table 3 below shows the value of IntraLumaRefLineIdx[x0][y0] based on intra_luma_ref_idx[x0][y0].

[0183] [Table 3]

[0184]

[0185] MRLs cannot be used for blocks in the first line (row) of a CTU. In other words, when the upper boundary of the current block is a CTU boundary, MRLs cannot be used for the current block. In Table 2, when the upper boundary of the current block is a CTU boundary, intra_luma_ref_idx[x0][y0] does not exist and its value is inferred to be 0. Therefore, the first reference line can be used for the current block. This is intended to prevent the use of extended reference samples (lines) outside the current CTU line. In addition, when the above-mentioned additive reference line is used, the above-mentioned PDPC can be omitted.

[0186] Overview of TIMD

[0187] Figure 9 This figure shows a template region used in the TIMD mode according to the present disclosure. For the IPM() intra mode of adjacent intra blocks and inter blocks, the sum of absolute transform differences (SATD) between the predicted block predicted from the template region and the actual reconstructed sample can be calculated, and then the mode with the smallest SATD can be selected as the intra mode of the current block.

[0188] In other words, the intra prediction mode with the two smallest SATDs is selected as the TIMD mode. The two TIMD modes are fused with weights, and the current CU is encoded using this weighted intra prediction. PDPC can be included in the derivation process of the TIMD mode.

[0189] The costs of the two selected patterns are compared with a threshold, and in the test, two cost factors are applied as follows.

[0190] costMode2 < 2*costMode1

[0191] When the above conditions hold true, fusion is applied, and otherwise, only Mode 1 is used.

[0192] The weight of a pattern is calculated using its SATD cost as follows.

[0193] Weight 1 = costMode2 / (costMode 1 + costMode 2)

[0194] Weight2 = 1 − Weight1

[0195] Template Matching (TM)

[0196] Figure 10 is a diagram illustrating a TM-based encoding / decoding method according to the present disclosure.

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

[0198] like Figure 10 As shown in

[15] , when deriving an initial motion vector for a current block, a search for a better motion vector can be performed in the neighborhood of the initial motion vector. For example, the neighborhood in which the search is performed can be within a search region of [-8, +8] pixels relative to the initial motion vector. Furthermore, the search step size used to perform the search can be determined based on the adaptive motion vector resolution (AMVR) mode of the current block. Furthermore, in merge mode, TM can be performed as a continuation of the bilateral matching process.

[0199] When the prediction mode of the current block is Adaptive Motion Vector Prediction (AMVP) mode, a motion vector predictor (MVP) candidate may be determined based on the motion vector error. For example, an MVP candidate value may be selected that minimizes the error between the current template and the reference template. A motion vector refinement process may then be performed on the selected MVP candidate. However, for unselected MVP candidates, a motion vector refinement process may not be performed.

[0200] More specifically, an iterative diamond search can be used to refine the selected MVP candidate starting with full-pixel (integer-pixel) precision within the [-8, +8] pixel search region. Alternatively, in the case of a 4-pixel AMVR mode, refinement can start with 4-pixel precision. Subsequently, the search can follow half-pixel and / or quarter-pixel precision, depending on the AMVR mode. Depending on the search process, the MVP candidate can maintain the same motion vector precision as indicated by the AMVR mode after the TM process. The search process ends when the difference between the previous minimum cost and the current minimum cost during the iterative search process is less than a threshold. This threshold can be equal to the number of samples in the block region (i.e., the block). Table 4 shows an example of a search pattern according to the AMVR mode and the merge mode accompanying AMVR.

[0201] [Table 4]

[0202]

[0203] When the prediction mode of the current block is merge mode, a similar search method can be applied to the merge candidate indicated by the merge index. As shown in Table 4 above, TM can be performed up to 1 / 8 pixel precision, or skip half-pixel precision or lower precision, which may depend on whether an alternative interpolation filter is used based on the merge motion information. Here, the alternative interpolation filter may be the filter used when the AMVR mode is half-pixel mode. In addition, when TM is available, TM may be performed as a separate process depending on whether bilateral matching (BM) is available, or may be performed as an additional motion vector refinement process between a block-based BM and a sub-block-based BM. Whether TM is available and / or whether BM is available can be determined based on an availability condition check. In the above description, the accuracy of the motion vector may be the accuracy of the motion vector difference (MVD).

[0204] Overview of Template-based Multi-reference Line Intra Prediction (TMRL)

[0205] The TMRL mode is a mode obtained by combining a reference sample line and a prediction mode, and the TM method can be used to generate a combined candidate list. In order to indicate the reference sample line and prediction mode used to encode the current block, the combined candidate index in the combined candidate list can be encoded. In addition, the general MRL mode used for non-TIMD mode can be replaced with the TMRL mode.

[0206] The TMRL mode may extend the reference line candidate list and the intra prediction mode candidate list. The extended reference line candidate list may be {1, 3, 5, 7, 12}. However, the constraint on the top first CTU row may not change. The intra prediction mode candidate list may have a size of 10. The intra prediction mode candidate list may be similar to the MPM candidate list except for the planar mode. The DC mode may be added after the mode of the 5 neighboring PUs, and the DIMD mode may be added when the DIMD mode is not included or the directional mode is a directional mode with a ±1 to ±4 delta angle (compared to the existing directional mode of the intra prediction mode candidate list).

[0207] TMRL candidates can be generated as follows: There are 50 (=5×10) possible combinations of extended reference sample lines and available intra prediction modes for the current block. Since the extended reference sample line starts from reference sample line 1, the area covered by reference sample line 0 can be used for TM.

[0208] Figure 11 is a diagram showing a template region in TMRL according to the present disclosure. The prediction (generated as 50 combinations) samples and the reconstructed samples can be used to calculate the Figure 11The SAD cost of the template area of ​​​​the reference sample line is calculated. A TMRL candidate list can be generated by selecting the 20 combinations with the lowest SAD cost in ascending order. Instead of directly encoding the reference sample line and intra-frame prediction mode, the index of the TMRL candidate list can be encoded to signal the TMRL and indicate which combination of reference sample line and intra-frame prediction mode is used to encode the current block.

[0209] An image encoding / decoding method according to an embodiment of the present disclosure will be described in detail below.

[0210] The present invention relates to intra prediction, and in particular to a method for generating reference samples suitable for a plurality of reference sample lines when performing intra prediction using the plurality of reference sample lines to improve intra prediction efficiency.

[0211] Figure 12 is a diagram showing a reference sample line for generating an intra-frame prediction block according to the present disclosure. Currently, reference samples are used to generate an intra-frame prediction block, and the reference samples are generated using previously reconstructed samples close to the current block. In addition, as Figure 12 As shown in , all intra directional modes are considered to use reference samples of size (2×W)+(2×H)+(4×m)+1 for a current block with width W and height H. Figure 12 In

[15] , reference sample line m may be a reference sample line located at a sample distance m from the top edge and / or left edge of the current block. Here, m may be a real number. However, some samples in reference sample line m required for predicting the current block may be unavailable due to, for example, being outside the picture boundary. To address this issue, several embodiments are proposed below.

[0212] Example 1

[0213] The present disclosure provides a method for performing intra prediction by padding samples with available reference samples when some samples in a reference sample line are unavailable. The situation where some samples in the reference sample line are unavailable may be a situation where some samples in the reference sample line are outside a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a virtual pipeline data unit (VPDU) boundary, or a CTU boundary.

[0214] In this case, conventional intra prediction is performed by filling the positions of unavailable reference samples in a reference sample line with previously reconstructed available samples in the same sample line. However, when previously reconstructed samples in the same sample line are used for filling, the previously reconstructed samples are far away from these positions, which may be ineffective for intra prediction. In particular, when a reference sample line that is far away from the current block is used, the filling effect may be further degraded. Therefore, instead of filling the unavailable reference samples with previously reconstructed samples in the same reference sample line, filling the previously reconstructed samples with closer previously reconstructed samples in another reference sample line may be effective in increasing the prediction accuracy. This will be referred to below. Figure 13 Provide a description.

[0215] Figure 13 FIG is a diagram illustrating a method of filling reference samples according to an embodiment of the present disclosure. Figure 13 , the available reference samples 1320 in the reference sample line m (1310) are within the picture boundary and thus may be available for intra prediction, but the unavailable reference samples 1330 in the reference sample line m (1310) are outside the picture boundary 1350 and thus may be unavailable. In this case, the portion of the reference sample line m (1310) outside the picture boundary 1350 (i.e., 1330) may be filled with the previously reconstructed reference samples 1340 in another reference sample line. In other words, the unavailable reference samples 1330 in the reference sample line m (1310) may be filled with the previously reconstructed reference samples 1340 in another reference sample line. Here, the previously reconstructed reference samples 1340 in another reference sample line may be determined as previously reconstructed reference samples that are located close to the unavailable reference samples 1330 in the reference sample line m. According to the present disclosure, it is possible to increase prediction accuracy by filling the unavailable reference samples in a reference sample line with previously reconstructed samples that are located close to each other.

[0216] According to an embodiment of the present disclosure, when the currently used reference sample line is m, the previously reconstructed sample closest in sample distance to the location of the unavailable sample in reference sample line m can be used. In other words, the unavailable samples in reference sample line m can be filled with the previously reconstructed sample closest to the location of the unavailable sample in reference sample line m. The currently used reference sample line and the previously reconstructed sample used for filling can be the same or different. In addition, the unavailable sample can be a reference sample located outside a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a VPDU boundary, or a CTU boundary.

[0217] Figure 14 is a diagram illustrating a method of filling reference samples located outside a vertical boundary according to an embodiment of the present disclosure. Figure 14When a boundary 1420 (e.g., a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a VPDU boundary, a CTU boundary, etc.) exists in the vertical direction, some unavailable reference samples 1450 in the reference sample line m (1410) having the same y coordinate as the reference sample A (1430) may be filled with the reference sample A (1430). In other words, some unavailable reference samples 1450 in the reference sample line m (1410) having the same y coordinate as the reference sample A (1430) closest to the boundary in the reference sample line m (1410) may be filled with the reference sample A (1430) which is a sample in the same reference sample line m.

[0218] In addition, unavailable reference samples 1450 in reference sample line m, which have a y coordinate that is not equal to the y coordinate of reference sample A (1430) and is less than or equal to the y coordinate of reference sample B (1440) having the largest y coordinate among the available samples in another reference sample line 1460, may be filled with previously reconstructed reference samples that are closest in the horizontal direction to the unavailable reference sample 1450. In other words, unavailable reference samples 1450 in reference sample line m, which have a y coordinate that is not equal to the y coordinate of reference sample A (1430) and is less than or equal to the y coordinate of reference sample B (1440), may be filled with previously reconstructed reference samples 1460 in another reference sample line.

[0219] In addition, unavailable reference samples 1450 in the reference sample line m having a y coordinate greater than the y coordinate of reference sample B (1440) may be filled with reference sample B (1440). In other words, unavailable reference samples 1450 in the reference sample line m having a y coordinate greater than the y coordinate of reference sample B (1440) may be filled with reference sample B (1440), which is the most recent previously reconstructed sample.

[0220] Figure 15 is a diagram illustrating a method of filling reference samples outside a horizontal boundary according to an embodiment of the present disclosure. Figure 15 When a boundary 1520 (e.g., a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a VPDU boundary, a CTU boundary, etc.) exists in the horizontal direction, some of the unavailable reference samples 1550 in the reference sample line m (1510) having the same x-coordinate as the reference sample A (1530) closest to the boundary in the reference sample line m (1510) may be filled with the reference sample A (1530). In other words, some of the unavailable reference samples 1550 in the reference sample line m (1510) having the same x-coordinate as the reference sample A (1530) may be filled with the reference sample A (1530) which is a sample in the same reference sample line m.

[0221] In addition, unavailable reference samples 1550 in reference sample line m, which have an x ​​coordinate that is not equal to the x coordinate of reference sample A (1530) and is less than or equal to the x coordinate of reference sample B (1540) having the largest x coordinate among available samples in another reference sample line 1560, may be filled with previously reconstructed reference samples that are closest in the vertical direction to the unavailable reference sample 1550. In other words, unavailable reference samples 1550 in reference sample line m, which have an x ​​coordinate that is not equal to the x coordinate of reference sample A (1530) and is less than or equal to the x coordinate of reference sample B (1540), may be filled with previously reconstructed reference samples 1560 in another reference sample line.

[0222] In addition, unavailable reference samples 1550 in reference sample line m having an x-coordinate greater than that of reference sample B (1540) may be filled with reference sample B (1540). In other words, unavailable reference samples 1550 in reference sample line m having an x-coordinate greater than that of reference sample B (1540) may be filled with reference sample B (1540), which is the most recent previously reconstructed sample.

[0223] Figure 16 FIG is a flowchart of a method for filling reference samples according to an embodiment of the present disclosure. Figure 16 , the image decoding device 200 may parse the intra-frame prediction mode (S1610). Here, the intra-frame prediction mode may be a planar mode, a DC mode, a directional mode 2 to 66, or the like. Subsequently, the image decoding device 200 may determine whether the position of the reference sample is located outside the boundary (S1630). In other words, the image decoding device 200 may determine whether the position of the reference sample used to generate the prediction block is located outside the boundary. When the position of the reference sample is located outside the boundary (yes in operation S1630), the image decoding device 200 may generate a reference sample based on pixel distance (S1670). Here, a pixel distance-based padding process may be performed on the reference sample outside the boundary based on the reference sample in the previously reconstructed sample area.

[0224] When the position of the reference sample is not outside the boundary (No in operation S1630), the image decoding device 200 can generate a reference sample in a conventional manner (S1650). Subsequently, the image decoding device 200 can generate a prediction block based on the reference sample generated in operation S1650 or S1670 (S1690). The present disclosure is not limited thereto, and Figure 16 The process can be uniformly performed by the image encoding device 100.

[0225] According to an embodiment of the present disclosure, reference samples used to predict the current block may be generated through the process shown in Table 5 below.

[0226] [Table 5]

[0227]

[0228] According to another embodiment of the present disclosure, when the currently used reference sample line is m, the unavailable reference samples in the reference sample line m can be filled with previously reconstructed samples based on the intra prediction mode of the unavailable reference sample positions in the reference sample line m. The currently used reference sample line and the reference sample line including the previously reconstructed samples used for filling can be the same or different. Here, the unavailable reference samples in the reference sample line m can be reference samples located outside a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a VPDU boundary, or a CTU boundary. Figures 17 to 19 This is described in detail.

[0229] Figure 17 is a diagram illustrating a method of filling reference samples outside the vertical boundary according to an embodiment of the present disclosure. Figure 17 , the unavailable reference samples 1750 in the reference sample line m (1710) can be filled based on its intra prediction mode. Specifically, when the intra prediction mode of the unavailable reference samples 1750 in the reference sample line m is directional mode 34 and there is a vertical boundary, samples from the reference sample A (1730) closest to the boundary in the reference sample line m (1710) to the reference sample B (1740) with the largest y coordinate among the available samples in another reference sample line 1760 can be used to generate the unavailable reference samples in the reference sample line m in direction 34. In other words, the unavailable reference samples 1750 in the reference sample line m can be filled with the previously reconstructed reference samples 1760 in the other closest reference sample line in direction 34. Alternatively, the unavailable reference samples 1750 in the reference sample line m can be filled with samples generated by applying the same or different interpolation filter as the interpolation filter used for prediction block generation to the previously reconstructed reference samples 1760 in the other closest reference sample line in direction 34. For example, the interpolation filter may be a cubic filter, a Gaussian filter, etc., and vary in size such as 2 taps, 4 taps, 6 taps, 8 taps, etc.

[0230] When there is no previously reconstructed sample in direction 34, unavailable reference sample 1750 in reference sample line m may be filled with the most recent previously reconstructed sample. In other words, when there is no previously reconstructed sample in direction 34, unavailable reference sample 1750 in reference sample line m may be filled with reference sample B (1740), which is the most recent previously reconstructed sample.

[0231] Figure 18 is a diagram illustrating a method of filling reference samples outside a horizontal boundary according to an embodiment of the present disclosure. Figure 18 , the unavailable reference samples 1850 in the reference sample line m (1810) can be filled based on its intra prediction mode. Specifically, when the intra prediction mode of the unavailable reference samples 1850 in the reference sample line m is directional mode 34 and there is a horizontal boundary, samples from the reference sample A (1830) closest to the boundary in the reference sample line m (1810) to the reference sample B (1840) with the largest x-coordinate among the available samples in another reference sample line 1860 can be used to generate the unavailable reference samples in the reference sample line m in direction 34. In other words, the unavailable reference samples 1850 in the reference sample line m can be filled with the previously reconstructed reference samples 1860 in the other closest reference sample line in direction 34. Alternatively, the unavailable reference samples 1850 in the reference sample line m can be filled with samples generated by applying the same or different interpolation filter as the interpolation filter used for prediction block generation to the previously reconstructed reference samples 1860 in the other closest reference sample line in direction 34. For example, the interpolation filter may be a cubic filter, a Gaussian filter, etc., and vary in size such as 2 taps, 4 taps, 6 taps, 8 taps, etc.

[0232] When there is no previously reconstructed sample in direction 34, unavailable reference sample 1850 in reference sample line m may be filled with the most recent previously reconstructed sample. In other words, when there is no previously reconstructed sample in direction 34, unavailable reference sample 1850 in reference sample line m may be filled with reference sample B (1840), which is the most recent previously reconstructed sample.

[0233] Figure 19 is a flowchart of a method for filling reference samples based on intra prediction mode according to an embodiment of the present disclosure. Figure 19 , the image decoding device 200 may parse the intra prediction mode (S1910). Here, the intra prediction mode may be a planar mode, a DC mode, a directional mode 2 to 66, or the like. Subsequently, the image decoding device 200 may determine whether the position of the reference sample is located outside the boundary (S1930). In other words, the image decoding device 200 may determine whether the position of the reference sample used to generate the prediction block is located outside the boundary. When the position of the reference sample is located outside the boundary (yes in operation S1930), the image decoding device 200 may generate the reference sample based on the intra prediction mode (S1970). Here, a padding process based on the intra prediction mode may be performed on the reference sample outside the boundary based on the reference sample in the previously reconstructed sample area.

[0234] When the position of the reference sample is not outside the boundary (No in operation S1930), the image decoding device 200 can generate a reference sample in a conventional manner (S1950). Subsequently, the image decoding device 200 can generate a prediction block based on the reference sample generated in operation S1950 or S1970 (S1990). The present disclosure is not limited thereto, and Figure 19 The process can be uniformly performed by the image encoding device 100.

[0235] The present disclosure proposes a method of filling unavailable samples with samples that are closest to the position of the unavailable samples among previously reconstructed samples when there are unavailable samples among the samples belonging to the currently used reference sample line. Unlike the above description, the method of selecting previously reconstructed samples to fill unavailable samples is not limited to the closest samples. In other words, when there are multiple available reference sample lines between the block currently performing intra-frame prediction and the reference sample line m, the unavailable samples in the reference sample line m can be filled based on one of the multiple available reference sample lines. The method of selecting one of the multiple reference sample lines can be a method of sending explicit index information indicating the corresponding sample line from the encoder to the decoder. Alternatively, one of the multiple reference sample lines can be directly derived and selected by the decoder.

[0236] Example 2

[0237] The present disclosure relates to a method for generating an MRL candidate list when performing intra prediction using multiple reference sample lines. Currently, the Enhanced Compression Model (ECM) generates an MRL candidate list including reference sample lines 0, 1, 3, 5, 7, and 12. However, as Figure 20 The cross-border reference sample line 2010 shown in FIG may degrade the effect of the multiple reference sample line technique. In this case, image encoding and / or decoding efficiency can be increased by including another reference sample line in the reference line candidate list. Here, the cross-border reference sample line can be a reference sample line that includes samples located outside a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a VPDU boundary, or a CTU boundary.

[0238] According to an embodiment of the present disclosure, when a candidate reference sample line m in the MRL candidate list crosses a boundary, the reference sample line crossing the boundary can be replaced with a reference sample line k. Here, m can be a real number. k can be a real number smaller than m.

[0239] Figure 21 is a diagram illustrating a reference sample line replacement method according to an embodiment of the present disclosure. Figure 21, reference sample line 12 (i.e., the first reference sample line) crosses boundary 2110 and can therefore be replaced by one of reference sample lines 8, 9, 10, and 11 (i.e., the second reference sample line), and the replaced reference sample line can constitute the MRL candidate list. Therefore, when the existing MRL candidate list is {0, 1, 3, 5, 7, 12}, the replacement MRL candidate list can be {0, 1, 3, 5, 7, k}.

[0240] According to an embodiment of the present invention, when the MRL candidate list has a size of L (L is a real number), n reference sample lines may not cross the boundary (n < L). In this case, there are various methods for filling the MRL candidate list with L candidates. Figure 22 Provide a description.

[0241] Figure 22 is a diagram illustrating a reference sample line replacement method according to an embodiment of the present disclosure. Figure 22 , L candidates starting from the reference sample line close to the current block can be included as candidates of the MRL candidate list. For example, when L is 6, the MRL candidate list can be {0, 1, 2, 3, 4, 5}.

[0242] According to another embodiment of the present disclosure, reference sample lines selected from the n reference sample lines that do not cross the boundary 2210 may constitute an MRL candidate list. In this case, the other Ln reference sample lines may be filled with reference sample line candidates that are not included in the default reference sample line candidates. For example, when L is 6 and the default reference sample line candidates are {0, 1, 3, 5, 7, 12}, the MRL candidate list may be {0, 1, 2, 3, 5, 7}, {0, 1, 2, 3, 5, 12}, or {0, 1, 2, 3, 7, 12}. The default reference sample line candidates mentioned in this embodiment are not limited to {0, 1, 3, 5, 7, 12}, and may include various reference sample lines.

[0243] According to another embodiment of the present disclosure, the MRL candidate list may include only n reference sample lines that do not cross the boundary 2210. For example, Figure 22 In , the MRL candidate list can be {0, 1, 2, 3}.

[0244] According to another embodiment of the present disclosure, the MRL candidate list may only include default reference lines that do not cross the boundary 2210. For example, Figure 22 , when L is 6 and the default reference sample line candidates are {0, 1, 3, 5, 7, 12}, the MRL candidate list can be {0, 1, 3}.

[0245] Figure 23 : is a flowchart of a method for generating an MRL list according to an embodiment of the present disclosure. Figure 23 , the image decoding device 200 can parse the intra-frame prediction mode and MRL index (S2310). Here, the intra-frame prediction mode can be a planar mode, a DC mode, a directional mode 2 to 66, etc. The intra-frame prediction mode and the MRL index can be information parsed in the TMRL mode. In other words, when the TMRL mode is true, the index information parsed in the TMRL mode can be the intra-frame prediction mode and the MRL index. For example, the MRL index can be binarized by truncated Golomb-Rice coding. As another example, MRL indexes 0 to 5 can be binarized to 0, 10, 110, 11110, and 11111, respectively.

[0246] Subsequently, the image decoding apparatus 200 may determine whether the position of the reference sample is located outside the boundary (S2330). In other words, the image decoding apparatus 200 may determine whether the reference sample outside the boundary is included in the reference sample line indicated by the MRL index.

[0247] When the reference sample in the reference sample line is outside the boundary (yes in operation S2330), the image decoding device 200 can generate a replacement MRL list (S2370). In other words, the image decoding device 200 can generate a replacement MRL list based on the above method. When the reference sample in the reference sample line is not outside the boundary (no in operation S2330), the image decoding device 200 can generate a default MRL list (S2350). The default MRL list can be {0, 1, 3, 5, 7, 12}. However, the present disclosure is not limited to this, and the default MRL list can be a combination of various reference sample lines. Subsequently, the image decoding device 200 can generate a prediction block based on the MRL list generated in operation S2350 or S2370.

[0248] Example 3

[0249] This disclosure proposes a method for adaptively using intra-frame prediction modes for reference samples. Currently, intra-frame prediction blocks are generated using planar mode, DC mode, and one of 65 directional modes. However, when some of the reference samples required to generate the prediction block are padded with specific values, using these reference samples to generate the prediction block may not be efficient.

[0250] For example, Figure 24As shown in , the left reference sample line of the current block is located outside the boundary 2410, and therefore, the left reference sample of the current block can be padded with the previously reconstructed sample at the position of the reference sample a (2420) closest to the boundary. Therefore, the left reference samples of the current block may have the same value, and it may not be effective to generate the prediction block using directional modes 2 to 34. In this case, the vertical intra mode may be more effective. In the present disclosure, the reference sample outside the boundary may be a sample located outside a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a VPDU boundary, or a CTU boundary.

[0251] Figures 25A and 25B illustrate diagrams of reference sample lines according to an embodiment of the present disclosure. When the reference sample region is outside of boundary 2510 or 2520, the intra-frame prediction mode used to generate the current block can be adaptively used. In other words, out of a total of M intra-frame prediction mode candidates used to generate the prediction block, only m intra-frame prediction mode candidates can be used. Here, M and m are real numbers, and m≤M holds true.

[0252] In addition, the number m of intra-frame prediction mode candidates may be equal to the number of intra-frame prediction modes based on which the intra-frame prediction block is generated using only available reference samples without padding. In other words, the number m of intra-frame prediction mode candidates may be equal to the number of intra-frame prediction modes that refer only to available reference samples. For example, in Figure 25A, the intra-frame prediction mode candidates may be limited to planar mode, DC mode, and directional modes 34 to 66. In other words, the directional mode may be limited to directional modes 34 to 66 referenced only by available reference samples. In Figure 25B, the intra-frame prediction mode candidates may be limited to planar mode, DC mode, and directional modes 2 to 34. In other words, the directional mode may be limited to directional modes 2 to 34 referenced only by available reference samples.

[0253] When using these restricted modes, it may not be efficient to have 6 candidates for the MPM list in the traditional manner. Similarly, it may not be efficient to keep the number of candidates for the secondary MPM list the same as 16 in the traditional manner. Therefore, it is necessary to change the number of candidates for the MPM list or the number of candidates for the secondary MPM list.

[0254] According to an embodiment of the present disclosure, when the reference sample region required for generating a prediction block is outside the boundary, the number of candidates for the MPM list may be changed. For example, the number of candidates for the MPM list may be 3. Alternatively, when the reference sample region required for generating a prediction block is outside the boundary, the number of candidates for the secondary MPM list may be changed. For example, the number of candidates for the secondary MPM list may be 8.

[0255] As described above, when limited mode is used, the intra-frame prediction mode can be derived in a limited manner in TIMD mode or DIMD mode. According to an embodiment of the present disclosure, when the reference sample area required to generate the prediction block is outside the boundary, the intra-frame prediction mode derived in the TIMD mode can be limited. For example, in Figure 25A, the intra-frame prediction mode derived in the TIMD mode can be one of the planar mode, DC mode, and directional modes 34 to 66. In Figure 25B, the intra-frame prediction mode derived in the TIMD mode can be one of the planar mode, DC mode, and directional modes 2 to 34.

[0256] According to another embodiment of the present disclosure, when the reference sample area required to generate the prediction block is outside the boundary, the intra-frame prediction mode derived in the DIMD mode can be limited. For example, in Figure 25A, the intra-frame prediction mode derived in the DIMD mode can be one of the planar mode, DC mode, and directional modes 34 to 66. In Figure 25B, the intra-frame prediction mode derived in the DIMD mode can be one of the planar mode, DC mode, and directional modes 2 to 34.

[0257] Example 4

[0258] The present disclosure proposes a method for refining intra prediction using a TIMD mode or TMRL using template cost. TMRL may be a mode that calculates a template cost using a combination of intra prediction mode candidates and reference sample line candidates and then performs reordering based on the template cost. However, when one of the reference sample line candidates is located at a position such as Figure 26 When the image is outside the picture boundary 2610 shown in , the unavailable sample positions are filled with previously reconstructed available samples in the reference sample line (i.e., reference sample A (2620)), and thus the template cost calculation may be inaccurate. Therefore, it may be more efficient to generate reference samples by filling the unavailable sample positions with closer previously reconstructed samples in another reference sample line.

[0259] According to the present disclosure, when one of the reference sample line candidates of the TMRL is m, the previously reconstructed samples that are closest to the corresponding sample position in terms of sample distance can be used to fill in the unavailable samples in the reference sample line m. The currently used reference sample line and the reference sample line used for filling, which includes the previously reconstructed samples, can be the same or different. Here, the reference sample outside the boundary can be a reference sample located outside a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a VPDU boundary, or a CTU boundary.

[0260] Figure 272 is a diagram illustrating a method for filling a reference sample line that crosses a vertical boundary according to an embodiment of the present disclosure. When a vertical boundary 2710 exists, reference sample A (2730) may be used to fill in unavailable reference samples in reference sample line m (2720) that have the same y coordinate as reference sample A (2730) that is closest to the boundary in reference sample line m (2720). Unavailable reference samples in reference sample line m (2720) that have a y coordinate value greater than the y coordinate of reference sample A (2730) and less than or equal to the y coordinate of reference sample B (2740) that has the largest y coordinate among available samples in another reference sample line may be filled in with previously reconstructed reference samples that are closest to the unavailable reference samples in the horizontal direction. In addition, reference sample B (2740) may be used to fill in unavailable reference samples in reference sample line m that have a y coordinate value greater than the y coordinate of reference sample B (2740).

[0261] Figure 28 2 is a diagram illustrating a template area and reference sample lines according to an embodiment of the present disclosure. When a horizontal boundary 2810 exists, unavailable reference samples in reference sample m (2820) having the same x-coordinate as reference sample A (2830) closest to the boundary in reference sample line m (2820) may be filled with reference sample A (2830). Unavailable reference samples in reference sample line m (2820) having an x-coordinate value greater than that of reference sample A (2830) and less than or equal to that of reference sample B (2840) having the largest x-coordinate among available samples in another reference sample line may be filled with previously reconstructed reference samples closest to the unavailable reference samples in the vertical direction. In addition, unavailable reference samples in reference sample line m having an x-coordinate greater than that of reference sample B (2840) may be filled with reference sample B (2840).

[0262] Figure 29 is a set of diagrams illustrating a method of filling reference samples based on sample distance when the reference samples are outside the boundary according to an embodiment of the present disclosure. Figure 29 As shown in , the reference sample filling method can also be applied in TIMD mode. In addition, according to an embodiment of the present disclosure, the reference sample for predicting the current block can be generated through the process of Table 5 above.

[0263] According to an embodiment of the present disclosure, when one of the reference sample line candidates of the TMRL is m, unavailable reference samples in the reference sample line m can be filled with previously reconstructed samples based on the intra-frame prediction mode of the sample. In other words, when unavailable samples exist in the reference sample line m, the samples can be filled with previously reconstructed samples based on the intra-frame prediction mode of the sample. Here, the currently used reference sample line and the reference sample line used for filling, which includes the previously reconstructed samples, can be the same or different.

[0264] Figure 30 is a diagram illustrating a method of padding reference samples based on an intra prediction mode when the reference samples are outside a boundary according to an embodiment of the present disclosure. Figure 30 , when the intra prediction mode of the unavailable reference samples in the reference sample line m (3020) is the directional mode 34 and there is a vertical boundary 3010, samples from the reference sample A (3030) closest to the boundary in the reference sample line m (3020) to the reference sample B (3040) having the largest y-coordinate among the available samples in another reference sample line can be used to generate samples outside the boundary in the direction of the directional mode 34. In other words, the unavailable reference samples in the reference sample line m (3020) can be filled with the previously reconstructed samples existing in the direction of the directional mode 34. The unavailable reference samples in the reference sample line m that do not have previously reconstructed samples in the direction of the directional mode 34 can be filled with the nearest previously reconstructed samples. In other words, the unavailable reference samples in the reference sample line m that do not have previously reconstructed samples in the direction of the directional mode 34 can be filled with the reference sample B (3040).

[0265] Figure 31 is a diagram illustrating a method of padding reference samples based on an intra prediction mode when the reference samples are outside a boundary according to an embodiment of the present disclosure. Figure 31 , when the intra prediction mode of the unavailable reference samples in the reference sample line m (3120) is directional mode 34 and there is a horizontal boundary 3110, samples from the reference sample A (3130) closest to the boundary in the reference sample line m (3120) to the reference sample B (3140) having the largest x-coordinate among the available samples in another reference sample line can be used to generate samples outside the boundary in the direction of the directional mode 34. In other words, the unavailable reference samples in the reference sample line m (3120) can be filled with previously reconstructed samples existing in the direction of the directional mode 34. The unavailable reference samples in the reference sample line m (3120) that do not have previously reconstructed samples in the direction of the directional mode 34 can be filled with the nearest previously reconstructed samples. In other words, the unavailable reference samples in the reference sample line m (3120) that do not have previously reconstructed samples in the direction of the directional mode 34 can be filled with the reference sample B (3140).

[0266] Figure 32 FIG2 is a diagram illustrating a method for padding reference samples based on sample distance when the reference samples are outside the boundary in TIMD mode according to an embodiment of the present disclosure. According to the present disclosure, the above-mentioned reference sample padding process is also applied in TIMD mode.

[0267] Figure 33is a collection of diagrams illustrating template areas outside of boundaries according to an embodiment of the present disclosure. Figure 33 When the template area is outside the boundary, the template area used in TIMD or TMRL mode may change. For example, when the left template area of ​​the current block is outside the boundary 3310, only the upper template area of ​​the current block can be used to calculate the template cost. In addition, when the upper template area of ​​the current block is outside the boundary 3320, only the left template area of ​​the current block can be used to calculate the template cost.

[0268] The present disclosure proposes a method for filling unavailable samples with samples closest to the unavailable samples among previously reconstructed samples when the unavailable samples belong to the currently used reference sample line. Unlike the above description, the method of selecting previously reconstructed samples to fill unavailable samples is not limited to the closest samples. In other words, when there are multiple available reference sample lines between the block currently performing intra-frame prediction and the reference sample line m, the unavailable samples in the reference sample line m can be filled based on one of the multiple available reference sample lines. The method of selecting one of the multiple reference sample lines can be a method of sending explicit index information indicating the corresponding sample row from the encoder to the decoder. Alternatively, one of the multiple reference sample lines can be directly derived and selected by the decoder.

[0269] Figure 34 FIG. 1 is a flowchart of an image encoding / decoding method according to an embodiment of the present disclosure. Figure 20 , the image encoding apparatus 100 and / or the image decoding apparatus 200 may select a first reference sample line for the current block (S3410). Here, the first reference sample line may be a reference sample line used to predict the current block.

[0270] The image encoding device 100 and / or the image decoding device 200 may determine whether some reference samples in the first reference sample line are available (S3430). Subsequently, the image encoding device 100 and / or the image decoding device 200 derives a second reference sample line for the current block (S3450). Specifically, the image encoding device 100 and / or the image decoding device 200 may derive the second reference sample line based on the determination of operation S3430. Here, the second reference sample line may be a reference sample line that has already been filled. Alternatively, when it is determined in operation S3430 that all reference samples in the first reference sample line are available, the second reference sample line may be the same as the first reference sample line.

[0271] According to an embodiment of the present disclosure, if at least one reference sample in a first reference sample line is unavailable, a second reference sample line can be obtained by deriving the value of at least one reference sample using reference sample lines other than the first reference sample line. In other words, when at least one reference sample in the first reference sample line is outside the boundary, the second reference sample line can be derived based on reference sample lines other than the first reference sample line. Here, the process of deriving the second reference sample line may include the process of filling in the unavailable reference samples included in the first reference sample line.

[0272] Here, the reference sample used to derive the value of at least one reference sample in another reference sample line can be determined based on its distance from at least one reference sample. Specifically, when at least one reference sample in a first reference sample line is outside the boundary, the reference sample in the other reference sample line used to derive the second reference sample line can be determined based on its distance from the sample outside the boundary in the first reference sample line. In other words, the reference sample used to derive the value of at least one reference sample can be determined as the reference sample closest to the at least one reference sample. In this case, the closest reference sample can be a previously reconstructed sample.

[0273] According to an embodiment of the present disclosure, a reference sample used to derive at least one reference sample value may be determined based on any one of a horizontal distance from at least one reference sample, a vertical distance from the reference sample, and a distance in an intra-prediction mode direction of the at least one reference sample. In other words, when at least one reference sample in a first reference sample line is unavailable, the reference sample used to derive the at least one reference sample may be determined based on a previously reconstructed sample closest horizontally to the at least one reference sample, a previously reconstructed sample closest vertically to the at least one reference sample, and the intra-prediction mode.

[0274] According to an embodiment of the present disclosure, an operation may be added to generate a reference sample line list including a second reference sample line based on the unavailability of at least one reference sample in the first reference sample line. In this case, the first reference sample line may not be included in the reference sample line list. Furthermore, the second reference sample line may be a reference sample line consisting of available samples. Here, available samples may be samples that are not located outside of a boundary. In other words, available samples may be samples that are not located outside of a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a VPDU boundary, or a CTU boundary.

[0275] According to an embodiment of the present disclosure, the image encoding device 100 and / or the image decoding device 200 may further include an operation of generating an intra-frame prediction candidate list for the current block. Based on the fact that at least one reference sample is unavailable in the first reference sample line, the intra-frame prediction candidate list may be composed of intra-frame prediction modes that do not reference the unavailable reference samples. For example, when the upper reference sample line of the current block crosses the boundary, the intra-frame prediction candidate list may be composed only of intra-frame prediction modes that do not reference the reference samples in the upper reference sample line. Alternatively, when the left reference sample line of the current block crosses the boundary, the intra-frame prediction candidate list may be composed only of intra-frame prediction modes that do not reference the reference samples in the left reference sample line.

[0276] According to an embodiment of the present disclosure, the intra prediction mode of the current block can be determined as one of TIMD or TMRL. Here, based on the unavailability of at least one reference sample in the first reference sample line, the reference samples in the second reference sample line can be used to calculate the TM cost for predicting the current block. In other words, based on the unavailability of at least one reference sample in the first reference sample line, the reference samples that have been filled in the second reference sample line can be used to calculate the TM cost for predicting the current block.

[0277] According to an embodiment of the present disclosure, the intra prediction mode of the current block can be determined as one of TIMD or TMRL. In this case, based on the fact that at least one reference sample is not available in the first template area used to calculate the TM cost of the current block, the second template area can be used to calculate the TM cost. For example, when at least one reference sample is not available in the left template area used to calculate the TM cost of the current block, the upper template area can be used to calculate the TM cost. Alternatively, when at least one reference sample is not available in the upper template area used to calculate the TM cost of the current block, the left template area can be used to calculate the TM cost.

[0278] For ease of description, the exemplary methods of the present disclosure are described as a series of operations. However, this is not intended to limit the order in which the operations are performed, and these operations can be performed simultaneously or in different orders if necessary. In order to implement the methods according to the present disclosure, the exemplary operations may additionally include other operations, including operations in addition to some operations, or including additional other operations that replace some operations.

[0279] According to the present disclosure, an image encoding device or image decoding device that performs a specific operation (step) may perform an operation (step) to check the execution conditions or circumstances of the corresponding operation (step). For example, when a specific operation is described as being performed when a specific condition is satisfied, the image encoding device or image decoding device may perform an operation to determine whether the specific condition is satisfied and then perform the specific operation.

[0280] The various embodiments of the present disclosure are not a list of all possible combinations, but are intended to describe representative aspects of the present disclosure. The description of the various embodiments can be applied independently or in pairs or more.

[0281] In addition, various embodiments of the present disclosure may be implemented using hardware, firmware, software, a combination thereof, etc. Hardware implementations may include one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, etc.

[0282] In addition, the image decoding device and the image encoding device to which the embodiments of the present disclosure are applied may be included in multimedia broadcast transmission and reception devices, mobile communication terminals, home theater video equipment, digital theater video equipment, surveillance cameras, video conversation equipment, equipment for real-time communication such as video communication, mobile streaming devices, storage media, cameras, video on demand (VoD) service provision equipment, over-the-top (OTT) video equipment, Internet streaming service provision equipment, three-dimensional (3D) video equipment, video telephony equipment, medical video equipment, and the like, and may be used to process video signals or data signals. For example, OTT video equipment may include game consoles, Blu-ray players, Internet televisions (TVs), home theater systems, smartphones, tablet personal computers (PCs), digital video recorders (DVRs), and the like.

[0283] Figure 35 is a diagram illustrating a content streaming system to which embodiments of the present disclosure can be applied.

[0284] like Figure 35 As shown, the content streaming system applying the embodiments of the present disclosure 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 content input from a multimedia input device such as a smartphone, a camera, or a camcorder into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, when a multimedia input device such as a smartphone, a camera, or a camcorder directly generates a bitstream, the encoding server may be omitted.

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

[0287] A streaming server transmits multimedia data to a user device based on a user's request via a network server. The network server acts as an intermediary to inform users of services. When a user requests a desired service from the network server, the network server delivers it to the streaming server, which then transmits 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 commands and responses between devices in the content streaming system.

[0288] The streaming server can receive content from a media storage device and / or an encoding server. For example, when receiving content from an encoding server, the content can be received in real time. In this case, in order to provide a smooth streaming service, the streaming server can store the bitstream for 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] The various servers in the content streaming system may operate as distributed servers, in which case data received from the various servers 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 according to the methods of 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. A method for decoding an image, performed by an image decoding apparatus, the method comprising: selecting a first reference sample line for the current block; determining whether some reference samples in the first reference sample line are available; as well as A second reference sample line for the current block is derived based on the determination.

2. The method according to claim 1, wherein Based on at least one reference sample being unavailable in the first reference sample line, the second reference sample line is obtained by deriving a value of at least one reference sample using a reference sample line other than the first reference sample line.

3. The method according to claim 2, wherein: A reference sample used to derive a value of the at least one reference sample in the further reference sample line is determined based on a distance from the at least one reference sample.

4. The method according to claim 3, wherein: The reference sample used to derive the value of the at least one reference sample value is determined to be the reference sample that is closest to the at least one reference sample.

5. The method according to claim 3, wherein: The reference sample used to derive the at least one reference sample value is determined based on any one of a horizontal distance from the at least one reference sample, a vertical distance from the at least one reference sample, and a distance in a direction of an intra prediction mode of the at least one reference sample.

6. The method according to claim 1, further comprising: generating a reference sample line list including the second reference sample line based on at least one reference sample being unavailable in the first reference sample line, The first reference sample line is not included in the reference sample line list.

7. The method according to claim 6, wherein: The second reference sample line consists of available samples.

8. The method according to claim 1, wherein Whether the reference samples in the first reference sample line are available is determined based on whether samples included in the first reference sample line are located outside a picture boundary, a sub-picture boundary, a slice boundary, a tile boundary, a virtual pipeline data unit (VPDU) boundary, or a coding tree unit (CTU) boundary.

9. The method according to claim 1, further comprising: generating an intra prediction candidate list for the current block, Wherein, based on the fact that at least one reference sample is unavailable in the first reference sample line, the intra prediction candidate list consists of intra prediction modes that do not refer to the unavailable reference sample.

10. The method according to claim 1, wherein The intra prediction mode is determined to be one of template-based intra mode derivation (TIMD) or template-based intra prediction with multiple reference lines (TMRL); Wherein, based on at least one reference sample being unavailable in the first reference sample line, a template matching (TM) cost for predicting the current block is calculated using reference samples in the second reference sample line.

11. The method according to claim 1, wherein The intra prediction mode is determined to be one of template-based intra mode derivation (TIMD) or template-based intra prediction with multiple reference lines (TMRL); Wherein, based on at least one reference sample being unavailable in a first template region used for calculating a template matching (TM) cost of the current block, a second template region is used to calculate the TM cost.

12. A method for encoding an image, performed by an image encoding apparatus, the method comprising: selecting a first reference sample line for the current block; determining whether some reference samples in the first reference sample line are available; as well as A second reference sample line for the current block is derived based on the determination.

13. A computer-readable recording medium for storing a bit stream generated using the method of claim 12.

14. A method for transmitting a bit stream generated using an image encoding method, the method comprising: selecting a first reference sample line for the current block; determining whether some reference samples in the first reference sample line are available; as well as A second reference sample line for the current block is derived based on the determination.