Decoder and encoder devices, and data transmission devices for images.
Patent Information
- Application Number
- VN1202605657
- Authority / Receiving Office
- VN · VN
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-03-22
- Filing Date
- 2020-03-18
- Publication Date
- 2026-08-17
AI Technical Summary
High-resolution, high-quality video data requires efficient compression methods to reduce transmission and storage costs, and existing video coding technologies face challenges in optimizing intra prediction efficiency and applying unified configuration processes for various intra prediction types.
A video decoding method and device that derive an intra prediction mode candidate list from multiple intra prediction types, using a unified process to improve coding efficiency by reducing dependency on intra prediction type and deriving reference samples based on the reference picture index, especially for DC and planar intra prediction modes.
Enhances overall image/video compression efficiency, reduces hardware and software complexity, and improves coding efficiency by applying a unified intra prediction mode list construction process across different intra prediction types, particularly when using Multi-Reference Line (MRL) for deriving reference samples.
Smart Images

Figure VN1202605657_0
Abstract
Description
A video decoding method and device using an intra prediction mode candidate list in a video coding system
[0001] This document relates to a video coding technology, and more specifically, to a video decoding method and device for performing intra prediction by deriving a list of intra prediction mode candidates from a plurality of intra prediction types in a video coding system.
[0002] Demand for high-resolution, high-quality video, such as HD (High Definition) and UHD (Ultra High Definition), is growing across various fields. As video data becomes higher in resolution and quality, the amount of information or bits transmitted increases relative to conventional video data. Therefore, transmitting video data using existing media, such as wired or wireless broadband lines, or storing it using existing storage media, increases transmission and storage costs.
[0003] Accordingly, high-efficiency image compression technology is required to effectively transmit, store, and reproduce high-resolution, high-quality image information.
[0004] The technical task of this document is to provide a method and device for improving video coding efficiency.
[0005] Another technical challenge of this paper is to provide a method and device for improving the efficiency of intra prediction.
[0006] Another technical challenge of this document is to provide a method and device for applying the same construction process to intra prediction types in constructing a list of intra prediction mode candidates for deriving intra prediction modes.
[0007] Another technical challenge of this paper is to provide a method and device for deriving reference samples used in DC intra prediction mode by considering reference line indices.
[0008] According to one embodiment of the present document, a video decoding method performed by a decoding device is provided. The method is characterized by including the steps of: receiving prediction-related information for a current block; deriving an intra-prediction type for the current block based on the prediction-related information; configuring an intra-prediction mode candidate list for the current block based on intra-prediction modes of blocks surrounding the current block; deriving an intra-prediction mode for the current block based on the intra-prediction mode candidate list; deriving reference samples of the current block based on the intra-prediction type and the intra-prediction mode; and deriving a prediction sample based on the reference samples.
[0009] According to another embodiment of the present document, a decoding device for performing image decoding is provided. The decoding device is characterized by including an entropy decoding unit that receives prediction-related information for a current block, and a prediction unit that derives an intra-prediction type for the current block among intra-prediction types based on the prediction-related information, configures an intra-prediction mode candidate list for the current block based on intra-prediction modes of surrounding blocks of the current block, derives an intra-prediction mode for the current block based on the intra-prediction mode candidate list, derives reference samples of the current block based on the intra-prediction type and the intra-prediction mode, and derives a prediction sample based on the reference samples.
[0010] According to another embodiment of the present document, a video encoding method performed by an encoding device is provided. The method is characterized by including the steps of: determining an intra prediction type for a current block among intra prediction types; configuring an intra prediction mode candidate list for the current block based on intra prediction modes of surrounding blocks of the current block; deriving an intra prediction mode for the current block based on the intra prediction mode candidate list; deriving reference samples for the current block based on the intra prediction type and the intra prediction mode, and generating a prediction sample based on the reference samples; and encoding image information including prediction-related information for the current block.
[0011] According to another embodiment of the present document, a video encoding device is provided. The encoding device is characterized by including a prediction unit that determines an intra prediction type for a current block among intra prediction types, constructs an intra prediction mode candidate list for the current block based on intra prediction modes of blocks surrounding the current block, derives an intra prediction mode for the current block based on the intra prediction mode candidate list, derives reference samples for the current block based on the intra prediction type and the intra prediction mode, and generates a prediction sample based on the reference samples, and an entropy encoding unit that encodes image information including prediction-related information for the current block.
[0012] According to this document, the overall image / video compression efficiency can be improved.
[0013] According to this document, hardware and software implementation complexity can be reduced by using a unified intra prediction mode list construction process for intra prediction types.
[0014] According to this document, the coding efficiency of intra prediction can be improved by reducing the dependency on intra prediction types by using a unified intra prediction mode list construction process for intra prediction types.
[0015] According to this document, when MRL is applied and the intra prediction mode is derived as the DC intra prediction mode, the reference sample used can be derived based on the reference picture index to improve the coding efficiency of intra prediction.
[0016] According to this document, when MRL is applied and the intra prediction mode is derived as the DC intra prediction mode, the reference sample used can be derived based on the reference picture index and the shape of the current block, thereby improving the coding efficiency of intra prediction.
[0017] According to this document, when MRL is applied and the intra prediction mode is derived as a planar intra prediction mode, the reference sample used can be derived based on a reference picture index to improve the coding efficiency of intra prediction.
[0018] Figure 1 schematically illustrates an example of a video / image coding system to which embodiments of the present document can be applied.
[0019] FIG. 2 is a drawing schematically illustrating the configuration of a video / image encoding device to which embodiments of this document can be applied.
[0020] FIG. 3 is a drawing schematically illustrating the configuration of a video / image decoding device to which embodiments of this document can be applied.
[0021] Figure 4 shows an example of an intra prediction based video / image encoding method.
[0022] Figure 5 shows an example of an intra prediction based video / image decoding method.
[0023] Figure 6 illustrates an intra prediction procedure as an example.
[0024] Figure 7 illustrates intra-directional modes of 65 prediction directions as examples.
[0025] Figure 8 illustrates an example of multiple reference lines that can be used in the above MRL.
[0026] Figure 9 shows an example in which a block to which ISP is applied is divided into sub-blocks based on the size of the block.
[0027] Figure 10 shows an example of deriving an MPM list according to the applied intra prediction.
[0028] FIG. 11 shows an example of constructing an MPM list of the current block and deriving an intra prediction mode according to the present embodiment.
[0029] Fig. 12 shows an example of encoding based on intra prediction according to the present embodiment.
[0030] Fig. 13 shows an example of encoding based on intra prediction according to the present embodiment.
[0031] Fig. 14 shows an example of encoding based on intra prediction according to the present embodiment.
[0032] Figure 15 illustrates an example of a reference sample used to derive a DC value when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is DC intra prediction mode.
[0033] Figure 16 illustrates an example of a reference sample used when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is planar intra prediction mode.
[0034] Figure 17 exemplarily shows a reference sample used to derive a DC value when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is DC intra prediction mode.
[0035] Figure 18 illustrates an example of a reference sample used when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is planar intra prediction mode.
[0036] Figure 19 schematically illustrates a method for encoding an image using an encoding device according to this document.
[0037] Fig. 20 schematically illustrates an encoding device that performs an image encoding method according to this document.
[0038] Figure 21 schematically illustrates a method of decoding an image by a decoding device according to this document.
[0039] Fig. 22 schematically illustrates a decoding device that performs an image decoding method according to this document.
[0040] Figure 23 illustrates an exemplary structure of a content streaming system to which embodiments of this document are applied.
[0041] The disclosure of this document may have various modifications and embodiments, and thus specific embodiments are illustrated and described in detail in the drawings. However, this is not intended to limit the disclosure to specific embodiments. The terminology used in this document is only used to describe specific embodiments and is not intended to limit the technical ideas of the embodiments of this document. The singular expression includes plural expressions unless the context clearly indicates otherwise. It should be understood that the terms "comprises" or "has" in this document are intended to specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the document, but do not exclude in advance the possibility of the presence or addition of one or more other features, numbers, steps, operations, components, parts, or combinations thereof.
[0042] Meanwhile, each component in the drawings described in this document is depicted independently for the convenience of explaining their distinct features. This does not imply that each component is implemented using separate hardware or software. For example, two or more components may be combined to form a single component, or a single component may be divided into multiple components. Embodiments in which each component is integrated and / or separated are also included within the scope of this document.
[0043] This document relates to video / image coding. For example, the method / embodiment disclosed in this document can be applied to a method disclosed in the versatile video coding (VVC) standard. In addition, the method / embodiment disclosed in this document can be applied to a method disclosed in the essential video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the second generation of audio video coding standard (AVS2), or the next generation of video / image coding standards (e.g., H.267 or H.268).
[0044] This document presents various embodiments of video / image coding, and unless otherwise stated, the embodiments may be performed in combination with each other.
[0045] In this document, a video may refer to a set of images over time. A picture generally refers to a unit representing one image at a specific time point, and a slice / tile is a unit that constitutes a part of a picture in coding. A slice / tile may include one or more coding tree units (CTUs). A picture may be composed of one or more slices / tiles. A tile is a rectangular region of CTUs within a particular tile column and a particular tile row in a picture. The tile column is a rectangular region of CTUs having a height equal to the height of the picture, and a width specified by syntax elements in the picture parameter set. The tile row is a rectangular region of CTUs having a height specified by syntax elements in the picture parameter set and a width equal to the width of the picture.A tile scan may indicate a specific sequential ordering of CTUs partitioning a picture in which the CTUs are ordered consecutively in a CTU raster scan in a tile whereas tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture. A slice includes an integer number of complete tiles or an integer number of consecutive complete CTU rows within a tile of a picture that may be exclusively contained in a single NAL unit.
[0046] Meanwhile, a single picture may be divided into two or more subpictures. A subpicture may be a rectangular region of one or more slices within a picture.
[0047] A pixel or pel can refer to the smallest unit that constitutes a picture (or image). Additionally, the term "sample" can be used as a counterpart to a pixel. A sample can generally represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luma component, or only the pixel / pixel value of the chroma component.
[0048] A unit may represent a basic unit of image processing. A unit may include at least one of a specific region of a picture and information related to the region. One unit may include one luma block and two chroma (e.g., cb, cr) blocks. In some cases, the term "unit" may be used interchangeably with terms such as "block" or "area." In general, an MxN block may include a set (or array) of samples (or sample array) or transform coefficients consisting of M columns and N rows.
[0049] In this document, "A or B" can mean "only A", "only B", or "both A and B". In other words, "A or B" in this document can be interpreted as "A and / or B". For example, "A, B or C" in this document can mean "only A", "only B", "only C", or "any combination of A, B, and C".
[0050] The slash ( / ) or comma used in this document can mean "and / or." For example, "A / B" can mean "A and / or B." Accordingly, "A / B" can mean "only A," "only B," or "both A and B." For example, "A, B, C" can mean "A, B, or C."
[0051] In this document, "at least one of A and B" may mean "only A", "only B" or "both A and B". Additionally, in this document, the expressions "at least one of A or B" or "at least one of A and / or B" may be interpreted identically to "at least one of A and B".
[0052] Additionally, in this document, “at least one of A, B and C” can mean “only A”, “only B”, “only C”, or “any combination of A, B and C”. Additionally, “at least one of A, B or C” or “at least one of A, B and / or C” can mean “at least one of A, B and C”.
[0053] Additionally, parentheses used in this document may mean "for example." Specifically, when "prediction (intra-prediction)" is indicated, "intra-prediction" may be suggested as an example of "prediction." In other words, "prediction" in this document is not limited to "intra-prediction," and "intra-prediction" may be suggested as an example of "prediction." Furthermore, even when "prediction (i.e., intra-prediction)" is indicated, "intra-prediction" may be suggested as an example of "prediction."
[0054] Technical features individually described within a single drawing in this document may be implemented individually or simultaneously.
[0055] Hereinafter, embodiments of this document will be described with reference to the attached drawings. Hereinafter, identical reference numerals may be used for identical components in the drawings, and redundant descriptions of identical components may be omitted.
[0056] Figure 1 schematically illustrates an example of a video / image coding system to which embodiments of the present document can be applied.
[0057] Referring to FIG. 1, a video / image coding system may include a first device (source device) and a second device (receiving device). The source device may transmit encoded video / image information or data to the receiving device via a digital storage medium or a network in the form of a file or streaming.
[0058] The source device may include a video source, an encoding device, and a transmitter. The receiving device may include a receiver, a decoding device, and a renderer. The encoding device may be referred to as a video / video encoding device, and the decoding device may be referred to as a video / video decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may include a display unit, and the display unit may be configured as a separate device or an external component.
[0059] A video source may obtain video / images through a process of capturing, synthesizing, or generating video / images. The video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated through a computer, etc., in which case the video / image capture process may be replaced by a process of generating related data.
[0060] An encoding device can encode input video / images. The encoding device can perform a series of procedures, such as prediction, transformation, and quantization, to improve compression and coding efficiency. The encoded data (encoded video / image information) can be output in the form of a bitstream.
[0061] The transmission unit can transmit encoded video / image information or data output in the form of a bitstream to the receiving unit of a receiving device via a digital storage medium or network in the form of a file or streaming. The digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmission unit can include an element for generating a media file via a predetermined file format and an element for transmission via a broadcasting / communication network. The receiving unit can receive / extract the bitstream and transmit it to a decoding device.
[0062] The decoding device can decode the video / image by performing a series of procedures such as inverse quantization, inverse transformation, and prediction corresponding to the operation of the encoding device.
[0063] The renderer can render decoded video / images. The rendered video / images can be displayed through the display unit.
[0064] FIG. 2 is a schematic diagram illustrating the configuration of a video / image encoding device to which embodiments of the present document may be applied. Hereinafter, the term "encoding device" may include a video encoding device and / or a video encoding device. Furthermore, the term "video encoding method / device" may include a video encoding method / device. Alternatively, the term "video encoding method / device" may include a video encoding method / device.
[0065] Referring to FIG. 2, the encoding device (200) may be configured to include an image partitioner (210), a prediction unit (predictor) 220, a residual processor (residual processor) 230, an entropy encoder (entropy encoder) 240, an adder (adder) 250, a filter (filter) 260, and a memory (memory) 270. The prediction unit (220) may include an inter prediction unit (221) and an intra prediction unit (222). The residual processor (230) may include a transformer (transformer) 232, a quantizer (quantizer) 233, a dequantizer (dequantizer) 234, and an inverse transformer (inverse transformer) 235. The residual processing unit (230) may further include a subtractor (231). The addition unit (250) may be called a reconstructor or a recontructed block generator. The image segmentation unit (210), the prediction unit (220), the residual processing unit (230), the entropy encoding unit (240), the addition unit (250), and the filtering unit (260) described above may be configured by one or more hardware components (e.g., an encoder chipset or a processor) according to an embodiment. In addition, the memory (270) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory (270) as an internal / external component.
[0066] The image segmentation unit (210) can segment an input image (or picture, frame) input to the encoding device (200) into one or more processing units. For example, the processing unit may be called a coding unit (CU). In this case, the coding unit may be recursively segmented from a coding tree unit (CTU) or a largest coding unit (LCU) according to a QTBTTT (Quad-tree binary-tree ternary-tree) structure. For example, one coding unit may be segmented into a plurality of coding units of deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quad-tree structure may be applied first, and the binary tree structure and / or the ternary structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present document may be performed based on the final coding unit that is no longer segmented. In this case, based on coding efficiency according to image characteristics, etc., the maximum coding unit can be used as the final coding unit, or, if necessary, the coding unit can be recursively divided into coding units of lower depths, and the coding unit of the optimal size can be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration described below. As another example, the processing unit may further include a prediction unit (PU) or a transformation unit (TU). In this case, the prediction unit and the transformation unit may each be divided or partitioned from the final coding unit described above.The above prediction unit may be a unit of sample prediction, and the above transformation unit may be a unit for deriving a transformation coefficient and / or a unit for deriving a residual signal from a transformation coefficient.
[0067] The term "unit" may be used interchangeably with terms such as "block" or "area" depending on the case. In general, an MxN block can represent a set of samples or transform coefficients consisting of M columns and N rows. A sample can generally represent a pixel or a pixel value, and can represent only the pixel / pixel value of the luminance component, or only the pixel / pixel value of the chroma component. A sample can be used as a term corresponding to a pixel or pel in a picture (or image).
[0068] The encoding device (200) can generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from an inter prediction unit (221) or an intra prediction unit (222) from an input video signal (original block, original sample array), and the generated residual signal is transmitted to a conversion unit (232). In this case, as illustrated, a unit that subtracts a prediction signal (prediction block, prediction sample array) from an input video signal (original block, original sample array) within the encoder (200) may be called a subtraction unit (231). The prediction unit can perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including prediction samples for the current block. The prediction unit can determine whether intra prediction or inter prediction is applied on a current block or CU basis. The prediction unit can generate various information regarding prediction, such as prediction mode information, as described later in the description of each prediction mode, and transmit the information to the entropy encoding unit (240). The information regarding prediction can be encoded in the entropy encoding unit (240) and output in the form of a bitstream.
[0069] The intra prediction unit (222) can predict the current block by referring to samples within the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from it depending on the prediction mode. In intra prediction, the prediction modes may include multiple non-directional modes and multiple directional modes. The non-directional modes may include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the degree of detail in the prediction direction. However, this is merely an example, and a greater or lesser number of directional prediction modes may be used depending on the settings. The intra prediction unit (222) may also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.
[0070] The inter prediction unit (221) can derive a predicted block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information can be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on the inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring block can include a spatial neighboring block existing in the current picture and a temporal neighboring block existing in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The above temporal neighboring blocks may be called collocated reference blocks, collocated CUs (colCUs), etc., and the reference pictures including the temporal neighboring blocks may be called collocated pictures (colPic). For example, the inter prediction unit (221) may construct a motion information candidate list based on the neighboring blocks, and generate information indicating which candidate is used to derive the motion vector and / or reference picture index of the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of skip mode and merge mode, the inter prediction unit (221) may use the motion information of the neighboring blocks as the motion information of the current block. In the case of skip mode, unlike the merge mode, a residual signal may not be transmitted.In the motion vector prediction (MVP) mode, the motion vector of the surrounding blocks is used as a motion vector predictor, and the motion vector of the current block can be indicated by signaling the motion vector difference.
[0071] The prediction unit (220) can generate a prediction signal based on various prediction methods described below. For example, the prediction unit can apply intra prediction or inter prediction for prediction of a single block, and can also apply intra prediction and inter prediction simultaneously. This can be called combined inter and intra prediction (CIIP). In addition, the prediction unit can be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode can be used for content image / video coding such as games, such as screen content coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC can utilize at least one of the inter prediction techniques described in this document. Palette mode can be viewed as an example of intra coding or intra prediction. When palette mode is applied, sample values within a picture can be signaled based on information about the palette table and palette index.
[0072] The prediction signal generated through the above prediction unit (including the inter prediction unit (221) and / or the intra prediction unit (222)) can be used to generate a restored signal or a residual signal. The transform unit (232) can apply a transform technique to the residual signal to generate transform coefficients. For example, the transform technique can include at least one of a Discrete Cosine Transform (DCT), a Discrete Sine Transform (DST), a Karhunen-Loeve Transform (KLT), a Graph-Based Transform (GBT), or a Conditionally Non-linear Transform (CNT). Here, GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. CNT refers to a transform obtained based on a prediction signal generated by using all previously reconstructed pixels. Additionally, the transformation process can be applied to blocks of pixels having equal square sizes, or to blocks of variable sizes that are not square.
[0073] The quantization unit (233) quantizes the transform coefficients and transmits them to the entropy encoding unit (240), and the entropy encoding unit (240) can encode the quantized signal (information about the quantized transform coefficients) and output it as a bitstream. The information about the quantized transform coefficients may be called residual information. The quantization unit (233) can rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and can also generate information about the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit (240) can perform various encoding methods, such as, for example, exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. The entropy encoding unit (240) may encode, together or separately, information necessary for video / image restoration (e.g., values of syntax elements, etc.) in addition to the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in units of NAL (network abstraction layer) units. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. In this document, information and / or syntax elements transmitted / signaled from an encoding device to a decoding device may be included in the video / image information. The video / image information may be encoded through the above-described encoding procedure and included in the bitstream.The above bitstream may be transmitted through a network or stored in a digital storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The signal output from the entropy encoding unit (240) may be configured as an internal / external element of the encoding device (200) by a transmitting unit (not shown) and / or a storing unit (not shown), or the transmitting unit may be included in the entropy encoding unit (240).
[0074] The quantized transform coefficients output from the quantization unit (233) can be used to generate a prediction signal. For example, by applying inverse quantization and inverse transformation to the quantized transform coefficients through the inverse quantization unit (234) and the inverse transform unit (235), a residual signal (residual block or residual samples) can be reconstructed. The addition unit (250) can generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit (221) or the intra prediction unit (222). When there is no residual for the block to be processed, such as when skip mode is applied, the predicted block can be used as a reconstructed block. The addition unit (250) may be called a reconstructor or a reconstructed block generation unit. The generated restoration signal can be used for intra prediction of the next processing target block within the current picture, and can also be used for inter prediction of the next picture after filtering as described below.
[0075] Meanwhile, LMCS (luma mapping with chroma scaling) may be applied during the picture encoding and / or restoration process.
[0076] The filtering unit (260) can improve subjective / objective picture quality by applying filtering to the restoration signal. For example, the filtering unit (260) can apply various filtering methods to the restoration picture to generate a modified restoration picture, and store the modified restoration picture in the memory (270), specifically, in the DPB of the memory (270). The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc. The filtering unit (260) can generate various information regarding filtering and transmit the information to the entropy encoding unit (240), as described later in the description of each filtering method. The information regarding filtering may be encoded by the entropy encoding unit (240) and output in the form of a bitstream.
[0077] The modified restored picture transmitted to the memory (270) can be used as a reference picture in the inter prediction unit (221). Through this, when inter prediction is applied, the encoding device can avoid prediction mismatch in the encoding device (200) and the decoding device (300), and can also improve encoding efficiency.
[0078] The memory (270) DPB can store the modified restored picture to be used as a reference picture in the inter prediction unit (221). The memory (270) can store motion information of a block from which motion information is derived (or encoded) within the current picture and / or motion information of blocks within a picture that has already been restored. The stored motion information can be transferred to the inter prediction unit (221) to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory (270) can store restored samples of restored blocks within the current picture and transfer them to the intra prediction unit (222).
[0079] FIG. 3 is a schematic diagram illustrating the configuration of a video / image decoding device to which embodiments of the present document may be applied. The term "decoding device" hereinafter may include a video decoding device and / or a video decoding device. Furthermore, the term "video decoding method / device" may include a video decoding method / device. Alternatively, the term "video decoding method / device" may include a video decoding method / device.
[0080] Referring to FIG. 3, the decoding device (300) may be configured to include an entropy decoder (310), a residual processor (320), a predictor (330), an adder (340), a filter (350), and a memory (360). The predictor (330) may include an inter-prediction unit (331) and an intra-prediction unit (332). The residual processor (320) may include a dequantizer (321) and an inverse transformer (322). The entropy decoding unit (310), residual processing unit (320), prediction unit (330), addition unit (340), and filtering unit (350) described above may be configured by a single hardware component (e.g., decoder chipset or processor) depending on the embodiment. In addition, the memory (360) may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware component may further include the memory (360) as an internal / external component.
[0081] When a bitstream including video / image information is input, the decoding device (300) can restore the image corresponding to the process in which the video / image information is processed in the encoding device of FIG. 2. For example, the decoding device (300) can derive units / blocks based on block division-related information obtained from the bitstream. The decoding device (300) can perform decoding using a processing unit applied in the encoding device. Therefore, the processing unit of decoding may be, for example, a coding unit, and the coding unit may be divided from a coding tree unit or a maximum coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units may be derived from the coding unit. Then, the restored image signal decoded and output through the decoding device (300) can be reproduced through a reproduction device.
[0082] The decoding device (300) can receive a signal output from the encoding device of FIG. 2 in the form of a bitstream, and the received signal can be decoded through the entropy decoding unit (310). For example, the entropy decoding unit (310) can parse the bitstream to derive information (e.g., video / image information) necessary for image restoration (or picture restoration). The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. The decoding device can decode the picture further based on the information on the parameter set and / or the general constraint information. The signaling / received information and / or syntax elements described later in this document can be decoded and obtained from the bitstream through the decoding procedure. For example, the entropy decoding unit (310) can decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output the values of syntax elements required for image restoration and the quantized values of transform coefficients for residuals. More specifically, the CABAC entropy decoding method receives a bin corresponding to each syntax element in the bitstream, determines a context model using information of a syntax element to be decoded and decoding information of surrounding and decoding target blocks or information of symbols / bins decoded in the previous step, and predicts the occurrence probability of a bin according to the determined context model to perform arithmetic decoding of the bin to generate a symbol corresponding to the value of each syntax element.At this time, the CABAC entropy decoding method can update the context model using the information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. Information regarding prediction among the information decoded by the entropy decoding unit (310) is provided to the prediction unit (inter prediction unit (332) and intra prediction unit (331)), and residual values on which entropy decoding is performed by the entropy decoding unit (310), i.e., quantized transform coefficients and related parameter information, can be input to the residual processing unit (320). The residual processing unit (320) can derive a residual signal (residual block, residual samples, residual sample array). In addition, information regarding filtering among the information decoded by the entropy decoding unit (310) can be provided to the filtering unit (350). Meanwhile, a receiving unit (not shown) that receives a signal output from an encoding device may be further configured as an internal / external element of the decoding device (300), or the receiving unit may be a component of an entropy decoding unit (310). Meanwhile, the decoding device according to the present document may be called a video / video / picture decoding device, and the decoding device may be divided into an information decoder (video / video / picture information decoder) and a sample decoder (video / video / picture sample decoder). The information decoder may include the entropy decoding unit (310), and the sample decoder may include at least one of the inverse quantization unit (321), the inverse transformation unit (322), the addition unit (340), the filtering unit (350), the memory (360), the inter prediction unit (332), and the intra prediction unit (331).
[0083] The inverse quantization unit (321) can inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit (321) can rearrange the quantized transform coefficients into a two-dimensional block form. In this case, the rearrangement can be performed based on the coefficient scanning order performed in the encoding device. The inverse quantization unit (321) can perform inverse quantization on the quantized transform coefficients using quantization parameters (e.g., quantization step size information) and obtain transform coefficients.
[0084] In the inverse transform unit (322), the transform coefficients are inversely transformed to obtain a residual signal (residual block, residual sample array).
[0085] The prediction unit can perform a prediction on the current block and generate a predicted block containing prediction samples for the current block. Based on the information regarding the prediction output from the entropy decoding unit (310), the prediction unit can determine whether intra-prediction or inter-prediction is applied to the current block, and can determine a specific intra / inter-prediction mode.
[0086] The prediction unit (320) can generate a prediction signal based on various prediction methods described below. For example, the prediction unit can apply intra prediction or inter prediction for prediction of a single block, and can also apply intra prediction and inter prediction simultaneously. This can be called combined inter and intra prediction (CIIP). In addition, the prediction unit can be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode can be used for content image / video coding such as games, such as screen content coding (SCC). IBC basically performs prediction within the current picture, but can be performed similarly to inter prediction in that it derives a reference block within the current picture. That is, IBC can utilize at least one of the inter prediction techniques described in this document. Palette mode can be viewed as an example of intra coding or intra prediction. When palette mode is applied, information about the palette table and palette index may be signaled and included in the video / image information.
[0087] The intra prediction unit (331) can predict the current block by referring to samples within the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from it, depending on the prediction mode. In intra prediction, the prediction modes may include multiple non-directional modes and multiple directional modes. The intra prediction unit (331) can also determine the prediction mode applied to the current block by using the prediction mode applied to the neighboring blocks.
[0088] The inter prediction unit (332) can derive a predicted block for the current block based on a reference block (reference sample array) specified by a motion vector on a reference picture. At this time, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information can be predicted in units of blocks, sub-blocks, or samples based on the correlation of the motion information between the neighboring blocks and the current block. The motion information can include a motion vector and a reference picture index. The motion information can further include information on the inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.). In the case of inter prediction, the neighboring blocks can include spatial neighboring blocks existing in the current picture and temporal neighboring blocks existing in the reference picture. For example, the inter prediction unit (332) can construct a motion information candidate list based on the neighboring blocks, and derive the motion vector and / or reference picture index of the current block based on the received candidate selection information. Inter prediction can be performed based on various prediction modes, and the information about the prediction can include information indicating the mode of inter prediction for the current block.
[0089] The addition unit (340) can generate a restoration signal (restored picture, restoration block, restoration sample array) by adding the acquired residual signal to the prediction signal (predicted block, prediction sample array) output from the prediction unit (including the inter-prediction unit (332) and / or intra-prediction unit (331)). When there is no residual for the block to be processed, such as when skip mode is applied, the predicted block can be used as the restoration block.
[0090] The addition unit (340) may be referred to as a restoration unit or restoration block generation unit. The generated restoration signal may be used for intra prediction of the next processing target block within the current picture, may be output after filtering as described below, or may be used for inter prediction of the next picture.
[0091] Meanwhile, LMCS (luma mapping with chroma scaling) may be applied during the picture decoding process.
[0092] The filtering unit (350) can improve subjective / objective image quality by applying filtering to the restored signal. For example, the filtering unit (350) can apply various filtering methods to the restored picture to generate a modified restored picture, and transmit the modified restored picture to the memory (360), specifically, to the DPB of the memory (360). The various filtering methods can include, for example, deblocking filtering, sample adaptive offset, adaptive loop filter, bilateral filter, etc.
[0093] The (modified) reconstructed picture stored in the DPB of the memory (360) can be used as a reference picture in the inter prediction unit (332). The memory (360) can store motion information of a block from which motion information is derived (or decoded) within the current picture and / or motion information of blocks within a picture that has already been reconstructed. The stored motion information can be transferred to the inter prediction unit (260) to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory (360) can store reconstructed samples of reconstructed blocks within the current picture and transfer them to the intra prediction unit (331).
[0094] In this specification, the embodiments described in the filtering unit (260), the inter prediction unit (221), and the intra prediction unit (222) of the encoding device (200) can be applied to the filtering unit (350), the inter prediction unit (332), and the intra prediction unit (331) of the decoding device (300) in the same or corresponding manner, respectively.
[0095] Meanwhile, as described above, prediction is performed to increase compression efficiency when performing video coding. Through this, a predicted block including prediction samples for the current block, which is the coding target block, can be generated. For example, when the intra prediction described above is performed, the correlation between samples can be utilized, and the difference between the original block and the predicted block, i.e., the residual, can be obtained. The transformation and quantization described above can be applied to the residual, thereby removing spatial redundancy. Specifically, the encoding method and decoding method using intra prediction can be as described below.
[0096] Figure 4 shows an example of an intra prediction based video / image encoding method.
[0097] Referring to FIG. 4, an encoding device performs intra prediction on a current block (S400). The encoding device can derive an intra prediction mode / type for the current block, derive surrounding reference samples of the current block, and generate prediction samples within the current block based on the intra prediction mode / type and the surrounding reference samples. Here, the intra prediction mode / type determination, surrounding reference sample derivation, and prediction sample generation procedures may be performed simultaneously, or one procedure may be performed before the other. The encoding device can determine a mode / type to be applied to the current block among a plurality of intra prediction modes / types. The encoding device can compare RD costs for the intra prediction modes / types and determine an optimal intra prediction mode / type for the current block.
[0098] Meanwhile, the encoding device may also perform a predictive sample filtering procedure. Predictive sample filtering may be referred to as post-filtering. Some or all of the predictive samples may be filtered through the predictive sample filtering procedure. In some cases, the predictive sample filtering procedure may be omitted.
[0099] The encoding device generates residual samples for the current block based on (filtered) prediction samples (S410). The encoding device can compare the prediction samples with the original samples of the current block based on phase and derive the residual samples.
[0100] The encoding device can encode image information including information about the intra prediction (prediction information) and residual information about the residual samples (S420). The prediction information can include intra prediction mode information and intra prediction type information. The encoding device can output the encoded image information in the form of a bitstream. The output bitstream can be transmitted to a decoding device via a storage medium or a network.
[0101] The residual information may include the residual coding syntax described below. The encoding device may transform / quantize the residual samples to derive quantized transform coefficients. The residual information may include information about the quantized transform coefficients.
[0102] Meanwhile, as described above, the encoding device can generate a restored picture (including restored samples and restored blocks). To this end, the encoding device can dequantize / inversely transform the quantized transform coefficients again to derive (corrected) residual samples. The reason for performing dequantization / inversely transforming the residual samples after transforming / quantizing them in this way is to derive residual samples that are identical to the residual samples derived from the decoding device as described above. The encoding device can generate a restored block including restored samples for the current block based on the predicted samples and the (corrected) residual samples. A restored picture for the current picture can be generated based on the restored block. As described above, an in-loop filtering procedure, etc. can be further applied to the restored picture.
[0103] Figure 5 shows an example of an intra prediction based video / image decoding method.
[0104] The decoding device can perform an operation corresponding to the operation performed by the encoding device.
[0105] Prediction information and residual information can be obtained from the bitstream. Based on the residual information, residual samples for the current block can be derived. Specifically, based on the quantized transform coefficients derived based on the residual information, inverse quantization can be performed to derive transform coefficients, and inverse transformation can be performed on the transform coefficients to derive residual samples for the current block.
[0106] Specifically, the decoding device can derive an intra prediction mode / type for the current block based on the received prediction information (intra prediction mode / type information) (S500). The decoding device can derive surrounding reference samples of the current block (S510). The decoding device generates prediction samples within the current block based on the intra prediction mode / type and the surrounding reference samples (S520). In this case, the decoding device can perform a prediction sample filtering procedure. The prediction sample filtering may be referred to as post-filtering. Some or all of the prediction samples may be filtered by the prediction sample filtering procedure. In some cases, the prediction sample filtering procedure may be omitted.
[0107] The decoding device generates residual samples for the current block based on the received residual information (S530). The decoding device can 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 (S540). A reconstructed picture for the current picture can be generated based on the reconstructed block. As described above, an in-loop filtering procedure, etc. can be further applied to the reconstructed picture.
[0108] The intra prediction mode information may include flag information (e.g., intra_luma_mpm_flag) indicating, for example, whether the most probable mode (MPM) or the remaining mode is applied to the current block, and when the MPM is applied to the current block, the prediction mode information may further include index information (e.g., intra_luma_mpm_idx) indicating one of the intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may be configured as an MPM candidate list or an MPM list. In addition, when the MPM is not applied to the current block, the intra prediction mode information may further include remaining mode information (e.g., intra_luma_mpm_remainder) indicating one of the remaining intra prediction modes excluding the intra prediction mode candidates (MPM candidates). A decoding device may determine the intra prediction mode of the current block based on the intra prediction mode information.
[0109] In addition, the intra prediction type information can be implemented in various forms. For example, the intra prediction type information can include intra prediction type index information indicating one of the intra prediction types. As another example, the intra prediction type information can include at least one of reference sample line information (e.g., intra_luma_ref_idx) indicating whether the MRL is applied to the current block and, if so, which reference sample line is used, ISP flag information (e.g., intra_subpartitions_mode_flag) indicating whether the ISP is applied to the current block, ISP type information (e.g., intra_subpartitions_split_flag) indicating a split type of subpartitions if the ISP is applied, flag information indicating whether PDCP is applied, or flag information indicating whether LIP is applied. In addition, the intra prediction type information can include a MIP flag indicating whether MIP (matrix-based intra prediction) is applied to the current block.
[0110] The intra prediction mode information and / or the intra prediction type information may be encoded / decoded using the coding method described in this document. For example, the intra prediction mode information and / or the intra prediction type information may be encoded / decoded using entropy coding (e.g., CABAC, CAVLC) coding.
[0111] Figure 6 illustrates an intra prediction procedure as an example.
[0112] Referring to FIG. 6, the intra prediction procedure as described above may include an intra prediction mode / type determination step, a surrounding reference sample derivation step, and an intra prediction performance (prediction sample generation) step. The intra prediction procedure may be performed in an encoding device and a decoding device as described above. In this document, the coding device may include an encoding device and / or a decoding device.
[0113] Referring to FIG. 6, the coding device determines the intra prediction mode / type (S600).
[0114] An encoding device can determine an intra prediction mode / type to be applied to the current block from among the various intra prediction modes / types described above, and can generate prediction-related information. The prediction-related information can include intra prediction mode information indicating an intra prediction mode applied to the current block and / or intra prediction type information indicating an intra prediction type applied to the current block. A decoding device can determine an intra prediction mode / type to be applied to the current block based on the prediction-related information.
[0115] The intra prediction mode information may include flag information (e.g., intra_luma_mpm_flag) indicating, for example, whether the most probable mode (MPM) or the remaining mode is applied to the current block, and when the MPM is applied to the current block, the prediction mode information may further include index information (e.g., intra_luma_mpm_idx) indicating one of the intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may be configured as an MPM candidate list or an MPM list. In addition, when the MPM is not applied to the current block, the intra prediction mode information may further include remaining mode information (e.g., intra_luma_mpm_remainder) indicating one of the remaining intra prediction modes excluding the intra prediction mode candidates (MPM candidates). A decoding device may determine the intra prediction mode of the current block based on the intra prediction mode information.
[0116] In addition, the intra prediction type information can be implemented in various forms. For example, the intra prediction type information can include intra prediction type index information indicating one of the intra prediction types. As another example, the intra prediction type information can include at least one of reference sample line information (e.g., intra_luma_ref_idx) indicating whether the MRL is applied to the current block and, if so, which reference sample line is used, ISP flag information (e.g., intra_subpartitions_mode_flag) indicating whether the ISP is applied to the current block, ISP type information (e.g., intra_subpartitions_split_flag) indicating a split type of subpartitions if the ISP is applied, flag information indicating whether PDCP is applied, or flag information indicating whether LIP is applied. In addition, the intra prediction type information can include a MIP flag indicating whether MIP (matrix-based intra prediction) is applied to the current block.
[0117] For example, when intra prediction is applied, the intra prediction mode to be applied to the current block can be determined using the intra prediction mode of the surrounding block. For example, the coding device can select one of the MPM candidates in the MPM (most probable mode) list derived based on the intra prediction modes of the surrounding blocks of the current block (e.g., left and / or upper surrounding blocks) and / or additional candidate modes, based on the received MPM index, or can select one of the remaining intra prediction modes not included in the MPM candidates (and planar modes) based on MPM rememberer information (remaining intra prediction mode information). The MPM list can be configured to include or not include a planar mode as a candidate. For example, when the MPM list includes a planar mode as a candidate, the MPM list can have six candidates, and when the MPM list does not include a planar mode as a candidate, the MPM list can have five candidates. If the above MPM list does not include a planar mode as a candidate, a not planar flag (e.g., intra_luma_not_planar_flag) indicating whether the intra prediction mode of the current block is not a planar mode may be signaled. For example, the MPM flag may be signaled first, and the MPM index and the not planar flag may be signaled if the value of the MPM flag is 1. In addition, the MPM index may be signaled if the value of the not planar flag is 1. Here, the reason why the above MPM list is configured not to include a planar mode as a candidate is not because the planar mode is not MPM m, but rather to first check whether it is a planar mode by signaling a flag (not planar flag) since the planar mode is always considered as an MPM.
[0118] For example, whether the intra prediction mode applied to the current block is among the MPM candidates (and planar mode) or among the remaining mode can be indicated based on the MPM flag (e.g., intra_luma_mpm_flag). A value of 1 of the MPM flag can indicate that the intra prediction mode for the current block is among the MPM candidates (and planar mode), and a value of 0 of the MPM flag can indicate that the intra prediction mode for the current block is not among the MPM candidates (and planar mode). A value of 0 of the not planar flag (e.g., intra_luma_not_planar_flag) can indicate that the intra prediction mode for the current block is the planar mode, and a value of 1 of the not planar flag can indicate that the intra prediction mode for the current block is not the planar mode. The above MPM index may be signaled in the form of a mpm_idx or intra_luma_mpm_idx syntax element, and the remaining intra prediction mode information may be signaled in the form of a rem_intra_luma_pred_mode or intra_luma_mpm_remainder syntax element. For example, the remaining intra prediction mode information may point to one of the remaining intra prediction modes that are not included in the MPM candidates (and planar modes) among all intra prediction modes by indexing them in the order of prediction mode numbers. The intra prediction mode may be an intra prediction mode for a luma component (sample). Hereinafter, the intra prediction mode information may include the MPM flag (e.g., intra_luma_mpm_flag), the not planar flag (e.g., intra_luma_not_planar_flag), and the MPM index (e.g.,The remaining intra prediction mode information (rem_intra_luma_pred_mode or intra_luma_mpm_remainder) may include at least one of the following: mpm_idx or intra_luma_mpm_idx). In this document, the MPM list may be referred to by various terms such as MPM candidate list, candModeList, etc.
[0119] When MIP is applied to the current block, a separate mpm flag for MIP (e.g. intra_mip_mpm_flag), mpm index (e.g. intra_mip_mpm_idx), and remaining intra prediction mode information (e.g. intra_mip_mpm_remainder) may be signaled, and the not planar flag may not be signaled.
[0120] In other words, when an image is typically segmented into blocks, the current block to be coded and the neighboring blocks tend to have similar image characteristics. Therefore, the current block and neighboring blocks are likely to have identical or similar intra-prediction modes. Therefore, the encoder can utilize the intra-prediction modes of the neighboring blocks to encode the intra-prediction mode of the current block.
[0121] A coding device can construct a list of most probable modes (MPMs) for the current block. The MPM list may also be referred to as an MPM candidate list. Here, the MPM may refer to a mode used to improve coding efficiency by considering the similarity between the current block and surrounding blocks during intra prediction mode coding. As described above, the MPM list may be constructed including a planar mode, or may be constructed excluding a planar mode. For example, if the MPM list includes a planar mode, the number of candidates in the MPM list may be six. In addition, if the MPM list does not include a planar mode, the number of candidates in the MPM list may be five.
[0122] An encoding device can perform prediction based on various intra prediction modes, and determine an optimal intra prediction mode based on rate-distortion optimization (RDO) based on the prediction. In this case, the encoding device may determine the optimal intra prediction mode using only the MPM candidates and the planar mode configured in the MPM list, or may determine the optimal intra prediction mode using not only the MPM candidates and the planar mode configured in the MPM list but also the remaining intra prediction modes. Specifically, for example, if the intra prediction type of the current block is not a normal intra prediction type but a specific type (e.g., LIP, MRL, or ISP), the encoding device may determine the optimal intra prediction mode by considering only the MPM candidates and the planar mode as intra prediction mode candidates for the current block. That is, in this case, the intra prediction mode for the current block may be determined only from among the MPM candidates and the planar mode, and in this case, the mpm flag may not be encoded / signaled. The decoding device can assume that the mpm flag is 1 in this case without being separately signaled the mpm flag.
[0123] Meanwhile, in general, if the intra prediction mode of the current block is not a planar mode but one of the MPM candidates in the MPM list, the encoding device generates an mpm index (mpm idx) pointing to one of the MPM candidates. If the intra prediction mode of the current block is not in the MPM list either, the encoding device generates MPM reminder information (remaining intra prediction mode information) pointing to a mode that is the same as the intra prediction mode of the current block among the remaining intra prediction modes that are not included in the MPM list (and the planar mode). The MPM reminder information may include, for example, an intra_luma_mpm_remainder syntax element.
[0124] A decoding device obtains intra prediction mode information from a bitstream. The intra prediction mode information may include at least one of an MPM flag, a not-planar flag, an MPM index, and MPM reminder information (remaining intra prediction mode information) as described above. The decoding device may configure an MPM list. The MPM list is configured in the same manner as the MPM list configured in the encoding device. That is, the MPM list may include intra prediction modes of neighboring blocks, and may further include specific intra prediction modes according to a predetermined method.
[0125] The decoding device may determine the intra prediction mode of the current block based on the MPM list and the intra prediction mode information. For example, when the value of the MPM flag is 1, the decoding device may derive a planar mode as the intra prediction mode of the current block (based on the not planar flag) or derive a candidate indicated by the MPM index among MPM candidates in the MPM list as the intra prediction mode of the current block. Here, the MPM candidates may refer to only candidates included in the MPM list, or may include not only candidates included in the MPM list but also a planar mode that can be applied when the value of the MPM flag is 1.
[0126] As another example, when the value of the MPM flag is 0, the decoding device can derive an intra prediction mode indicated by the remaining intra prediction mode information (which may be referred to as MPM remainder information) from among the remaining intra prediction modes not included in the MPM list and planar mode as the intra prediction mode of the current block. Meanwhile, as another example, when the intra prediction type of the current block is a specific type (e.g., LIP, MRL, or ISP, etc.), the decoding device can also derive a candidate indicated by the MPM flag in the planar mode or the MPM list as the intra prediction mode of the current block without parsing / decoding / verifying the MPM flag.
[0127] The coding device derives peripheral reference samples of the current block (S610). When intra prediction is applied to the current block, peripheral reference samples to be used for intra prediction of the current block can be derived. The peripheral reference samples of the current block may include a total of 2 x nH samples adjacent to the left boundary and bottom-left neighbors of the current block of a size nW x nH, a total of 2 x nW samples adjacent to the top boundary and top-right neighbors of the current block, and one sample adjacent to the top-left neighbor of the current block. Alternatively, the peripheral reference samples of the current block may include upper peripheral samples of multiple columns and left peripheral samples of multiple rows. Additionally, the surrounding reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nWxnH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right of the current block.
[0128] Meanwhile, when MRL is applied (i.e., when the value of the MRL index is greater than 0), the peripheral reference samples may be located on lines 1 or 2, not line 0 adjacent to the current block on the left / upper side, and in this case, the number of peripheral reference samples may increase further. Meanwhile, when ISP is applied, the peripheral reference samples may be derived in units of subpartitions.
[0129] The coding device performs intra prediction on the current block to derive prediction samples (S620). The coding device can derive the prediction samples based on the intra prediction mode / type and the surrounding samples. The coding device can derive a reference sample according to the intra prediction mode of the current block among the surrounding reference samples of the current block, and can derive a prediction sample of the current block based on the reference sample.
[0130] Meanwhile, when intra prediction is applied to the current block, as described above, the encoding device / decoding device can derive an intra prediction mode for the current block, and can derive a prediction sample of the current block based on the intra prediction mode. That is, the encoding device / decoding device can derive the prediction sample of the current block by applying a directional mode or a non-directional mode based on surrounding reference samples of the current block.
[0131] For example, an intra prediction mode may include two non-directional (or non-angular) intra prediction modes and 65 directional (or angular) intra prediction modes. The non-directional intra prediction modes may include a planar intra prediction mode numbered 0 and a DC intra prediction mode numbered 1, and the directional intra prediction modes may include 65 intra prediction modes numbered 2 to 66. However, this is merely an example, and this document may also be applied to cases where the number of intra prediction modes is different. Meanwhile, in some cases, an intra prediction mode numbered 67 may be further used, and the 67 intra prediction mode may represent a linear model (LM) mode.
[0132] Figure 7 illustrates intra-directional modes of 65 prediction directions as examples.
[0133] Referring to Fig. 7, intra prediction modes with horizontal directionality and intra prediction modes with vertical directionality can be distinguished centered on intra prediction mode number 34 having an upward left diagonal prediction direction. H and V in Fig. 7 represent horizontal and vertical directionality, respectively, and numbers -32 to 32 represent displacements in units of 1 / 32 on the sample grid position. Intra prediction modes numbered 2 to 33 have horizontal directionality, and intra prediction modes numbered 34 to 66 have vertical directionality. The 18th intra prediction mode and the 50th intra prediction mode represent the horizontal intra prediction mode and the vertical intra prediction mode, respectively. The 2nd intra prediction mode can be called the left-downward diagonal intra prediction mode, the 34th intra prediction mode can be called the left-upward diagonal intra prediction mode, and the 66th intra prediction mode can be called the right-upward diagonal intra prediction mode.
[0134] Meanwhile, as an embodiment of intra prediction, a method may be proposed for selecting a reference sample line with the highest prediction accuracy among multiple reference sample lines of a current block and deriving a prediction sample using a reference sample located in the prediction direction from the selected reference sample line. The above-described method may be referred to as multi-reference line intra prediction (MRL) or multi-reference line (MRL)-based intra prediction.
[0135] Specifically, in conventional intra prediction, only the surrounding samples of the first line above and the first line to the left of the current block can be used as reference samples for intra prediction. However, in MRL, intra prediction can be performed using the surrounding samples located in the sample lines that are 1, 2, or 3 samples above and / or to the left of the current block as reference samples.
[0136] Fig. 8 illustrates multiple reference lines that can be used in the MRL. When the MRL is performed, the decoding device can receive a reference line index. The reference line index can indicate one of a plurality of reference lines. The decoding device can perform intra prediction based on reference samples within the reference line indicated by the reference line index. The syntax element of the reference line index can be intra_luma_ref_idx. In addition, the MRL may not be available (disabled) for blocks of the first line (i.e., the first row) within the CTU.
[0137] In addition, as an embodiment of intra prediction, a method may be proposed for dividing a current block in a horizontal or vertical direction and performing intra prediction on each divided block. That is, a method may be proposed for dividing the current block in a horizontal or vertical direction to derive sub-blocks and performing intra prediction on each of the sub-blocks. In this case, encoding / decoding may be performed on each divided sub-block to generate a reconstructed block, and the reconstructed block may be used as a reference block for the next divided sub-block. The above-described method may be called intra sub-partition prediction (ISP prediction), ISP (Intra Sub-Partitions mode), or ISP (Intra Sub-Partitions)-based prediction. Alternatively, the above-described method may be called ISP-based intra prediction. In addition, a sub-block may be called an intra sub-partition. Additionally, sub-blocks (or sub-partitions) divided according to the above ISP may be called TUs (Transform Units).
[0138] According to the ISP, the current block can be divided into two or four sub-partitions vertically or horizontally based on its size. For example, when the ISP is performed, the current block can be divided into a number of sub-blocks equal to the number shown in the table below based on its size.
[0139]
[0140] Referring to Table 1 above, if the size of the current block is 4x4, the ISP may not be available. In addition, if the size of the current block is 4x8 or 8x4, the current block may be divided into two sub-blocks, and if the size of the current block is other than 4x4, 4x8, and 8x4 (i.e., larger than 4x8 or 8x4), the current block may be divided into four sub-blocks.
[0141] Fig. 9 illustrates an example in which a block to which an ISP is applied is divided into sub-blocks based on the size of the block. Referring to (a) of Fig. 9, if the size of the current block is 4x8 or 8x4, the current block can be divided into two sub-blocks. In addition, referring to (b) of Fig. 9, if the size of the current block is other than 4x4, 4x8, and 8x4 (i.e., larger than 4x8 or 8x4), the current block can be divided into four sub-blocks.
[0142] Meanwhile, Mx128 sized (M≤4) and 128xN (N≤4) ISP blocks (i.e., intra sub-partitions) may cause potential problems for 64x64 VDPUs. For example, a Mx128 sized CU in a single tree may have a Mx128 sized luma TB and two M / 2x64 sized chroma TBs corresponding to the luma TBs. When ISP is applied to the CU, the luma TB may be split into four Mx32 TBs, i.e., four Mx32 sub-blocks (only horizontal splitting is possible), and each of the TBs is smaller than a 64x64 block. However, in this case, the chroma block to which ISP is applied may not be split in the design according to the current video standard. Therefore, the size of the two chroma component TBs for the luma component TBs is larger than a 32x32 block. Similarly, a 128xN CU with ISP applied may encounter a situation similar to the one described above. Therefore, the two cases described above may pose a problem for the 64x64 decoder pipeline. For this reason, the maximum size of a CU that can utilize the ISP may be limited to 64x64.
[0143] When ISP is applied, the encoding device can generate an MPM list according to each partitioning method (e.g., horizontal partitioning or vertical partitioning) to reduce coding complexity, and compare intra prediction modes in the generated MPM list from the perspective of rate distortion optimization (RDO) to derive an optimal intra prediction mode. Meanwhile, when the above-described MRL is used, the ISP cannot be used. That is, the ISP can be applied only when the 0th reference line is used for intra prediction (i.e., when the value of intra_luma_ref_idx is 0). In addition, when the ISP is used, Position dependent intra prediction (PDPC) cannot be used.
[0144] Meanwhile, a flag indicating whether the ISP is applied can be transmitted in units of blocks, and when the ISP is applied to the current block, a flag indicating whether the split type is horizontal or vertical, i.e., whether the split direction is horizontal or vertical, can be encoded / decoded. The flag indicating whether the ISP is applied can be called an ISP flag, and a syntax element of the ISP flag can be intra_subpartitions_mode_flag. In addition, the flag indicating the split type can be called an ISP split flag, and a syntax element of the ISP split flag can be intra_subpartitions_split_flag.
[0145] Syntax elements related to the above ISP can be represented as shown in the following table.
[0146]
[0147] The intra_luma_ref_idx shown in Table 2 may be a syntax element of the reference line index. When the ISP is applied, the intra prediction mode for the current block may be applied equally to the subpartitions of the current block, and intra prediction may be performed by deriving surrounding reference samples in units of the subpartitions, thereby improving intra prediction performance. That is, when the ISP is applied, a residual sample processing procedure may be performed in units of subpartitions. In other words, intra prediction may be performed for each subpartition to derive prediction samples, and the residual signal (residual samples) for each subpartition and the prediction samples for each subpartition may be added to derive reconstructed samples. The residual signal (residual samples) may be derived through an inverse quantization / inverse transformation procedure, etc., based on the residual information (quantized transform coefficient information or residual coding syntax) in the bitstream described above. Intra prediction for the above subpartitions can be performed in order from the leftmost subpartition to the rightmost subpartition if the partition type is vertical partitioning, and intra prediction for the above subpartitions can be performed in order from the uppermost subpartition to the lowermost subpartition if the partition type is horizontal partitioning.
[0148] For example, prediction samples may be derived by performing intra prediction on a first subpartition of a current block, residual samples for the first subpartition may be derived based on residual information for the first subpartition, and reconstructed samples for the first subpartition may be derived based on the prediction samples and the residual samples. Here, when the partition type for the current block to which the ISP is applied is vertical partitioning, the first subpartition may be the leftmost subblock, and when the partition type for the current block to which the ISP is applied is horizontal partitioning, the first subpartition may be the uppermost subblock.
[0149] Thereafter, in the process of deriving prediction samples for the second subpartition, some of the reconstructed samples in the first subpartition may be used as peripheral reference samples for the second subpartition (e.g., left or upper peripheral reference samples of the second subpartition). Specifically, prediction samples may be derived by performing intra prediction on the second subpartition of the current block, residual samples for the second subpartition may be derived based on residual information for the second subpartition, and reconstructed samples for the second subpartition may be derived based on the prediction samples and the residual samples. In addition, similarly, when the process of deriving prediction samples for the third subpartition is performed, some of the reconstructed samples in the second subpartition may be used as peripheral reference samples for the third subpartition (e.g., left or upper peripheral reference samples of the third subpartition). Additionally, similarly, when a process of deriving prediction samples for the fourth subpartition is performed, some of the restored samples within the third subpartition may be used as surrounding reference samples for the fourth subpartition (e.g., left or upper surrounding reference samples of the fourth subpartition).
[0150] Meanwhile, as another embodiment of intra prediction, Combined Inter and Intra Prediction (CIIP) may be proposed. The CIIP may represent a process of deriving a prediction sample of a current block based on inter prediction and intra prediction. For example, when CIIP is applied to a current block, an intra prediction mode of the current block may be derived, and a first prediction sample of the current block may be derived based on the intra prediction mode. Thereafter, inter prediction may be performed on the current block to derive a second prediction sample of the current block, and a prediction sample of the current block may be derived by weighting the first prediction sample and the second prediction sample (i.e., weighted averaging). Here, the first prediction sample may be referred to as an intra prediction sample, and the second prediction sample may be referred to as an inter prediction sample. In addition, for example, the inter prediction for the current block may be inter prediction according to a general merge mode. Specifically, for example, a merge candidate list for the current block can be constructed based on motion information of surrounding blocks of the current block, motion information of the current block can be derived based on a merge candidate in the merge candidate list pointed to by the merge index for the current block, and the second prediction sample of the current block can be derived based on the motion information.
[0151] Additionally, for example, a CIIP flag indicating whether the CIIP is applied to the current block may be signaled, and whether the CIIP is applied to the current block may be determined based on the CIIP flag. For example, the CIIP flag may be signaled when the current block is coded in merge mode and the current block includes at least 64 luma samples (i.e., when the product of the width and height of the current block is 64 or more).
[0152] Additionally, for example, the intra prediction mode of the current block when the CIIP is applied can be derived based on two syntax elements. For example, one of up to four intra prediction modes can be used as the intra prediction mode. The four intra prediction modes can include a DC intra prediction mode, a planar intra prediction mode, a horizontal intra prediction mode, and / or a vertical intra prediction mode.
[0153] For example, in CIIP for the luma component, up to four intra prediction modes can be used, including DC intra prediction mode, planar intra prediction mode, horizontal intra prediction mode, and vertical intra prediction mode. In addition, for example, if the width of the current block is more than twice its height, the vertical intra prediction mode may not be available. In this case, only three intra prediction modes may be available. In addition, for example, if the height of the current block is more than twice its width, the vertical intra prediction mode may not be available. In this case, only three intra prediction modes may be available.
[0154] Specifically, for example, when the CIIP of the current block is applied, the intra prediction mode of the current block can be derived as follows. For example, an MPM list including MPM candidates for the current block can be constructed as follows. As an example, the MPM list can include three MPM candidates.
[0155] For example, the left peripheral block of the current block may be set to A, and the upper peripheral block may be set to B. Then, the intra prediction modes of the left peripheral block A and the upper peripheral block B, denoted as intraModeA and intraModeB, may be derived as follows.
[0156] - Set X to A or B
[0157] - 1) If block X is not available, 2) If block X is not predicted using CIIP or intra prediction mode, 3) If block B is located outside the current CTU, intraModeX may be set to DC intra prediction mode. Here, the current CTU may mean a CTU including the current block.
[0158] - If none of the above cases applies, 1) if the intra prediction mode of block X is a DC intra prediction mode or a planar intra prediction mode, intraModeX may be set to the intra prediction mode of block X, i.e., the DC intra prediction mode or the planar intra prediction mode, or 2) if the intra prediction mode of block X is a vertical-like directional intra prediction mode (i.e., intra prediction mode 35 to intra prediction mode 66), intraModeX may be set to the vertical intra prediction mode, or 3) if the intra prediction mode of block X is a horizontal-like directional intra prediction mode (i.e., intra prediction mode 2 to intra prediction mode 34), intraModeX may be set to the horizontal intra prediction mode.
[0159] Afterwards, MPM candidates can be derived based on the derived intraModeA and intraModeB.
[0160] - For example, if intraModeA and intraModeB are the same:
[0161] - When intraModeA is planar intra prediction mode or DC intra prediction mode, three MPM candidates can be set to {planner intra prediction mode, DC intra prediction mode, vertical intra prediction mode} in order.
[0162] - Or, if not, i.e., intraModeA is neither a planar intra prediction mode nor a DC intra prediction mode, the three MPM candidates can be set to {intraModeA, planar intra prediction mode, DC intra prediction mode} in that order.
[0163] - Otherwise, i.e., if intraModeA and intraModeB are not equal:
[0164] - The first two MPM candidates can be set to {intraModeA, intraModeB}.
[0165] - Afterwards, it is checked whether it is included in the previously derived MPM candidates in the order of planar intra prediction mode, DC intra prediction mode, and vertical intra prediction mode, and if it is confirmed to be an intra prediction mode other than the derived MPM candidate, it can be added as a third MPM candidate.
[0166] Meanwhile, for example, if the width of the current block is more than twice its height or the height of the current block is more than twice its width, the MPM flag may be inferred to be 1 without signaling. Otherwise, the MPM flag for the current block may be signaled.
[0167] For example, when the value of the MPM flag is 1, an MPM index pointing to one of the MPM candidates in the MPM list can be signaled, and the MPM candidate pointed to by the MPM index can be derived as the intra prediction mode of the current block. In addition, for example, when the value of the MPM flag is 0, the intra prediction mode of the current block can be set to a "missing" mode. Here, the missing mode can indicate an intra prediction mode that is not included in the MPM list among four intra prediction modes available in CIIP. For example, when a planar intra prediction mode is not included in the MPM list, the missing mode can be the planar intra prediction mode, and when the value of the MPM flag is 0, the intra prediction mode of the current block can be derived as the planar intra prediction mode that is the missing mode. Meanwhile, for example, the intra prediction mode of a CU coded with the CIIP can be stored and used for prediction of surrounding CUs coded after the CU.
[0168] Meanwhile, as described above, the first prediction sample and the second prediction sample may be weighted averaged. Here, for example, the weights for the first prediction sample and the second prediction sample may be derived based on the intra prediction mode of the current block and / or the position of the current sample within the current block.
[0169] Specifically, for example, when the intra prediction mode of the current block is a DC intra prediction mode or a planar intra prediction mode, or when the width or height of the current block is less than 4, the same weight may be applied to the first prediction sample and the second prediction sample. That is, in other words, when the intra prediction mode of the current block is a DC intra prediction mode or a planar intra prediction mode, or when the width or height of the current block is less than 4, the weights for the first prediction sample and the second prediction sample may be derived as the same value.
[0170] Additionally, in cases other than the above-described cases, the weights for the first prediction sample and the second prediction sample can be derived based on the intra prediction mode of the current block and the current sample position in the current block. For example, when the intra prediction mode of the current block is a horizontal intra prediction mode, the current block can be divided into partitions of a size of (W / 4)xH, and when the current sample is located in the partition closest to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample can be set to 6 and the weight for the second prediction sample can be set to 2, when the current sample is located in the partition second closest to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample can be set to 5 and the weight for the second prediction sample can be set to 3, when the current sample is located in the partition third closest to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample can be set to 3 and the weight for the second prediction sample can be set to 5, and when the current sample is located in the partition farthest from the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample can be set to 2 and the weight for the second prediction sample can be set to 6. Here, the size of the current block may be WxH, where W represents the width of the current block and H represents the height of the current block.
[0171] In addition, for example, when the intra prediction mode of the current block is a vertical intra prediction mode, the current block can be divided into partitions of size Wx(H / 4), and when the current sample is located in the partition closest to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample can be set to 6, and the weight for the second prediction sample can be set to 2, and when the current sample is located in the partition second closest to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample can be set to 5, and the weight for the second prediction sample can be set to 3, and when the current sample is located in the partition third closest to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample can be set to 3, and the weight for the second prediction sample can be set to 5, and when the current sample is located in the partition farthest from the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample can be set to 2, and the weight for the second prediction sample can be set to 6. Can be set.
[0172] Thereafter, based on the above weights, the first prediction sample and the second prediction sample can be weighted and averaged to derive a prediction sample of the current sample. For example, the prediction sample can be derived as in the following mathematical formula.
[0173]
[0174] Here, P CIIP is the predicted sample, P intra is the first prediction sample, P inter may represent a second prediction sample, wt may represent a weight for the first prediction sample, and (8-wt) may represent a weight for the second prediction sample.
[0175] Meanwhile, when intra prediction is performed as described above, general intra prediction, MRL, and / or ISP may be applied. Here, the MPM list generation method for general intra prediction, MRL, and ISP may be different. In the general intra prediction, 67 intra prediction modes may be used, in the MRL-based intra prediction, 65 intra prediction modes excluding the planar intra prediction mode and the DC intra prediction mode may be used, and in the ISP, 66 intra prediction modes excluding the DC intra prediction mode may be used. Since encoding / decoding is performed as intra prediction using different numbers of intra prediction modes for all three intra predictions (general intra prediction, MRL-based intra prediction, and ISP), the MPM list generation method for each intra prediction may be different.
[0176] Specifically, when general intra prediction is performed, an MPM list including 6 MPM candidates can be constructed using all 67 intra prediction modes. In addition, when MRL-based intra prediction is performed, an MPM list including 6 MPM candidates can be constructed using 65 intra prediction modes excluding the planar intra prediction mode and the DC intra prediction mode. In addition, when ISP is performed, an MPM list including 6 MPM candidates can be constructed using 66 intra prediction modes excluding the DC intra prediction mode. Here, the MPM list can be constructed in different ways depending on whether the partition type of the ISP is horizontal partitioning or vertical partitioning.
[0177] Fig. 10 illustrates an example of deriving an MPM list according to applied intra prediction. Referring to Fig. 10, a decoding device can determine whether MRL or ISP is applied to a current block (S1005). If MRL or ISP is applied to the current block, the decoding device can determine whether the MRL is applied to the current block (S1010). If the MRL is applied to the current block, the decoding device can generate an MRL MPM list for the current block (S1015). Here, the MRL MPM list may represent an MPM list generated according to the MPM list generation method in the case of applying the above-described MRL. Thereafter, the decoding device can parse the MPM index (S1020). The MPM index may represent an MPM candidate derived by the intra prediction mode of the current block among the MPM candidates. The decoding device can derive the MPM candidate indicated by the MPM index among the MPM candidates of the MRL MPM list as the intra prediction mode of the current block.
[0178] In addition, when the MRL is not applied to the current block and the ISP is applied, the decoding device can generate an ISP MPM list for the current block (S1025). Here, the ISP MPM list can represent an MPM list generated according to the MPM list generation method when applied to the ISP described above. Thereafter, the decoding device can parse the MPM index (S1020). The decoding device can derive the MPM candidate indicated by the MPM index among the MPM candidates of the ISP MPM list as the intra prediction mode of the current block.
[0179] Meanwhile, if MRL and ISP are not applied to the current block, the decoding device can parse the MPM flag for the current block (S1030). Thereafter, the decoding device can determine whether the intra prediction mode of the current block is the MPM mode based on the MPM flag, that is, whether the intra prediction mode of the current block is an MPM candidate included in the MPM list based on the MPM flag (S1035). Here, the MPM flag can indicate whether the intra prediction mode of the current block is included in the MPM list.
[0180] If the intra prediction mode of the current block is MPM mode, the decoding device can generate an MPM list in general intra prediction (S1040) and parse the MPM index for the current block (S1020). The decoding device can derive the MPM candidate indicated by the MPM index among the MPM candidates in the MPM list as the intra prediction mode of the current block.
[0181] Meanwhile, if the intra prediction mode of the current block is not the MPM mode, and if the intra prediction mode of the current block does not belong to the MPM candidates, the decoding device can parse remaining intra prediction mode information indicating one intra prediction mode among the remaining intra prediction modes that are not included in the MPM candidates of the MPM list (S1045). The decoding device can derive the intra prediction mode indicated by the remaining intra prediction mode information among the remaining intra prediction modes as the intra prediction mode for the current block.
[0182] As described above, an MPM list containing six MPM candidates can be constructed using different methods depending on the intra prediction method. However, if the MPM list generation method differs depending on the intra prediction method, it can increase coding complexity and reduce coding efficiency.
[0183] Therefore, this paper proposes a method to generalize the existing methods of intra prediction, MRL-based intra prediction, and MPM list generation used in ISPs. In other words, this paper proposes a method for generating an MPM list using a single, generalized method. By using a generalized MPM list generation method, the intra prediction encoding / decoding structure can be simplified, and the encoding / decoding efficiency using intra prediction modes can be increased, thereby improving video coding efficiency.
[0184] As an example, we propose a method of generating an MPM list using a generalized method and then applying MPM candidates within the MPM list as intra prediction modes in conventional intra prediction, MRL-based intra prediction, and ISP intra prediction.
[0185] For example, a method for generating an MPM list including six MPM candidates used in conventional intra prediction can be equally applied to MPM list generation methods for MRL-based intra prediction and ISP-based intra prediction. Here, the MPM list generation method may be a conventional MPM list generation method, or may be an improved method of the conventional MPM list generation method. The method for generating an MPM list including six MPM candidates used in the conventional intra prediction described above is a method for generating an MPM list by considering all 67 intra prediction modes, and the MPM list may include a planar intra prediction mode and / or a DC intra prediction mode as MPM candidates. However, since the MRL-based intra prediction does not use the planar intra prediction mode and the DC intra prediction mode, and the ISP-based intra prediction does not use the DC intra prediction mode, a different MPM list configuration method from the conventional one may be required.
[0186] Fig. 11 illustrates an example of constructing an MPM list of the current block and deriving an intra prediction mode according to the present embodiment. Referring to Fig. 11, a decoding device can determine whether MRL or ISP is applied to the current block (S1110). If MRL or ISP is applied to the current block, the decoding device can generate an MPM list of the current block (S1120) and parse an MPM index for the current block (S1130). The decoding device can derive an MPM candidate indicated by the MPM index among the MPM candidates of the MPM list as the intra prediction mode of the current block.
[0187] In addition, if MRL and ISP are not applied to the current block, the decoding device can parse the MPM flag for the current block (S1140) and determine whether the intra prediction mode of the current block is included in the MPM list based on the MPM flag (S1150). The MPM flag can indicate whether the intra prediction mode of the current block is included in the MPM candidates of the MPM list.
[0188] If the intra prediction mode of the current block is the MPM mode, that is, if the MPM flag indicates that the intra prediction mode of the current block is included in the MPM candidates of the MPM list (for example, if the value of the MPM flag is 1), the decoding device may generate the MPM list of the current block (S1120). Here, the MPM list may be generated in the same manner as the MPM list generated when MRL or ISP is applied to the current block. Thereafter, the decoding device may parse the MPM index for the current block (S1130) and derive the MPM candidate indicated by the MPM index among the MPM candidates of the MPM list as the intra prediction mode of the current block.
[0189] Meanwhile, if the intra prediction mode of the current block is not the MPM mode, that is, if the MPM flag indicates that the intra prediction mode of the current block is not included in the MPM candidates of the MPM list (for example, if the value of the MPM flag is 0), the decoding device may parse remaining intra prediction mode information of the current block (S1160). The decoding device may derive an intra prediction mode indicated by the remaining intra prediction mode information among the remaining intra prediction modes as the intra prediction mode for the current block.
[0190] Meanwhile, the MPM list generation method commonly used in the general intra prediction, MRL, and ISP proposed in this embodiment may be as in the examples described below.
[0191] An example of how to create an MPM list might look like the table below.
[0192]
[0193] According to an example of the MPM list generation method illustrated in Table 3 above, the encoding device / decoding device can derive MPM candidate 0 of the current block as the intra prediction mode of the left peripheral block of the current block, MPM candidate 1 can be derived as a DC intra prediction mode if the derived MPM candidate 0 is a planar intra prediction mode, and as a planar intra prediction mode if the derived MPM candidate 0 is not a planar intra prediction mode, MPM candidate 2 can be derived as a vertical intra prediction mode, MPM candidate 3 can be derived as a horizontal intra prediction mode, MPM candidate 4 can be derived as an intra prediction mode of a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, an intra prediction mode number 46, and MPM candidate 5 can be derived as an intra prediction mode of a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, that is, an intra prediction mode number 54.
[0194] Thereafter, the encoding device / decoding device can determine whether the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are the same, and can configure an MPM list based on whether the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block are the same. For example, if the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block are the same, the encoding device / decoding device can determine whether the mode number of the intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode, and if the mode number of the intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode, the MPM list of the current block including the derived MPM candidates 0 to 5 as described below can be derived.
[0195] - mpm[0] = leftIntraDir
[0196] - mpm[1] = PLANAR_IDX
[0197] - mpm[2] = DC_IDX
[0198] - mpm[3] = ((leftIntraDir + offset) % mod) + 2
[0199] - mpm[4] = ((leftIntraDir - 1) % mod) + 2
[0200] - mpm[5] = ((leftIntraDir + offset - 1) % mod) + 2
[0201] That is, MPM candidate 0 of the MPM list can be derived as an intra prediction mode of the left peripheral block, MPM candidate 1 of the MPM list can be derived as a planar intra prediction mode, MPM candidate 2 of the MPM list can be derived as a DC intra prediction mode, MPM candidate 3 of the MPM list can be derived as an intra prediction mode whose mode number is ((leftIntraDir + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to the mode number of the intra prediction mode of the left peripheral block, performing a modular arithmetic operation with mod and adding 2, and MPM candidate 4 of the MPM list can be derived as an intra prediction mode whose mode number is ((leftIntraDir - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left peripheral block, performing a modular arithmetic operation with mod and adding 2. And, MPM candidate 5 of the above MPM list can be derived as an intra prediction mode whose mode number is ((leftIntraDir + offset - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset of -1 to the mode number of the intra prediction mode of the left peripheral block, and then performing a modular arithmetic operation with mod as the value and adding 2.
[0202] Meanwhile, for example, if the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are the same, and the mode number of the intra prediction mode of the left peripheral block is not greater than the mode number of the DC intra prediction mode, the encoding device / decoding device can first derive an MPM list of the current block including the derived MPM candidates 0 to MPM candidates 5.
[0203] Meanwhile, for example, when the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are not the same, the encoding device / decoding device can derive the intra prediction mode of the left peripheral block of the current block as MPM candidate 0 of the MPM list, and can derive the intra prediction mode of the upper peripheral block of the current block as MPM candidate 1 of the MPM list. In addition, the encoding device / decoding device can derive maxCandModeIdx as 0 if the mode number of the MPM candidate 0 is greater than the mode number of the MPM candidate 1, and can derive maxCandModeIdx as 1 if the mode number of the MPM candidate 0 is not greater than the mode number of the MPM candidate 1.
[0204] Thereafter, if the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block are greater than the mode number of the DC intra prediction mode, the encoding device / decoding device can derive the planar intra prediction mode as MPM candidate 2 of the MPM list, and can derive the DC intra prediction mode as MPM candidate 3 of the MPM list.
[0205] Thereafter, if the value obtained by subtracting the mode number of mpm[!maxCandModeIdx] from the mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the encoding device / decoding device can derive the intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2 as MPM candidate 4 of the MPM list, and can derive the intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2 as MPM candidate 5 of the MPM list. Here, if the above maxCandModeIdx is 0, mpm[maxCandModeIdx] can represent MPM candidate 0, mpm[!maxCandModeIdx] can represent MPM candidate 1, and if the above maxCandModeIdx is 1, mpm[maxCandModeIdx] can represent MPM candidate 1, mpm[!maxCandModeIdx] can represent MPM candidate 0.
[0206] Alternatively, if the value obtained by subtracting the mode number of mpm[!maxCandModeIdx] from the mode number of mpm[maxCandModeIdx] is 63 or greater or 1 or less, the encoding device / decoding device can derive the intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2 as MPM candidate 4 of the MPM list, and can derive the intra prediction mode whose mode number is ((mpm[maxCandModeIdx]) % mod) + 2 as MPM candidate 5 of the MPM list.
[0207] Meanwhile, for example, if at least one of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is not greater than the mode number of the DC intra prediction mode, the encoding device / decoding device can determine whether the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is 2 or more, and if the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is 2 or more, MPM candidate 2 to MPM candidate 5 can be derived as described below.
[0208] - mpm[2] = (mpm[!maxCandModeIdx] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0209] - mpm[3] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0210] - mpm[4] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0211] - mpm[5] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0212] That is, MPM candidate 2 of the above MPM list can be derived as a DC intra prediction mode if the mpm[!maxCandModeIdx] is a planner intra prediction mode, and can be derived as a planner intra prediction mode if the mpm[!maxCandModeIdx] is not a planner intra prediction mode. In addition, MPM candidate 3 of the MPM list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and MPM candidate 4 of the MPM list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and MPM candidate 5 of the MPM list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2, that is, The intra prediction mode can be derived by performing modular arithmetic on the value obtained by adding an offset of -1 to mpm[maxCandModeIdx] and adding 2 to it as the mode number.
[0213] Alternatively, another example of a method for generating an MPM list may be used. Another example of the above MPM list generation method may be as shown in the following table.
[0214]
[0215] According to an example of the MPM list generation method illustrated in Table 4 above, the encoding device / decoding device can derive MPM candidate 0 of the current block as the intra prediction mode of the left peripheral block of the current block, MPM candidate 1 can be derived as a DC intra prediction mode if the derived MPM candidate 0 is a planar intra prediction mode, and as a planar intra prediction mode if the derived MPM candidate 0 is not a planar intra prediction mode, MPM candidate 2 can be derived as a vertical intra prediction mode, MPM candidate 3 can be derived as a horizontal intra prediction mode, MPM candidate 4 can be derived as an intra prediction mode of a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, an intra prediction mode number 46, and MPM candidate 5 can be derived as an intra prediction mode of a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, that is, an intra prediction mode number 54.
[0216] Thereafter, the encoding device / decoding device can determine whether the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are the same, and can configure an MPM list based on whether the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block are the same. For example, if the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block are the same, the encoding device / decoding device can determine whether the mode number of the intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode, and if the mode number of the intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode, the MPM list of the current block including the derived MPM candidates 0 to 5 as described below can be derived.
[0217] - mpm[0] = leftIntraDir
[0218] - mpm[1] = PLANAR_IDX
[0219] - mpm[2] = ((leftIntraDir + offset) % mod) + 2
[0220] - mpm[3] = ((leftIntraDir - 1) % mod) + 2
[0221] - mpm[4] = DC_IDX
[0222] - mpm[5] = ((leftIntraDir + offset - 1) % mod) + 2
[0223] That is, MPM candidate 0 of the MPM list can be derived as an intra prediction mode of the left peripheral block, MPM candidate 1 of the MPM list can be derived as a planar intra prediction mode, MPM candidate 2 of the MPM list can be derived as an intra prediction mode whose mode number is ((leftIntraDir + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to the mode number of the intra prediction mode of the left peripheral block, modulo arithmetic operation, and adding 2, and MPM candidate 3 of the MPM list can be derived as an intra prediction mode whose mode number is ((leftIntraDir - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left peripheral block, modulo arithmetic operation, and adding 2, and MPM candidate 4 of the MPM list can be derived as a DC intra prediction mode. And, MPM candidate 5 of the above MPM list can be derived as an intra prediction mode whose mode number is ((leftIntraDir + offset - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset of -1 to the mode number of the intra prediction mode of the left peripheral block, and then performing a modular arithmetic operation with mod as the value and adding 2.
[0224] Meanwhile, for example, if the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are the same, and the mode number of the intra prediction mode of the left peripheral block is not greater than the mode number of the DC intra prediction mode, the encoding device / decoding device can first derive an MPM list of the current block including the derived MPM candidates 0 to MPM candidates 5.
[0225] Meanwhile, for example, when the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are not the same, the encoding device / decoding device can derive the intra prediction mode of the left peripheral block of the current block as MPM candidate 0 of the MPM list, and can derive the intra prediction mode of the upper peripheral block of the current block as MPM candidate 1 of the MPM list. In addition, the encoding device / decoding device can derive maxCandModeIdx as 0 if the mode number of the MPM candidate 0 is greater than the mode number of the MPM candidate 1, and can derive maxCandModeIdx as 1 if the mode number of the MPM candidate 0 is not greater than the mode number of the MPM candidate 1.
[0226] Thereafter, if the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block are greater than the mode number of the DC intra prediction mode, the encoding device / decoding device can derive the planar intra prediction mode as MPM candidate 1 of the MPM list, and can derive the intra prediction mode of the upper peripheral block as MPM candidate 2 of the MPM list. In addition, the encoding device / decoding device can derive maxCandModeIdx as 0 if the mode number of the MPM candidate 0 is greater than the mode number of the MPM candidate 2, and can derive maxCandModeIdx as 2 if the mode number of the MPM candidate 0 is not greater than the mode number of the MPM candidate 2. In addition, the encoding device / decoding device can derive minCandModeidx as 2 if the mode number of the MPM candidate 0 is greater than the mode number of the MPM candidate 2, and can derive maxCandModeIdx as 0 if the mode number of the MPM candidate 0 is not greater than the mode number of the MPM candidate 2. In addition, the encoding device / decoding device can derive the DC intra prediction mode as MPM candidate 3 of the MPM list.
[0227] Thereafter, if the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the encoding device / decoding device can derive the intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2 as MPM candidate 4 of the MPM list, and can derive the intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2 as MPM candidate 5 of the MPM list. Here, if the maxCandModeIdx is 0, mpm[maxCandModeIdx] may be MPM candidate 0, if the maxCandModeIdx is 1, mpm[maxCandModeIdx] may be MPM candidate 1, if the maxCandModeIdx is 2, mpm[maxCandModeIdx] may be MPM candidate 2, if the minCandModeidx is 0, mpm[minCandModeidx] may be MPM candidate 0, and if the minCandModeidx is 2, mpm[minCandModeidx] may be MPM candidate 2.
[0228] Alternatively, if the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is 63 or greater or 1 or less, the encoding device / decoding device can derive an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2 as MPM candidate 4 of the MPM list, and can derive an intra prediction mode whose mode number is ((mpm[maxCandModeIdx]) % mod) + 2 as MPM candidate 5 of the MPM list.
[0229] Meanwhile, for example, if at least one of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is not greater than the mode number of the DC intra prediction mode, the encoding device / decoding device can determine whether the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is 2 or more, and if the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is 2 or more, it can determine whether at least one of the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block is the same as a planar intra prediction mode.
[0230] If at least one of the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block is identical to the planar intra prediction mode, the encoding device / decoding device can derive MPM candidate 0 and MPM candidate 1 as follows.
[0231] - mpm[0] = PLANAR_IDX
[0232] - mpm[1] = (leftIntraDir < aboveIntraDir) ? aboveIntraDir : leftIntraDir
[0233] That is, MPM candidate 0 of the MPM list can be derived as a planar intra prediction mode, and when the mode number of the intra prediction mode of the left peripheral block is smaller than the mode number of the intra prediction mode of the upper peripheral block, MPM candidate 1 of the MPM list can be derived as the intra prediction mode of the upper peripheral block, and when the mode number of the intra prediction mode of the left peripheral block is equal to or greater than the mode number of the intra prediction mode of the upper peripheral block, MPM candidate 1 of the MPM list can be derived as the intra prediction mode of the left peripheral block. In addition, maxCandModeIdx can be derived as 1.
[0234] Meanwhile, if the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are not identical to the planar intra prediction mode, MPM candidate 0 and MPM candidate 1 of the MPM list may be previously derived intra prediction modes. In addition, maxCandModeIdx may be a previously derived value.
[0235] In addition, when the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is 2 or more, the encoding device / decoding device can derive MPM candidates 2 to 5 as described below.
[0236] - mpm[2] = (mpm[!maxCandModeIdx] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0237] - mpm[3] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0238] - mpm[4] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0239] - mpm[5] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0240] That is, MPM candidate 2 of the above MPM list can be derived as a DC intra prediction mode if the mpm[!maxCandModeIdx] is a planner intra prediction mode, and can be derived as a planner intra prediction mode if the mpm[!maxCandModeIdx] is not a planner intra prediction mode. In addition, MPM candidate 3 of the MPM list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and MPM candidate 4 of the MPM list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and MPM candidate 5 of the MPM list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2, that is, The intra prediction mode can be derived by performing modular arithmetic on the value obtained by adding an offset of -1 to mpm[maxCandModeIdx] and adding 2 to it as the mode number.
[0241] Alternatively, another example of a method for generating an MPM list may be used. Another example of the above MPM list generation method may be as shown in the following table.
[0242]
[0243] According to an example of the MPM list generation method illustrated in Table 5 above, the encoding device / decoding device can determine whether the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are the same.
[0244] When the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are the same, the encoding device / decoding device can determine whether the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode, and when the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode, the encoding device / decoding device can derive an MPM list of the current block including MPM candidates 0 to 2 derived as described below.
[0245] - mpm[0] = g_intraMode65to33AngMapping[leftIntraDir]
[0246] - mpm[1] = ((g_intraMode65to33AngMapping[leftIntraDir] + offset) % mod) + 2
[0247] - mpm[2] = ((g_intraMode65to33AngMapping[leftIntraDir] - 1) % mod) + 2
[0248] That is, MPM candidate 0 of the MPM list can be derived as the intra prediction mode of the left neighboring block. In addition, MPM candidate 1 of the MPM list can be derived as the intra prediction mode whose mode number is ((g_intraMode65to33AngMapping[leftIntraDir] + offset) % mod) + 2, that is, the intra prediction mode whose mode number is the value obtained by adding an offset to the mode number of the intra prediction mode of the left neighboring block, performing a modular arithmetic operation with mod and adding 2, and MPM candidate 2 of the MPM list can be derived as the intra prediction mode whose mode number is ((g_intraMode65to33AngMapping[leftIntraDir] - 1) % mod) + 2, that is, the intra prediction mode whose mode number is the value obtained by subtracting 1 from the mode number of the intra prediction mode of the left neighboring block, performing a modular arithmetic operation with mod and adding 2.
[0249] Alternatively, if the mode number of the intra prediction mode of the left peripheral block is lower than the mode number of the DC intra prediction mode, the encoding device / decoding device can derive an MPM list of the current block including the derived MPM candidates 0 to 2 as described below.
[0250] - mpm[0] = g_intraMode65to33AngMapping[PLANAR_IDX]
[0251] - mpm[1] = g_intraMode65to33AngMapping[DC_IDX]
[0252] - mpm[2] = g_intraMode65to33AngMapping[VER_IDX]
[0253] That is, MPM candidate 0 of the above MPM list can be derived in the planar intra prediction mode, MPM candidate 1 of the above MPM list can be derived in the DC intra prediction mode, and MPM candidate 2 of the above MPM list can be derived in the vertical intra prediction mode.
[0254] Meanwhile, if the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are not the same, the encoding device / decoding device can derive MPM candidate 0 as the intra prediction mode of the left peripheral block of the current block, and can derive MPM candidate 1 as the intra prediction mode of the upper peripheral block of the current block.
[0255] Thereafter, if both the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are not planar intra prediction, the encoding device / decoding device can derive MPM candidate 2 as the planar intra prediction mode. If at least one of the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block is the planar intra prediction mode, the encoding device / decoding device can determine whether the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is less than 2, and if the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is less than 2, MPM candidate 2 can be derived as the vertical intra prediction mode, and if the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is 2 or more, MPM candidate 2 can be derived as the DC intra prediction mode.
[0256] Furthermore, this paper proposes another embodiment that generalizes the existing general intra prediction, MRL-based intra prediction, and MPM list generation methods used in ISPs into a single, generalized method. We propose a method that does not consider intra-screen prediction modes that will not be used for multi-reference line intra prediction and sub-partition intra prediction at the encoder level.
[0257] For example, when performing intra prediction on multiple reference lines in an encoder, intra prediction is performed by considering only the intra prediction modes included in the MPM list. For example, in the present embodiment, an embodiment may be proposed that does not consider intra prediction modes not used in the MRL and / or the ISP when generating the MPM list.
[0258] That is, for example, when an encoding device performs MRL-based intra prediction, the encoding device can perform intra prediction by considering only the intra prediction modes included in the MPM list. That is, in the present embodiment, when the MPM list includes a planar intra prediction mode or a DC intra prediction mode, the encoding device may not select the planar intra prediction mode or the DC intra prediction mode as the intra prediction mode of the current block. In addition, as an example similar to the above-described example, when the encoding device performs ISP and the MPM list includes a DC intra prediction mode, the encoding device may skip it.
[0259] The MPM mode generation method and mode decoding method of the method proposed in this embodiment may be the same as the MPM mode generation method and mode decoding method of the above-described embodiment, and may include a feature of not considering a specific intra prediction mode only during encoding. Therefore, although there may be a disadvantage of a certain degree of coding efficiency reduction during MPM index encoding and decoding, the hardware and software implementation complexity can be reduced by generating a generalized MPM list, and at the same time, there is an advantage of maintaining MRL-based intra prediction and ISP that do not use a specific intra prediction mode.
[0260] In this embodiment, when applying MRL-based intra prediction and / or ISP, a method is proposed in which an encoding device performs intra prediction without considering a specific intra prediction mode. In this case, the MPM index parsed by the decoding device may not point to the specific intra prediction mode.
[0261] For example, it can be suggested that encoding using the planar intra prediction mode and the DC intra prediction mode is prohibited when MRL-based intra prediction is applied, and encoding using the DC intra prediction mode is prohibited when ISP is applied.
[0262] Fig. 12 illustrates an example of encoding based on intra prediction according to the present embodiment. Referring to Fig. 12, the encoding device can determine whether MRL or ISP is applied to the current block (S1205). If MRL or ISP is applied to the current block, the encoding device can determine whether the MRL is applied (S1210).
[0263] When the MRL is applied to the current block, the encoding device can generate an MPM list for the current block through an MPM list generation process (S1215). Thereafter, the encoding device can perform intra prediction for the current block based on MPM candidates in the MPM list excluding the planar intra prediction mode and the DC intra prediction mode (i.e., intra prediction modes derived from MPM candidates in the MPM list excluding the planar intra prediction mode and the DC intra prediction mode) (S1220), and can select an optimal intra prediction mode for the current block (S1225).
[0264] In addition, when the MRL is not applied to the current block and the ISP is applied, the encoding device can generate an MPM list for the current block through an MPM list generation process (S1230). Here, the MPM list generation process may be the same as the MPM list generation process performed when the above-described MRL is applied. Thereafter, the encoding device can perform intra prediction for the current block based on MPM candidates in the MPM list excluding the DC intra prediction mode (i.e., intra prediction modes derived from MPM candidates in the MPM list excluding the DC intra prediction mode) (S1235), and can select an optimal intra prediction mode for the current block (S1240).
[0265] Meanwhile, if the MRL and the ISP are not applied to the current block, the encoding device can perform general intra prediction for the current block based on 67 intra prediction modes (S1245) and select the optimal intra prediction mode for the current block (S1250).
[0266] Additionally, as another example, an example can be proposed in which encoding using the planar intra prediction mode is prohibited when MRL-based intra prediction is applied, and encoding using the DC intra prediction mode is prohibited when ISP is applied.
[0267] Fig. 13 illustrates an example of encoding based on intra prediction according to the present embodiment. Referring to Fig. 13, the encoding device can determine whether MRL or ISP is applied to the current block (S1305). If MRL or ISP is applied to the current block, the encoding device can determine whether the MRL is applied (S1310).
[0268] When the MRL is applied to the current block, the encoding device can generate an MPM list for the current block through an MPM list generation process (S1315). Thereafter, the encoding device can perform intra prediction for the current block based on MPM candidates in the MPM list excluding the planar intra prediction mode (i.e., intra prediction modes derived from MPM candidates in the MPM list excluding the planar intra prediction mode) (S1320), and select an optimal intra prediction mode for the current block (S1325).
[0269] In addition, when the MRL is not applied to the current block and the ISP is applied, the encoding device can generate an MPM list for the current block through an MPM list generation process (S1330). Here, the MPM list generation process may be the same as the MPM list generation process performed when the above-described MRL is applied. Thereafter, the encoding device can perform intra prediction for the current block based on MPM candidates in the MPM list excluding the DC intra prediction mode (i.e., intra prediction modes derived from MPM candidates in the MPM list excluding the DC intra prediction mode) (S1335), and can select an optimal intra prediction mode for the current block (S1340).
[0270] Meanwhile, if the MRL and the ISP are not applied to the current block, the encoding device can perform general intra prediction for the current block based on 67 intra prediction modes (S1345) and select the optimal intra prediction mode for the current block (S1350).
[0271] Additionally, as another example, an example can be proposed that prohibits encoding using the planar intra prediction mode when MRL-based intra prediction is applied.
[0272] Fig. 14 illustrates an example of encoding based on intra prediction according to the present embodiment. Referring to Fig. 14, the encoding device can determine whether MRL or ISP is applied to the current block (S1405). If MRL or ISP is applied to the current block, the encoding device can determine whether the MRL is applied (S1410).
[0273] When the MRL is applied to the current block, the encoding device can generate an MPM list for the current block through an MPM list generation process (S1415). Thereafter, the encoding device can perform intra prediction for the current block based on MPM candidates in the MPM list excluding the planar intra prediction mode (i.e., intra prediction modes derived from MPM candidates in the MPM list excluding the planar intra prediction mode) (S1420), and select an optimal intra prediction mode for the current block (S1425).
[0274] In addition, when the MRL is not applied to the current block and the ISP is applied, the encoding device can generate an MPM list for the current block through an MPM list generation process (S1430). Here, the MPM list generation process may be the same as the MPM list generation process performed when the above-described MRL is applied. Thereafter, the encoding device can perform intra prediction for the current block based on MPM candidates in the MPM list (i.e., intra prediction modes derived from MPM candidates in the MPM list) (S1435), and select an optimal intra prediction mode for the current block (S1440).
[0275] Meanwhile, if the MRL and the ISP are not applied to the current block, the encoding device can perform general intra prediction for the current block based on 67 intra prediction modes (S1445) and select the optimal intra prediction mode for the current block (S1450).
[0276] Meanwhile, this document proposes a method for more efficiently performing intra prediction based on the DC intra prediction mode when MRL is applied. For example, this embodiment proposes a method for calculating a DC value when the DC intra prediction mode is applied in MRL-based intra prediction (i.e., when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is the DC intra prediction mode).
[0277] Figure 15 illustrates an example of a reference sample used to derive a DC value when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is DC intra prediction mode.
[0278] Fig. 15 (a) may represent reference samples used to derive a DC value when the current block is a square block. For example, when the reference line indicated by the reference line index is reference line 0, reference line 1, reference line 2, or reference line 3, the DC value may be derived based on reference samples within the area (1500) illustrated in Fig. 15 (a). That is, the DC value may be derived based on reference samples in a number equal to the width from the leftmost reference sample within the upper reference line of the current block and reference samples in a number equal to the width from the topmost reference sample within the leftmost reference line of the current block. In other words, when the size of the current block is WxH and the x-component and y-component of the upper left position of the current block are 0, the DC value can be derived based on a reference sample at coordinates (0, -refIdx-1) to (W-1, -refIdx-1) within the upper reference line indicated by the reference line index, and a reference sample at coordinates (-refIdx-1, 0) to (-refIdx-1, H-1) within the left reference line indicated by the reference line index.
[0279] For example, the DC value can be derived as follows:
[0280]
[0281] Here, dcVal may represent a DC value, nTbW may represent the width of the current block, and refIdx may represent a reference line pointed to by the reference line index.
[0282] In addition, (b) of FIG. 15 may represent reference samples used to derive a DC value when the current block is a non-square block. In the present embodiment, when the current block is a non-square block, the DC value may be derived based on reference samples within a reference line of a longer side among the width and height of the current block. For example, when the reference line indicated by the reference line index is reference line 0, reference line 1, reference line 2, or reference line 3, the DC value may be derived based on reference samples within an area (1510) of the reference line of a longer side among the width and height of the current block. For example, when the width of the current block is greater than the height, the DC value may be derived based on reference samples in a number equal to the width from the leftmost reference sample within the upper reference line of the current block. In other words, when the size of the current block is WxH and the x-component and y-component of the upper left position of the current block are 0, the DC value can be derived based on the reference sample at the coordinates (0, -refIdx-1) to the reference sample at the coordinates (W-1, -refIdx-1) within the upper reference line pointed to by the reference line index. The DC value can be derived as shown in the following mathematical formula.
[0283]
[0284] Here, dcVal may represent a DC value, nTbW may represent the width of the current block, and refIdx may represent a reference line pointed to by the reference line index.
[0285] In addition, for example, when the width of the current block is smaller than the height, the DC value can be derived based on a number of reference samples equal to the height from the upper reference sample within the left reference line of the current block. In other words, when the size of the current block is WxH and the x-component and y-component of the upper left position of the current block are 0, the DC value can be derived based on the reference sample at the coordinates (-refIdx-1, 0) to (-refIdx-1, H-1) within the left reference line indicated by the reference line index. The DC value can be derived as in the following mathematical equation.
[0286]
[0287] Here, dcVal may represent a DC value, nTbH may represent the height of the current block, and refIdx may represent a reference line pointed to by the reference line index.
[0288] Thereafter, the prediction sample of the current block can be derived as the DC value.
[0289] Meanwhile, this paper proposes a method for more efficiently performing intra prediction based on the planar intra prediction mode when MRL is applied. For example, in this embodiment, a method for determining reference samples for planar prediction is proposed when the planar intra prediction mode is applied in MRL-based intra prediction (i.e., when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is the planar intra prediction mode).
[0290] Figure 16 illustrates an example of a reference sample used when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is planar intra prediction mode.
[0291] Referring to FIG. 16, when the reference line indicated by the reference line index is reference line 0, reference line 1, reference line 2, or reference line 3, planar prediction may be performed based on reference samples within the region (1600) of the reference line illustrated in FIG. 16. According to the present embodiment, planar prediction may be performed based on the sample at the end +1 of the width / height of the current block, regardless of the reference line index. That is, according to the present embodiment, when the x-component and y-component of the upper left position of the current block are 0, the intra prediction type of the current block is MRL, and the intra prediction mode of the current block is the planar intra prediction mode, planar prediction for the current block may be performed based on the reference sample at the coordinates (W, -refIdx-1) within the upper reference line and the reference sample at the coordinates (-refIdx-1, H) within the left reference line.
[0292] Referring to the present embodiment, the PLANAR intra prediction is performed using reference samples of a reference line indicated by a reference line index, and may be performed based on a left reference sample in the same row (i.e., the same y-coordinate) as the current sample position in the current block among the reference samples of the reference line, an upper reference sample in the same column (i.e., the same x-coordinate) as the current sample position, a reference sample at coordinates (W, -refIdx-1) within the upper reference line, and a reference sample at coordinates (-refIdx-1, H) within the left reference line. In this case, a predicted sample value of the current sample may be derived by performing bidirectional linear interpolation based on the values of the four reference samples described above. Here, the bidirectional linear interpolation may be performed on the assumption that the lower left reference sample is located below the current sample, and the upper right reference sample is located to the right of the current sample.
[0293] Meanwhile, other embodiments of the MPM list generation method commonly used in the above-described general intra prediction, MRL, and ISP may be used. That is, this document proposes another example of the MPM list generation method commonly used in the general intra prediction, MRL, and ISP. Another example of the above MPM list generation method may be as shown in the following table.
[0294]
[0295] According to an example of the MPM list generation method illustrated in Table 6 above, the encoding device / decoding device can derive the intra-prediction mode of the left neighboring block of the current block and the intra-prediction mode of the upper neighboring block. The intra-prediction mode of the left neighboring block can be represented as leftIntraDir, and the intra-prediction mode of the left neighboring block can be represented as aboveIntraDir.
[0296] Also, for example, the encoding device / decoding device can derive a default MPM list. For example, the encoding device / decoding device can derive MPM candidate 0 of the default MPM list as a planar intra prediction mode, MPM candidate 1 as a DC intra prediction mode, MPM candidate 2 as a vertical intra prediction mode, MPM candidate 3 as a horizontal intra prediction mode, MPM candidate 4 as an intra prediction mode of a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, i.e., intra prediction mode number 46, and MPM candidate 5 as an intra prediction mode of a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, i.e., intra prediction mode number 54.
[0297] Thereafter, the encoding device / decoding device can determine whether the intra prediction mode of the left peripheral block of the current block and the intra prediction mode of the upper peripheral block are the same, and whether the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode.
[0298] For example, if the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are the same, and the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode, the encoding device / decoding device can derive an MPM list of the current block including MPM candidates 0 to 5 derived as described below.
[0299] - mpm[0] = PLANAR_IDX
[0300] - mpm[1] = leftIntraDir
[0301] - mpm[2] = 2 + ((leftIntraDir + 61) % 64)
[0302] - mpm[3] = 2 + ((leftIntraDir - 1) % 64)
[0303] - mpm[4] = DC_IDX
[0304] - mpm[5] = 2 + ((leftIntraDir + 60) % 64)
[0305] That is, MPM candidate 0 of the MPM list can be derived as a planar intra prediction mode, MPM candidate 1 of the MPM list can be derived as an intra prediction mode of a left peripheral block, MPM candidate 2 of the MPM list can be derived as an intra prediction mode whose mode number is 2 + ((leftIntraDir + 61) % 64), that is, an intra prediction mode whose mode number is 64 obtained by modular arithmetic operation of the mode number of the intra prediction mode of the left peripheral block plus 61 and then adding 2, MPM candidate 3 of the MPM list can be derived as an intra prediction mode whose mode number is 2 + ((leftIntraDir - 1) % 64), that is, an intra prediction mode whose mode number is 64 obtained by modular arithmetic operation of the mode number of the intra prediction mode of the left peripheral block minus 1 and then adding 2, and MPM candidate 4 of the MPM list can be derived as a DC It can be derived as an intra prediction mode, and MPM candidate 5 of the MPM list can be derived as an intra prediction mode whose mode number is 2 + ((leftIntraDir + 60) % 64), that is, an intra prediction mode whose mode number is a value obtained by adding 60 to the mode number of the intra prediction mode of the left peripheral block, performing a modular arithmetic operation on 64, and adding 2 to it.
[0306] Meanwhile, if the intra prediction mode of the left peripheral block of the current block and the intra prediction mode of the upper peripheral block are not the same, the encoding device / decoding device can determine whether the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode and whether the mode number of the intra prediction mode of the upper peripheral block is greater than the mode number of the DC intra prediction mode.
[0307] If the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode, and the mode number of the intra prediction mode of the upper peripheral block is greater than the mode number of the DC intra prediction mode, the encoding device / decoding device may derive the planar intra prediction mode as MPM candidate 0 of the MPM list, derive the intra prediction mode of the left peripheral block as MPM candidate 1 of the MPM list, derive the intra prediction mode of the upper peripheral block as MPM candidate 2 of the MPM list, and derive the DC intra prediction mode as MPM candidate 3 of the MPM list. In addition, the encoding device / decoding device may derive maxCandModeIdx as 1 if the mode number of the MPM candidate 1 is greater than the mode number of the MPM candidate 2, and may derive maxCandModeIdx as 2 if the mode number of the MPM candidate 1 is not greater than the mode number of the MPM candidate 2. Additionally, the encoding device / decoding device can derive minCandModeidx as 2 if the mode number of the MPM candidate 1 is greater than the mode number of the MPM candidate 2, and can derive maxCandModeIdx as 1 if the mode number of the MPM candidate 1 is not greater than the mode number of the MPM candidate 2.
[0308] Thereafter, if the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the encoding device / decoding device can derive the intra prediction mode whose mode number is 2 + ((maxAB + 61) % 64) as MPM candidate 4 of the MPM list, and can derive the intra prediction mode whose mode number is 2 + ((maxAB - 1) % 64) as MPM candidate 5 of the MPM list. Here, if the maxCandModeIdx is 1, mpm[maxCandModeIdx] may be MPM candidate 1, if the maxCandModeIdx is 2, mpm[maxCandModeIdx] may be MPM candidate 2, if the minCandModeidx is 1, mpm[minCandModeidx] may be MPM candidate 1, and if the minCandModeidx is 2, mpm[minCandModeidx] may be MPM candidate 2. In addition, here, maxAB may be a larger value between the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block.
[0309] Alternatively, if the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is 63 or greater or 1 or less, the encoding device / decoding device can derive the intra prediction mode whose mode number is 2 + ((maxAB + 60) % 64) as MPM candidate 4 of the MPM list, and can derive the intra prediction mode whose mode number is 2 + (maxAB % 64) as MPM candidate 5 of the MPM list.
[0310] Meanwhile, if the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are not the same or at least one of the mode numbers of the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block is smaller than the mode number of the DC intra prediction mode, the encoding device / decoding device can determine whether the sum of the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block is greater than or equal to the mode number of the DC intra prediction mode.
[0311] If the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is greater than or equal to the mode number of the DC intra prediction mode, the encoding device / decoding device can derive an MPM list of the current block including MPM candidates 0 to 5 derived as described below.
[0312] - mpm[0] = PLANAR_IDX
[0313] - mpm[1] = (leftIntraDir < aboveIntraDir) ? aboveIntraDir : leftIntraDir
[0314] - mpm[2] = DC_IDX
[0315] - mpm[3] = 2 + ((maxAB + 61) % 64)
[0316] - mpm[4] = 2 + ((maxAB - 1) % 64)
[0317] - mpm[5] = 2 + ((maxAB + 60) % 64)
[0318] That is, MPM candidate 0 of the MPM list can be derived as a planar intra prediction mode, MPM candidate 1 can be derived as an intra prediction mode of the upper peripheral block if the mode number of the intra prediction mode of the left peripheral block is smaller than the mode number of the intra prediction mode of the upper peripheral block, and as an intra prediction mode of the left peripheral block if the mode number of the intra prediction mode of the left peripheral block is greater than or equal to the mode number of the intra prediction mode of the upper peripheral block, MPM candidate 2 of the MPM list can be derived as a DC intra prediction mode, and MPM candidate 3 of the MPM list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB + 61) % 64), that is, an intra prediction mode whose mode number is a value obtained by adding 61 to a larger value of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block, and then performing a modular arithmetic operation on 64 and adding 2 to the MPM MPM candidate 4 in the list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB - 1) % 64), that is, an intra prediction mode whose mode number is obtained by subtracting 1 from the larger value between the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block, performing modular arithmetic operation on 64, and adding 2 to it, and MPM candidate 5 in the MPM list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB + 60) % 64), that is, an intra prediction mode whose mode number is obtained by adding 60 to the larger value between the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block, performing modular arithmetic operation on 64, and adding 2 to it.
[0319] Meanwhile, if an example of the above-described MPM list generation method is expressed in source code, it can be as shown in the following table.
[0320]
[0321]
[0322] In addition, if an example of the above-described MPM list generation method is expressed in a standard format, it can be as shown in the following table.
[0323]
[0324]
[0325]
[0326] Meanwhile, if the intra prediction according to the intra prediction mode of the current block is expressed in a standard format, it can be as shown in the following table.
[0327]
[0328] In addition, an example of intra prediction based on planar intra prediction mode performed when MRL is applied in the above-described document may be expressed in a standard format as shown in the following table.
[0329]
[0330] In addition, an embodiment of intra prediction based on DC intra prediction mode performed when MRL is applied in the above-described document may be expressed in a standard format as shown in the following table.
[0331]
[0332] Additionally, the horizontal transformation kernel and vertical transformation kernel derived according to the intra prediction mode may be as follows.
[0333]
[0334] For example, if the intra prediction mode of the current block is determined as the DC intra prediction mode, DCT2 can be used as a vertical direction transform kernel for transformation / inverse transformation of the residual of the current block, and DCT2 can be used as a horizontal direction transform kernel.
[0335] Meanwhile, according to this document, the first bean among the bean strings of the syntax element of the MPM index can be context-based regular coded, and the remaining bean strings can be bypass coded.
[0336] In this case, the context index increment ctxInc for indicating the context model of the first bin may be set differently based on at least one of the value of the ISP flag for the current block and / or the value of the reference line index for the current block, as follows.
[0337]
[0338] For example, referring to Table 13, if the value of the reference line index is not 0, the ctxInc can be derived as 2, if the value of the reference line index is 0 and the value of the ISP flag is 1, the ctxInc can be derived as 0, and if the value of the ISP flag is not 1, the ctxInc can be derived as 1.
[0339] Meanwhile, this paper proposes another embodiment of performing intra prediction based on DC intra prediction mode more efficiently when MRL is applied.
[0340] Figure 17 exemplarily shows a reference sample used to derive a DC value when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is DC intra prediction mode.
[0341] Fig. 17(a) may represent reference samples used to derive a DC value when the current block is a square block. For example, when the reference line indicated by the reference line index is reference line 0, reference line 1, reference line 2, or reference line 3, the DC value may be derived based on reference samples within the area (1700) illustrated in Fig. 17(a). That is, when the x-component and y-component of the upper left position of the current block are 0, the DC value may be derived based on a number of reference samples equal to the width from the reference sample at the (-refIdx, -refIdx-1) coordinate within the upper reference line of the current block and a number of reference samples equal to the width from the reference sample at the (-refIdx-1, -refIdx) coordinate within the left reference line of the current block.For example, when the value of the reference line index is 0, the DC value can be derived based on a number of reference samples equal to the width from the reference sample at the coordinate (0, -1) in the upper reference line 0 of the current block and a number of reference samples equal to the width from the reference sample at the coordinate (-1, 0) in the left reference line 0 of the current block, and when the value of the reference line index is 1, the DC value can be derived based on a number of reference samples equal to the width from the reference sample at the coordinate (-1, -2) in the upper reference line 1 of the current block and a number of reference samples equal to the width from the reference sample at the coordinate (-2, -1) in the left reference line 1 of the current block, and when the value of the reference line index is 2, the DC value can be derived based on a number of reference samples equal to the width from the reference sample at the coordinate (-2, -3) in the upper reference line 2 of the current block and a number of reference samples equal to the width from the reference sample at the coordinate (-3, -2) in the left reference line 2 of the current block. And, if the value of the reference line index is 3, the DC value can be derived based on a number of reference samples equal to the width from the reference sample at the coordinate (-3, -4) within the upper reference line 3 of the current block and a number of reference samples equal to the width from the reference sample at the coordinate (-4, -3) within the left reference line 3 of the current block.
[0342] In addition, (b) of FIG. 17 may represent reference samples used to derive a DC value when the current block is a non-square block. In the present embodiment, when the current block is a non-square block, the DC value may be derived based on reference samples within a reference line of a longer side among the width and height of the current block. For example, when the reference line indicated by the reference line index is reference line 0, reference line 1, reference line 2, or reference line 3, the DC value may be derived based on reference samples within an area (1710) of the reference line of a longer side among the width and height of the current block. For example, when the width of the current block is greater than the height, the DC value may be derived based on reference samples having the same number as the width, starting from the reference sample at coordinates (-refIdx, -refIdx-1) within the upper reference line of the current block. For example, when the value of the reference line index is 0, the DC value can be derived based on a number of reference samples equal to the width from a reference sample at coordinates (0, -1) within the upper reference line 0 of the current block, and when the value of the reference line index is 1, the DC value can be derived based on a number of reference samples equal to the width from a reference sample at coordinates (-1, -2) within the upper reference line 1 of the current block, and when the value of the reference line index is 2, the DC value can be derived based on a number of reference samples equal to the width from a reference sample at coordinates (-2, -3) within the upper reference line 2 of the current block, and when the value of the reference line index is 3, the DC value can be derived based on a number of reference samples equal to the width from a reference sample at coordinates (-3, -4) within the upper reference line 3 of the current block.
[0343] Additionally, for example, if the width of the current block is smaller than the height, the DC value can be derived based on a number of reference samples equal to the height, starting from the reference sample at the coordinate (-refIdx-1, -refIdx) within the left reference line of the current block. For example, when the value of the reference line index is 0, the DC value can be derived based on a number of reference samples equal to the height from a reference sample at coordinates (-1, 0) within the left reference line 0 of the current block, and when the value of the reference line index is 1, the DC value can be derived based on a number of reference samples equal to the height from a reference sample at coordinates (-2, -1) within the left reference line 1 of the current block, and when the value of the reference line index is 2, the DC value can be derived based on a number of reference samples equal to the height from a reference sample at coordinates (-3, -2) within the left reference line 2 of the current block, and when the value of the reference line index is 3, the DC value can be derived based on a number of reference samples equal to the height from a reference sample at coordinates (-4, -3) within the left reference line 3 of the current block.
[0344] Thereafter, the prediction sample of the current block can be derived as the DC value.
[0345] An example of intra prediction based on DC intra prediction mode performed when MRL is applied in the above-described document can be expressed in a standard format as shown in the following table.
[0346]
[0347] Meanwhile, this paper proposes another embodiment of more efficiently performing intra prediction based on the planar intra prediction mode when MRL is applied.
[0348] Figure 18 illustrates an example of a reference sample used when the intra prediction type of the current block is MRL and the intra prediction mode of the current block is planar intra prediction mode.
[0349] Referring to FIG. 18, when the reference line indicated by the reference line index is reference line 0, reference line 1, reference line 2, or reference line 3, planar prediction may be performed based on reference samples within the region (1800) of the reference line illustrated in FIG. 18. According to the present embodiment, planar prediction may be performed based on the sample of the end of the width / height of the current block +1-refIdx, regardless of the reference line index. That is, according to the present embodiment, when the x-component and y-component of the upper left position of the current block are 0, the intra prediction type of the current block is MRL, and the intra prediction mode of the current block is the planar intra prediction mode, planar prediction for the current block may be performed based on the reference sample of the coordinates (W-refIdx, -refIdx-1) within the upper reference line and the reference sample of the coordinates (-refIdx-1, H-refIdx) within the left reference line.
[0350] Referring to the present embodiment, the PLANAR intra prediction is performed using reference samples of a reference line indicated by a reference line index, and may be performed based on a left reference sample in the same row (i.e., the same y-coordinate) as the current sample position in the current block among the reference samples of the reference line, an upper reference sample in the same column (i.e., the same x-coordinate) as the current sample position, a reference sample at coordinates (W-refIdx, -refIdx-1) within the upper reference line, and a reference sample at coordinates (-refIdx-1, H-refIdx) within the left reference line. In this case, a predicted sample value of the current sample may be derived by performing bidirectional linear interpolation based on the values of the four reference samples described above. Here, the bidirectional linear interpolation may be performed on the assumption that the lower left reference sample is located below the current sample, and the upper right reference sample is located to the right of the current sample.
[0351] An example of intra prediction based on planar intra prediction mode performed when MRL is applied in the above-described document can be expressed in a standard format as shown in the following table.
[0352]
[0353] Fig. 19 schematically illustrates a video encoding method by an encoding device according to the present document. The method disclosed in Fig. 19 can be performed by the encoding device disclosed in Fig. 2. Specifically, for example, S1900 to S1940 of Fig. 19 can be performed by a prediction unit of the encoding device, and S1950 can be performed by an entropy encoding unit of the encoding device. In addition, although not illustrated, a process of deriving a residual sample for the current block based on an original sample and a prediction sample for the current block can be performed by a subtraction unit of the encoding device, a process of generating residual information for the current block based on the residual sample can be performed by a residual processing unit of the encoding device, and a process of encoding video information including the residual information can be performed by an entropy encoding unit of the encoding device.
[0354] An encoding device determines an intra prediction type for a current block among intra prediction types (S1900). The encoding device may determine an intra prediction type for the current block among the intra prediction types. For example, the encoding device may determine the intra prediction type for the current block by considering an RD (rate distortion) cost. The intra prediction types may include a first intra prediction type that uses an intra prediction reference line adjacent to the current block, a second intra prediction type that uses an intra prediction reference line that is not adjacent to the current block, and a third intra prediction type to which an ISP (Intra Sub-Partitions mode) is applied. The first intra prediction type may represent the general intra prediction described above, the second intra prediction type may represent the MRL described above, and the third intra prediction type may represent the ISP described above.
[0355] Meanwhile, for example, the encoding device may generate and encode a reference line index indicating an intra prediction reference line of the current block. Based on the reference line index, it may be determined whether the intra prediction type for the current block is the second intra prediction type. In addition, for example, if the intra prediction type for the current block is not the second intra prediction type, the encoding device may generate and encode an ISP flag indicating whether the third intra prediction type is applied to the current block. Based on the ISP flag, it may be determined whether the intra prediction type for the current block is the third intra prediction type. If the ISP flag indicates that the third intra prediction type is applied to the current block, the intra prediction type for the current block may be derived as the third intra prediction type, and if the ISP flag indicates that the third intra prediction type is not applied to the current block, the intra prediction type for the current block may be derived as the first intra prediction type. The prediction-related information may include the reference line index, the ISP flag, and / or the ISP index. The prediction-related information may include the reference line index, and when the value of the reference line index is 0, the prediction-related information may further include the ISP flag. Furthermore, when the value of the ISP flag is 1, the prediction-related information may further include the ISP index.
[0356] The encoding device constructs a candidate list of intra prediction modes of the current block based on the intra prediction modes of surrounding blocks of the current block (S1910).
[0357] For example, the encoding device may construct the intra prediction mode candidate list of the current block by performing the intra prediction mode candidate list construction process illustrated in Table 3 described above. Meanwhile, the intra prediction mode candidate list may refer to the MPM (most probable mode) list described above.
[0358] For example, the encoding device can construct the intra prediction mode candidate list based on a first candidate intra prediction mode and a second candidate intra prediction mode. The encoding device can construct the intra prediction mode candidate list based on whether the first candidate intra prediction mode and the second candidate intra prediction mode are the same and / or whether a mode number of the first candidate intra prediction mode and / or a mode number of the second candidate intra prediction mode is greater than a DC intra prediction mode. Here, the first candidate intra prediction mode can be derived based on an intra prediction mode of a left neighboring block of the current block, and the second candidate intra prediction mode can be derived based on an intra prediction mode of an upper neighboring block of the current block. For example, the intra prediction mode of the left neighboring block of the current block can be derived as the first candidate intra prediction mode, and the intra prediction mode of the upper neighboring block of the current block can be derived as the second candidate intra prediction mode.
[0359] Specifically, for example, when the first candidate intra prediction mode and the second candidate intra prediction mode are the same, the encoding device can determine whether the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, and when the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, the encoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0360] - mpm[0] = leftIntraDir
[0361] - mpm[1] = PLANAR_IDX
[0362] - mpm[2] = DC_IDX
[0363] - mpm[3] = ((leftIntraDir + offset) % mod) + 2
[0364] - mpm[4] = ((leftIntraDir - 1) % mod) + 2
[0365] - mpm[5] = ((leftIntraDir + offset - 1) % mod) + 2
[0366] Here, mpm[0], mpm[1], mpm[2], mpm[3], mpm[4], mpm[5] represent intra prediction mode candidate 0, intra prediction mode candidate 1, intra prediction mode candidate 2, intra prediction mode candidate 3, intra prediction mode candidate 4, and intra prediction mode candidate 5, leftIntraDir represents the first candidate intra prediction mode, PLANAR_IDX represents the planar intra prediction mode, and DC_IDX represents the DC intra prediction mode.That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as the DC intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as the intra prediction mode whose mode number is ((leftIntraDir + offset) % mod) + 2, that is, the intra prediction mode whose mode number is the value obtained by adding an offset to the mode number of the first candidate intra prediction mode modulo arithmetic operation and adding 2, and intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as the intra prediction mode whose mode number is ((leftIntraDir - 1) % mod) + 2, that is, the value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode modulo arithmetic operation. An intra prediction mode having a mode number obtained by performing a modular arithmetic operation and adding 2 can be derived, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode having a mode number of ((leftIntraDir + offset - 1) % mod) + 2, that is, an intra prediction mode having a mode number obtained by performing a modular arithmetic operation on a mode number obtained by adding an offset of -1 to the mode number of the first candidate intra prediction mode and adding 2 to it.
[0367] Alternatively, for example, if the first candidate intra prediction mode and the second candidate intra prediction mode are not the same, the encoding device may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as described below.
[0368] - mpm[0] = leftIntraDir
[0369] - mpm[1] = aboveIntraDir
[0370] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as the second candidate intra prediction mode. In addition, the encoding device can derive maxCandModeIdx as 0 if the mode number of the intra prediction mode candidate 0 is greater than the mode number of the intra prediction mode candidate 1, and can derive maxCandModeIdx as 1 if the mode number of the intra prediction mode candidate 0 is not greater than the mode number of the intra prediction mode candidate 1.
[0371] Thereafter, if the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode are greater than the mode number of the DC intra prediction mode, the encoding device can derive intra prediction mode candidate 2 and intra prediction mode candidate 3 as described below.
[0372] - mpm[2] = PLANAR_IDX
[0373] - mpm[3] = DC_IDX
[0374] That is, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a DC intra prediction mode.
[0375] Afterwards, if the value obtained by subtracting the mode number of mpm[!maxCandModeIdx] from the mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the encoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0376] - mpm[4] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0377] - mpm[5] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0378] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as the value obtained by adding offset to mpm[maxCandModeIdx] and adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as the value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2.
[0379] Alternatively, if the value obtained by subtracting the mode number of mpm[!maxCandModeIdx] from the mode number of mpm[maxCandModeIdx] is 63 or greater or 1 or less, the encoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0380] - mpm[4] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0381] - mpm[5] = ((mpm[maxCandModeIdx]) % mod) + 2
[0382] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding offset -1 to mpm[maxCandModeIdx] and performing modular arithmetic with mod and adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx]) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by performing modular arithmetic with mod on mpm[maxCandModeIdx] and adding 2.
[0383] Alternatively, if at least one of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is not greater than the mode number of the DC intra prediction mode, the encoding device may determine whether the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or greater. If the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or greater, the encoding device may derive intra prediction mode candidate 2 to intra prediction mode candidate 5 as described below.
[0384] - mpm[2] = (mpm[!maxCandModeIdx] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0385] - mpm[3] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0386] - mpm[4] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0387] - mpm[5] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0388] That is, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a DC intra prediction mode if the mpm[!maxCandModeIdx] is a planar intra prediction mode, and can be derived as a planar intra prediction mode if the mpm[!maxCandModeIdx] is not a planar intra prediction mode. In addition, the intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to the mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and the intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from the mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and the intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + A 2-person intra prediction mode can be derived, that is, an intra prediction mode having a mode number obtained by performing a modular arithmetic operation on the value obtained by adding an offset of -1 to the above mpm[maxCandModeIdx] and adding 2.
[0389] Alternatively, if the conditions described above are not met, the encoding device may derive intra prediction mode candidates 0 to 5 as described below.
[0390] - mpm[0] = leftIntraDir
[0391] - mpm[1] = (mpm[0] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0392] - mpm[2] = VER_IDX
[0393] - mpm[3] = HOR_IDX
[0394] - mpm[4] = VER_IDX - 4
[0395] - mpm[5] = VER_IDX + 4
[0396] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a DC intra prediction mode if the intra prediction mode candidate 0 is a planar intra prediction mode, and can be derived as a planar intra prediction mode if the intra prediction mode candidate 0 is not a planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a vertical intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a horizontal intra prediction mode, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, i.e., an intra prediction mode number 46, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, That is, it can be derived as 54 intra prediction modes.
[0397] Alternatively, as an example, the encoding device may construct the intra prediction mode candidate list of the current block by performing the intra prediction mode candidate list construction process illustrated in Table 4 described above.
[0398] For example, the encoding device can construct the intra prediction mode candidate list based on a first candidate intra prediction mode and a second candidate intra prediction mode. The encoding device can construct the intra prediction mode candidate list based on whether the first candidate intra prediction mode and the second candidate intra prediction mode are the same and / or whether a mode number of the first candidate intra prediction mode and / or a mode number of the second candidate intra prediction mode is greater than a DC intra prediction mode. Here, the first candidate intra prediction mode can be derived based on an intra prediction mode of a left neighboring block of the current block, and the second candidate intra prediction mode can be derived based on an intra prediction mode of an upper neighboring block of the current block. For example, the intra prediction mode of the left neighboring block of the current block can be derived as the first candidate intra prediction mode, and the intra prediction mode of the upper neighboring block of the current block can be derived as the second candidate intra prediction mode.
[0399] Specifically, for example, when the first candidate intra prediction mode and the second candidate intra prediction mode are the same, the encoding device can determine whether the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, and when the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, the encoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0400] - mpm[0] = leftIntraDir
[0401] - mpm[1] = PLANAR_IDX
[0402] - mpm[2] = ((leftIntraDir + offset) % mod) + 2
[0403] - mpm[3] = ((leftIntraDir - 1) % mod) + 2
[0404] - mpm[4] = DC_IDX
[0405] - mpm[5] = ((leftIntraDir + offset - 1) % mod) + 2
[0406] Here, mpm[0], mpm[1], mpm[2], mpm[3], mpm[4], mpm[5] represent intra prediction mode candidate 0, intra prediction mode candidate 1, intra prediction mode candidate 2, intra prediction mode candidate 3, intra prediction mode candidate 4, and intra prediction mode candidate 5, leftIntraDir represents the first candidate intra prediction mode, PLANAR_IDX represents the planar intra prediction mode, and DC_IDX represents the DC intra prediction mode.That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((leftIntraDir + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to the mode number of the first candidate intra prediction mode, modulo arithmetic operation, and adding 2, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((leftIntraDir - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode, modulo arithmetic operation, and adding 2, and Intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as a DC intra prediction mode, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((leftIntraDir + offset - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by performing a modular arithmetic operation on the mode number of the first candidate intra prediction mode plus an offset of -1 and then adding 2 to it.
[0407] Alternatively, for example, if the first candidate intra prediction mode and the second candidate intra prediction mode are not the same, the encoding device may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as described below.
[0408] - mpm[0] = leftIntraDir
[0409] - mpm[1] = aboveIntraDir
[0410] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as the second candidate intra prediction mode. In addition, the encoding device can derive maxCandModeIdx as 0 if the mode number of the intra prediction mode candidate 0 is greater than the mode number of the intra prediction mode candidate 1, and can derive maxCandModeIdx as 1 if the mode number of the intra prediction mode candidate 0 is not greater than the mode number of the intra prediction mode candidate 1.
[0411] Thereafter, if the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode are greater than the mode number of the DC intra prediction mode, the encoding device can derive intra prediction mode candidate 1 to intra prediction mode candidate 3 as described below.
[0412] - mpm[1] = PLANAR_IDX
[0413] - mpm[2] = aboveIntraDir
[0414] - maxCandModeIdx = mpm[0] > mpm[2] ? 0:2
[0415] - int minCandModeidx = mpm[0] > mpm[2] ? 2 : 0
[0416] - mpm[3] = DC_IDX;
[0417] That is, intra-prediction mode candidate 1 of the intra-prediction mode candidate list can be derived as a planar intra-prediction mode, intra-prediction mode candidate 2 of the intra-prediction mode candidate list can be derived as a second candidate intra-prediction mode, and intra-prediction mode candidate 3 of the intra-prediction mode candidate list can be derived as a DC intra-prediction mode. In addition, the encoding device can derive maxCandModeIdx as 0 if the mode number of the intra-prediction mode candidate 0 is greater than the mode number of the intra-prediction mode candidate 2, and can derive maxCandModeIdx as 2 if the mode number of the intra-prediction mode candidate 0 is not greater than the mode number of the intra-prediction mode candidate 2. Additionally, the encoding device can derive minCandModeidx as 2 if the mode number of the intra prediction mode candidate 0 is greater than the mode number of the intra prediction mode candidate 2, and can derive minCandModeidx as 0 if the mode number of the intra prediction mode candidate 0 is not greater than the mode number of the intra prediction mode candidate 2.
[0418] Afterwards, if the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the encoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0419] - mpm[4] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0420] - mpm[5] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0421] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as the value obtained by adding offset to mpm[maxCandModeIdx] and adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as the value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2.
[0422] Alternatively, if the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is 63 or greater or 1 or less, the encoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0423] - mpm[4] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0424] - mpm[5] = ((mpm[maxCandModeIdx]) % mod) + 2
[0425] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding offset -1 to mpm[maxCandModeIdx] and performing modular arithmetic with mod and adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx]) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by performing modular arithmetic with mod on mpm[maxCandModeIdx] and adding 2.
[0426] Alternatively, if at least one of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is not greater than the mode number of the DC intra prediction mode, the encoding device may determine whether the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or greater. If the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or greater, the encoding device may determine whether at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is a planar intra prediction mode.
[0427] If at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is a planar intra prediction mode, the encoding device can derive intra prediction mode candidate 0 to intra prediction mode candidate 1 as described below.
[0428] - mpm[0] = PLANAR_IDX
[0429] - mpm[1] = (leftIntraDir < aboveIntraDir) ? aboveIntraDir : leftIntraDir
[0430] - maxCandModeIdx = 1
[0431] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode with a mode number, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a second candidate intra prediction mode if the mode number of the first candidate intra prediction mode is smaller than the mode number of the second candidate intra prediction mode, and can be derived as a first candidate intra prediction mode if the mode number of the first candidate intra prediction mode is greater than or equal to the mode number of the second candidate intra prediction mode. In addition, the encoding device can derive maxCandModeIdx as 1.
[0432] If the first candidate intra prediction mode and the second candidate intra prediction mode are not planar intra prediction modes, the encoding device can derive intra prediction mode candidate 2 to intra prediction mode candidate 5 as described below.
[0433] - mpm[2] = (mpm[!maxCandModeIdx] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0434] - mpm[3] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0435] - mpm[4] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0436] - mpm[5] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0437] That is, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a DC intra prediction mode if the mpm[!maxCandModeIdx] is a planar intra prediction mode, and can be derived as a planar intra prediction mode if the mpm[!maxCandModeIdx] is not a planar intra prediction mode. In addition, the intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to the mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and the intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from the mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and the intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + A 2-person intra prediction mode can be derived, that is, an intra prediction mode having a mode number obtained by performing a modular arithmetic operation on the value obtained by adding an offset of -1 to the above mpm[maxCandModeIdx] and adding 2.
[0438] Alternatively, if the conditions described above are not met, the encoding device may derive intra prediction mode candidates 0 to 5 as described below.
[0439] - mpm[0] = leftIntraDir
[0440] - mpm[1] = (mpm[0] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0441] - mpm[2] = VER_IDX
[0442] - mpm[3] = HOR_IDX
[0443] - mpm[4] = VER_IDX - 4
[0444] - mpm[5] = VER_IDX + 4
[0445] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a DC intra prediction mode if the intra prediction mode candidate 0 is a planar intra prediction mode, and can be derived as a planar intra prediction mode if the intra prediction mode candidate 0 is not a planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a vertical intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a horizontal intra prediction mode, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, i.e., an intra prediction mode number 46, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, That is, it can be derived as 54 intra prediction modes.
[0446] Alternatively, as an example, the encoding device may configure the intra prediction mode candidate list of the current block by performing the intra prediction mode candidate list configuration process illustrated in Table 5 described above.
[0447] For example, the encoding device can construct the intra prediction mode candidate list based on a first candidate intra prediction mode and a second candidate intra prediction mode. The encoding device can construct the intra prediction mode candidate list based on whether the first candidate intra prediction mode and the second candidate intra prediction mode are the same and / or whether a mode number of the first candidate intra prediction mode and / or a mode number of the second candidate intra prediction mode is greater than a DC intra prediction mode. Here, the first candidate intra prediction mode can be derived based on an intra prediction mode of a left neighboring block of the current block, and the second candidate intra prediction mode can be derived based on an intra prediction mode of an upper neighboring block of the current block. For example, the intra prediction mode of the left neighboring block of the current block can be derived as the first candidate intra prediction mode, and the intra prediction mode of the upper neighboring block of the current block can be derived as the second candidate intra prediction mode.
[0448] Specifically, for example, when the first candidate intra prediction mode and the second candidate intra prediction mode are the same, the encoding device can determine whether the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, and when the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, the encoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0449] - mpm[0] = g_intraMode65to33AngMapping[leftIntraDir]
[0450] - mpm[1] = ((g_intraMode65to33AngMapping[leftIntraDir] + offset) % mod) + 2
[0451] - mpm[2] = ((g_intraMode65to33AngMapping[leftIntraDir] - 1) % mod) + 2
[0452] That is, intra prediction mode candidate 0 of the above intra prediction mode candidate list can be derived as the first candidate intra prediction mode. In addition, the intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((g_intraMode65to33AngMapping[leftIntraDir] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as a value obtained by adding an offset to the mode number of the first candidate intra prediction mode and adding 2 to it, and the intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((g_intraMode65to33AngMapping[leftIntraDir] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as a value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode and adding 2 to it.
[0453] Alternatively, if the mode number of the first candidate intra prediction mode is not greater than the mode number of the DC intra prediction mode, the encoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0454] - mpm[0] = g_intraMode65to33AngMapping[PLANAR_IDX]
[0455] - mpm[1] = g_intraMode65to33AngMapping[DC_IDX]
[0456] - mpm[2] = g_intraMode65to33AngMapping[VER_IDX]
[0457] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a DC intra prediction mode, and intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a vertical intra prediction mode.
[0458] Alternatively, if the first candidate intra prediction mode and the second candidate intra prediction mode are not the same, the encoding device can derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as described below.
[0459] - mpm[0] = g_intraMode65to33AngMapping[leftIntraDir]
[0460] - mpm[1] = g_intraMode65to33AngMapping[aboveIntraDir]
[0461] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a second candidate intra prediction mode.
[0462] Thereafter, if both the first candidate intra prediction mode and the second candidate intra prediction mode are planar intra prediction modes, the encoding device can derive intra prediction mode candidate 2 as described below.
[0463] - mpm[2] = g_intraMode65to33AngMapping[PLANAR_IDX]
[0464] That is, intra prediction mode candidate 2 of the above intra prediction mode candidate list can be derived as a planar intra prediction mode.
[0465] Alternatively, if at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is a planar intra prediction mode, the encoding device can derive intra prediction mode candidate 2 as described below.
[0466] - mpm[2] = g_intraMode65to33AngMapping[(leftIntraDir + aboveIntraDir) < 2 ? VER_IDX : DC_IDX]
[0467] That is, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a vertical intra prediction mode if the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is less than 2, and as a DC intra prediction mode if the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or more.
[0468] Alternatively, as an example, the encoding device may construct the intra prediction mode candidate list of the current block based on the intra prediction modes of the surrounding blocks of the current block, as illustrated in Table 6 described above. Meanwhile, the intra prediction mode candidate list may refer to the MPM (most probable mode) list described above.
[0469] For example, the encoding device can construct the intra-prediction mode candidate list based on the intra-prediction mode of the left neighboring block of the current block and the intra-prediction mode of the upper neighboring block of the current block. The encoding device can determine whether the intra-prediction mode of the left neighboring block of the current block and the intra-prediction mode of the upper neighboring block are the same and the mode number of the intra-prediction mode of the left neighboring block is greater than the mode number of the DC intra-prediction mode. The encoding device can construct the intra-prediction mode candidate list based on whether the intra-prediction mode of the left neighboring block of the current block and the intra-prediction mode of the upper neighboring block are the same and / or whether the mode number of the intra-prediction mode of the left neighboring block is greater than the mode number of the DC intra-prediction mode.
[0470] If the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are the same, and the mode number of the intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode, the encoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0471] - mpm[0] = INTRA_PLANAR
[0472] - mpm[1] = candIntraPredModeA
[0473] - mpm[2] = 2 + ((candIntraPredModeA + 61) % 64)
[0474] - mpm[3] = 2 + ((candIntraPredModeA - 1) % 64)
[0475] - mpm[4] = INTRA_DC
[0476] - mpm[5] = 2 + ((candIntraPredModeA + 60) % 64)
[0477] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as an intra prediction mode of a left peripheral block, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 61) % 64), that is, an intra prediction mode whose mode number is a value obtained by adding 61 to the mode number of the intra prediction mode of the left peripheral block, performing a modular arithmetic operation on 64, and adding 2, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((candIntraPredModeA - 1) % 64), that is, a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left peripheral block, performing a modular arithmetic operation on 64, and adding 2. The intra prediction mode can be derived as a mode number, and the intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as a DC intra prediction mode, and the intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 60) % 64), that is, the intra prediction mode whose mode number is a value obtained by adding 60 to the mode number of the intra prediction mode of the left peripheral block, performing a modular arithmetic operation on 64, and adding 2 to it.That is, for example, if the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block are the same, and the mode number of the intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode, the intra prediction mode candidate list may include the intra prediction mode of the left neighboring block, the intra prediction mode of the upper neighboring block, the intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 61) % 64), the intra prediction mode whose mode number is 2 + ((candIntraPredModeA - 1) % 64), and the intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 60) % 64) as intra prediction mode candidates. Here, candIntraPredModeA may represent the mode number of the intra prediction mode of the left neighboring block of the current block.
[0478] Meanwhile, if the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are not the same, for example, the encoding device can determine whether at least one of the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block is greater than the mode number of the DC intra prediction mode. If at least one of the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block is greater than the mode number of the DC intra prediction mode, variables minAB and maxAB can be derived as follows.
[0479] - minAB = Min(candIntraPredModeA, candIntraPredModeB)
[0480] - maxAB = Max(candIntraPredModeA, candIntraPredModeB)
[0481] Here, candIntraPredModeA may represent a mode number of an intra prediction mode of the left neighboring block of the current block, and candIntraPredModeB may represent a mode number of an intra prediction mode of the upper neighboring block of the current block. That is, minAB may represent a smaller value between the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block, and maxAB may represent a larger value between the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block.
[0482] In addition, when the intra prediction mode of the left peripheral block of the current block and the intra prediction mode of the upper peripheral block are not the same, the encoding device can determine whether the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode and whether the mode number of the intra prediction mode of the upper peripheral block is greater than the mode number of the DC intra prediction mode.
[0483] For example, if the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode, and the mode number of the intra prediction mode of the upper peripheral block is greater than the mode number of the DC intra prediction mode, the encoding device can derive intra prediction mode candidates 0 to 3 as described below.
[0484] mpm[0] = INTRA_PLANAR
[0485] mpm[1] = candIntraPredModeA
[0486] mpm[2] = candIntraPredModeB
[0487] mpm[3] = INTRA_DC
[0488] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as an intra prediction mode of a left neighboring block, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as an intra prediction mode of an upper neighboring block, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a DC intra prediction mode. Here, candIntraPredModeB can represent a mode number of an intra prediction mode of the upper neighboring block of the current block. That is, for example, if the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are not the same, and the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block are greater than the mode number of the DC intra prediction mode, the intra prediction mode candidate list may include the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block as intra prediction mode candidates.
[0489] Thereafter, the remaining intra prediction mode candidates (intra prediction mode candidate 4 and intra prediction mode candidate 5) can be derived based on the maxAB and the minAB. Specifically, the remaining intra prediction mode candidates can be derived based on the difference between a larger value and a smaller value among the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block.
[0490] For example, if the value obtained by subtracting the minAB from the maxAB is less than 63 and greater than 1 (i.e., if the value obtained by subtracting the minAB from the maxAB is one of 2 to 62), the encoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0491] - mpm[4] = 2 + ((maxAB + 61) % 64)
[0492] - mpm[5] = 2 + ((maxAB - 1) % 64)
[0493] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB + 61) % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on 64 obtained by adding 61 to maxAB and then adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB - 1) % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on 64 obtained by subtracting 1 from maxAB and then adding 2. Here, maxAB can represent a larger value between the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block.
[0494] Alternatively, if the value obtained by subtracting the minAB from the maxAB is 63 or more or 1 or less, the encoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0495] - mpm[4] = 2 + ((maxAB + 60) % 64)
[0496] - mpm[5] = 2 + (maxAB % 64)
[0497] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB + 60) % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on maxAB plus 60 to 64 and then adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + (maxAB % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on maxAB plus 64 and then adding 2. Here, maxAB can represent a larger value between the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block.
[0498] Meanwhile, if the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are not the same or at least one of the mode numbers of the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block is smaller than the mode number of the DC intra prediction mode, the encoding device can determine whether the sum of the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block is greater than or equal to the mode number of the DC intra prediction mode.
[0499] For example, if the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is greater than or equal to the mode number of the DC intra prediction mode, the encoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0500] - mpm[0] = INTRA_PLANAR
[0501] - mpm[1] = maxAB
[0502] - mpm[2] = INTRA_DC
[0503] - mpm[3] = 2 + ((maxAB + 61) % 64)
[0504] - mpm[4] = 2 + ((maxAB - 1) % 64)
[0505] - mpm[5] = 2 + ((maxAB + 60) % 64)
[0506] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 1 can be derived as maxAB, that is, intra prediction mode candidate 1 can be derived as an intra prediction mode of the upper peripheral block if the mode number of the intra prediction mode of the left peripheral block is smaller than the mode number of the intra prediction mode of the upper peripheral block, and as an intra prediction mode of the left peripheral block if the mode number of the intra prediction mode of the left peripheral block is greater than or equal to the mode number of the intra prediction mode of the upper peripheral block, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a DC intra prediction mode, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB + 61) % 64), that is, an intra prediction mode whose mode number is 2 + ((maxAB + 61) % 64), that is, an intra prediction mode whose mode number is obtained by performing modular arithmetic operation on the value obtained by adding 61 to the maxAB and then adding 2 to it. And, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB - 1) % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on the value obtained by subtracting 1 from maxAB by 64 and adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB + 60) % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on the value obtained by adding 60 to maxAB by 64 and adding 2.
[0507] Alternatively, for example, if the conditions described above are not met, the encoding device may derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0508] - mpm[0] = INTRA_PLANAR
[0509] - mpm[1] = INTRA_DC
[0510] - mpm[2] = INTRA_ANGULAR50
[0511] - mpm[3] = INTRA_ANGULAR18
[0512] - mpm[4] = INTRA_ANGULAR46
[0513] - mpm[5] = INTRA_ANGULAR54
[0514] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a DC intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a vertical intra prediction mode (i.e., intra prediction mode 50), intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a horizontal intra prediction mode (i.e., intra prediction mode 18), intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, i.e., intra prediction mode 46, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, i.e., intra prediction mode 54. That is, for example, if the conditions described above are not met, the intra prediction mode candidate list may include DC intra prediction mode, 50th intra prediction mode, 18th intra prediction mode, 46th intra prediction mode, and 54th intra prediction mode as intra prediction mode candidates.
[0515] Meanwhile, for example, if the left neighboring block is not available, if intra prediction is not applied to the left neighboring block, if the value of the Combined Inter and Intra Prediction (CIIP) flag of the left neighboring block is not 1, if the value of the pcm flag of the left neighboring block is 1, the intra prediction mode of the left neighboring block corresponding to at least one of the following cases may be derived as a planar intra prediction mode. In addition, for example, if the upper neighboring block is not available, if intra prediction is not applied to the upper neighboring block, if the value of the CIIP flag of the upper neighboring block is not 1, if the value of the pcm flag of the upper neighboring block is 1, if the upper neighboring block is not included in the current CTU, the intra prediction mode of the left neighboring block corresponding to at least one of the following cases may be derived as a planar intra prediction mode.
[0516] Meanwhile, the intra prediction mode candidate list generated when the intra prediction type is the first intra prediction type, the intra prediction mode candidate list generated when the intra prediction type is the second intra prediction type, and the intra prediction mode candidate list generated when the intra prediction type is the third intra prediction type may be the same. That is, the same intra prediction mode candidate list may be configured regardless of the intra prediction type for the current block. The intra prediction mode candidate list may be configured through the same intra prediction mode configuration process regardless of the intra prediction type for the current block. The intra prediction mode configuration process may be the same as one of the above-described embodiments.
[0517] The encoding device derives an intra prediction mode of the current block based on the intra prediction mode candidate list (S1920). The encoding device may perform various intra prediction modes to derive an intra prediction mode with an optimal RD cost as the intra prediction mode for the current block. For example, the encoding device may derive an intra prediction mode with an optimal RD cost among intra prediction mode candidates in the intra prediction mode candidate list as the intra prediction mode for the current block. The intra prediction mode may be one of two non-directional intra prediction modes and 65 intra directional prediction modes. As described above, the two non-directional intra prediction modes may include an intra DC mode and an intra planar mode.
[0518] Meanwhile, for example, when the intra prediction type for the current block is derived as the second intra prediction type, the intra prediction mode of the current block may be selected as one of intra prediction modes other than the planar intra prediction mode and the DC intra prediction mode, and when the intra prediction type for the current block is derived as the third intra prediction type, the intra prediction mode of the current block may be selected as one of intra prediction modes other than the DC intra prediction mode.
[0519] Alternatively, for example, if the intra prediction type for the current block is derived as the second intra prediction type, the intra prediction mode of the current block may be selected as one of the intra prediction modes other than the planar intra prediction mode, and if the intra prediction type for the current block is derived as the third intra prediction type, the intra prediction mode of the current block may be selected as one of the intra prediction modes other than the DC intra prediction mode.
[0520] Alternatively, for example, if the intra prediction type for the current block is derived as the second intra prediction type, the intra prediction mode of the current block may be selected as one of the intra prediction modes other than the planar intra prediction mode.
[0521] The encoding device may generate an MPM flag indicating whether the determined intra prediction mode is included in the intra prediction mode candidates of the intra prediction mode candidate list. The MPM flag may be referred to as an intra prediction mode candidate flag. If the determined intra prediction mode is included in the intra prediction mode candidates of the intra prediction mode candidate list, the encoding device may generate an MPM index indicating the determined intra prediction mode among the intra prediction mode candidates. The MPM index may be referred to as an intra prediction mode candidate index. If the determined intra prediction mode is not included in the intra prediction mode candidates of the intra prediction mode candidate list, the encoding device may generate remaining intra prediction mode information indicating the determined intra prediction mode among the remaining intra prediction modes that are not included in the intra prediction mode candidates. Meanwhile, if the determined intra prediction mode is included in the intra prediction mode candidates of the intra prediction mode candidate list, the encoding device may not signal the MPM flag, and the value of the MPM flag may be derived as 1. The prediction-related information for the current block may include the MPM flag, the MPM index, and / or the remaining intra prediction mode information.
[0522] The encoding device derives reference samples of the current block based on the intra prediction type and the intra prediction mode (S1930).
[0523] For example, when the intra prediction type is derived as the first intra prediction type, the encoding device may derive at least one reference sample from among reference samples in an intra prediction reference line adjacent to the current block based on the intra prediction mode. The reference samples may include an upper left corner reference sample, upper reference samples, and left reference samples of the current block. For example, when the size of the current block is WxH, and the x component of the top-left sample position of the current block is xN and the y component is yN, the left reference samples may be p[xN-1][yN] to p[xN-1][2H+yN-1], the upper left corner reference sample may be p[xN-1][yN-1], and the upper reference samples may be p[xN][yN-1] to p[2W+xN-1][yN-1].
[0524] Alternatively, for example, if the intra prediction type is derived as the second intra prediction type, the encoding device may derive at least one reference sample from among reference samples within an intra prediction reference line that is not adjacent to the current block based on the intra prediction mode. Here, the intra prediction reference line may be a reference line that is 1, 2, or 3 samples away from the upper boundary and / or the left boundary of the current block.
[0525] Alternatively, for example, if the intra prediction type is derived as the third intra prediction type, the encoding device can derive the ISP split type of the current block, and can split the current block according to the ISP split type to derive sub-blocks. The split type may be a horizontal split type or a vertical split type. For example, if the size of the current block is 4x4, the current block may not be split. In addition, for example, if the size of the current block is 4x8 and the split type is a horizontal split type, the current block may be split into two 4x4-sized sub-blocks. In addition, for example, if the size of the current block is 4x8 and the split type is a vertical split type, the current block may be split into two 2x8-sized sub-blocks. In addition, for example, when the size of the current block is 8x4 and the partition type is a horizontal partition type, the current block can be partitioned into two 8x2 sized sub-blocks. In addition, for example, when the size of the current block is 8x4 and the partition type is a vertical partition type, the current block can be partitioned into two 4x4 sized sub-blocks. In addition, for example, when the size of the current block is WxH (wherein, the size of the current block is a size other than 4x8, 8x4, or 4x4) and the partition type is a horizontal partition type, the current block can be partitioned into four WxH / 4 sized sub-blocks. In addition, for example, when the size of the current block is WxH and the partition type is a vertical partition type, the current block can be partitioned into four W / 4xH sized sub-blocks.Thereafter, the encoding device can derive at least one reference sample among reference samples in an intra prediction reference line adjacent to the sub-block. The reference samples can include an upper-left corner reference sample, upper reference samples, and left reference samples of the current block. For example, if the size of the sub-block is WxH, and the x-component of the upper-left sample position of the sub-block is xN and the y-component is yN, the left reference samples can be p[xN-1][yN] to p[xN-1][2H+yN-1], the upper-left corner reference sample can be p[xN-1][yN-1], and the upper reference samples can be p[xN][yN-1] to p[2W+xN-1][yN-1].
[0526] Or, for example, if the intra prediction mode of the current block is derived as a DC intra prediction mode, and the current block is a square block, the size of the current block is WxH, and the x-component and y-component of the upper left position of the current block are 0, a reference sample at coordinates (0, -refIdx-1) to (W-1, -refIdx-1) within the upper intra prediction reference line indicated by the reference line index of the current block, and a reference sample at coordinates (-refIdx-1, 0) to (-refIdx-1, H-1) within the left intra prediction reference line indicated by the reference line index can be derived.
[0527] Or, for example, if the intra prediction mode of the current block is derived as a DC intra prediction mode, the current block is a non-square block whose width is greater than its height, the size of the current block is WxH, and the x-component and y-component of the upper left position of the current block are 0, a reference sample at coordinates (0, -refIdx-1) to a reference sample at coordinates (W-1, -refIdx-1) within the upper intra prediction reference line indicated by the reference line index of the current block can be derived.
[0528] Or, for example, if the intra prediction mode of the current block is derived as a DC intra prediction mode, and the current block is a non-square block whose height is greater than its width, and the size of the current block is WxH, and the x-component and y-component of the upper left position of the current block are 0, a reference sample at coordinates (-refIdx-1, 0) or a reference sample at coordinates (-refIdx-1, H-1) within the left intra prediction reference line indicated by the reference line index of the current block can be derived.
[0529] Or, for example, if the intra prediction mode of the current block is derived as a planar intra prediction mode, the size of the current block is WxH, and the x-component and y-component of the upper left position of the current block are 0, reference samples including a reference sample at coordinates (W-1, -refIdx-1) and a reference sample at coordinates (-refIdx-1, H-1) within the intra prediction reference line pointed to by the reference line index of the current block can be derived.
[0530] The encoding device generates a prediction sample of the current block based on the reference samples (S1940).
[0531] For example, when the intra prediction type is derived as the first intra prediction type, the encoding device may derive at least one reference sample from among reference samples in an intra prediction reference line adjacent to the current block based on the intra prediction mode, and may generate a prediction sample of the current block based on the reference sample. The reference samples may include an upper left corner reference sample, upper reference samples, and left reference samples of the current block. For example, when the size of the current block is WxH, and the x component of the top-left sample position of the current block is xN and the y component is yN, the left reference samples may be p[xN-1][yN] to p[xN-1][2H+yN-1], the upper left corner reference sample may be p[xN-1][yN-1], and the upper reference samples may be p[xN][yN-1] to p[2W+xN-1][yN-1].
[0532] Alternatively, for example, if the intra prediction type is derived as the second intra prediction type, the encoding device may derive at least one reference sample from among reference samples in an intra prediction reference line that is not adjacent to the current block based on the intra prediction mode, and may generate a prediction sample of the current block based on the reference sample. Here, the intra prediction reference line may be a reference line that is 1, 2, or 3 samples away from an upper boundary and / or a left boundary of the current block.
[0533] Alternatively, for example, if the intra prediction type is derived as the third intra prediction type, the encoding device may determine the ISP split type of the current block, and may split the current block according to the ISP split type to derive sub-blocks. The split type may be a horizontal split type or a vertical split type. For example, if the size of the current block is 4x4, the current block may not be split. In addition, for example, if the size of the current block is 4x8 and the split type is a horizontal split type, the current block may be split into two 4x4-sized sub-blocks. In addition, for example, if the size of the current block is 4x8 and the split type is a vertical split type, the current block may be split into two 2x8-sized sub-blocks. In addition, for example, when the size of the current block is 8x4 and the partition type is a horizontal partition type, the current block can be partitioned into two 8x2 sized sub-blocks. In addition, for example, when the size of the current block is 8x4 and the partition type is a vertical partition type, the current block can be partitioned into two 4x4 sized sub-blocks. In addition, for example, when the size of the current block is WxH (wherein, the size of the current block is a size other than 4x8, 8x4, or 4x4) and the partition type is a horizontal partition type, the current block can be partitioned into four WxH / 4 sized sub-blocks. In addition, for example, when the size of the current block is WxH and the partition type is a vertical partition type, the current block can be partitioned into four W / 4xH sized sub-blocks.Thereafter, the encoding device can perform intra prediction on each of the sub-blocks to generate a prediction sample. That is, the encoding device can derive at least one reference sample among reference samples in an intra prediction reference line of each sub-block of the current block based on the intra prediction mode, and can generate the prediction sample based on the reference sample. The intra prediction reference line of each sub-block may be a reference line adjacent to each sub-block. Meanwhile, the encoding device can generate and encode an ISP split flag indicating the ISP split type. The prediction-related information may include the ISP split flag.
[0534] Or, for example, if the intra prediction mode of the current block is derived as a DC intra prediction mode, and the current block is a square block, the size of the current block is WxH, and the x-component and the y-component of the upper left position of the current block are 0, the DC value may be derived based on a reference sample at coordinates (0, -refIdx-1) to (W-1, -refIdx-1) within an upper intra prediction reference line indicated by a reference line index of the current block, and a reference sample at coordinates (-refIdx-1, 0) to (-refIdx-1, H-1) within a left intra prediction reference line indicated by the reference line index. A prediction sample of the current block may be derived as the DC value.
[0535] Or, for example, if the intra prediction mode of the current block is derived as a DC intra prediction mode, and the current block is a non-square block whose width is greater than its height, and the size of the current block is WxH, and the x-component and the y-component of the upper left position of the current block are 0, the DC value can be derived based on a reference sample at coordinates (0, -refIdx-1) to a reference sample at coordinates (W-1, -refIdx-1) within an upper intra prediction reference line indicated by a reference line index of the current block. A prediction sample of the current block can be derived as the DC value.
[0536] Or, for example, when the intra prediction mode of the current block is derived as a DC intra prediction mode, and the current block is a non-square block whose height is greater than its width, and the size of the current block is WxH, and the x-component and the y-component of the upper left position of the current block are 0, the DC value can be derived based on a reference sample at coordinates (-refIdx-1, 0) to a reference sample at coordinates (-refIdx-1, H-1) within a left intra prediction reference line indicated by a reference line index of the current block. A prediction sample of the current block can be derived as the DC value.
[0537] Or, for example, if the intra prediction mode of the current block is derived as a planar intra prediction mode, the size of the current block is WxH, and the x component and y component of the upper left position of the current block are 0, the prediction sample can be derived based on a reference sample at coordinates (W-1, -refIdx-1) and a reference sample at coordinates (-refIdx-1, H-1) within the intra prediction reference line indicated by the reference line index of the current block.
[0538] The encoding device encodes image information including prediction-related information for the current block (S1950). The encoding device can encode the image information including the prediction-related information for the current block and output it in the form of a bitstream. The prediction-related information can include the reference line index, the ISP flag, and / or the ISP index. In addition, the prediction-related information can include the MPM flag, the MPM index, and / or the remaining intra prediction mode information. In addition, although not shown, the encoding device can derive a residual sample for the current block based on an original sample and a prediction sample for the current block, can generate residual information for the current block based on the residual sample, can encode image information including the residual information, and can output it in the form of a bitstream. Meanwhile, the bitstream can be transmitted to a decoding device via a network or a (digital) storage medium. Here, the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, and SSD.
[0539] Fig. 20 schematically illustrates an encoding device that performs an image encoding method according to the present document. The method disclosed in Fig. 19 can be performed by the encoding device disclosed in Fig. 20. Specifically, for example, the prediction unit of the encoding device of Fig. 20 can perform S1900 to S1940 of Fig. 19, and the entropy encoding unit of the encoding device of Fig. 20 can perform S1950 of Fig. 19. In addition, although not illustrated, a process of deriving a residual sample for the current block based on an original sample and a prediction sample for the current block can be performed by a subtraction unit of the encoding device of Fig. 20, a process of generating residual information for the current block based on the residual sample can be performed by a residual processing unit of the encoding device of Fig. 20, and a process of encoding image information including the residual information can be performed by an entropy encoding unit of the encoding device of Fig. 20.
[0540] Fig. 21 schematically illustrates a video decoding method by a decoding device according to the present document. The method disclosed in Fig. 21 can be performed by the decoding device disclosed in Fig. 3. Specifically, for example, S2100 of Fig. 21 can be performed by an entropy decoding unit of the decoding device, and S2110 to S2150 of Fig. 21 can be performed by a prediction unit of the decoding device. In addition, although not illustrated, a process of obtaining video information including residual information for the current block through a bitstream can be performed by an entropy decoding unit of the decoding device, a process of deriving the residual sample for the current block based on the residual information can be performed by an inverse transform unit of the decoding device, and a process of generating a reconstructed picture based on the prediction sample and the residual sample can be performed by an adding unit of the decoding device.
[0541] The decoding device receives prediction-related information for the current block (S2100). The decoding device can receive and parse the prediction-related information for the current block. That is, for example, the decoding device can receive and parse image information including prediction-related information for the current block through a bitstream. For example, the prediction-related information may be as shown in Table 2 described above.
[0542] For example, the prediction-related information may include a reference line index of the current block. The reference line index may indicate an intra-prediction reference line of the current block. For example, when the value of the reference line index is 0, the reference line index may indicate a reference line adjacent to an upper boundary and / or a left boundary of the current block, when the value of the reference line index is 1, the reference line index may indicate a reference line that is 1 sample away from the upper boundary and / or the left boundary of the current block, when the value of the reference line index is 2, the reference line index may indicate a reference line that is 2 samples away from the upper boundary and / or the left boundary of the current block, and when the value of the reference line index is 3, the reference line index may indicate a reference line that is 3 samples away from the upper boundary and / or the left boundary of the current block.
[0543] In addition, for example, when the reference line index points to a reference line adjacent to the current block, i.e., when the value of the reference line index is 0, the prediction-related information may include an ISP (Intra Sub-Partitions mode) flag. The ISP flag may indicate whether a third intra prediction type to which the ISP is applied is applied to the current block. That is, the ISP flag may indicate whether the ISP is applied to the current block. For example, when the value of the IPS flag is 1, the ISP flag may indicate that the third intra prediction type is applied to the current block, and when the value of the IPS flag is 0, the ISP flag may indicate that the third intra prediction type is not applied to the current block. In addition, for example, when the value of the ISP flag is 1, the prediction-related information may include an ISP segmentation flag indicating an ISP segmentation type.
[0544] Additionally, for example, the prediction-related information may include an MPM (most probable mode) flag. Or, for example, the prediction-related information may not include the MPM flag, in which case the decoding device may derive the value of the MPM flag as 1. The MPM flag may indicate whether the intra prediction mode of the current block is one of the intra prediction mode candidates of the intra prediction mode candidate list. The MPM flag may also be indicated as an intra prediction mode candidate flag.
[0545] In addition, for example, when the value of the MPM flag is 1, the prediction-related information may include an MPM index. The MPM index may point to one of the intra prediction mode candidates in the intra prediction mode candidate list. The MPM index may be signaled in the form of an mpm_idx or intra_luma_mpm_idx syntax element. The MPM index may also be indicated as an intra prediction mode candidate index.
[0546] In addition, for example, when the value of the MPM flag is 0, the prediction-related information may include remaining intra prediction mode information. The remaining intra prediction mode information may point to one of the remaining intra prediction modes other than the intra prediction mode candidates in the intra prediction mode candidate list. The remaining intra prediction mode information may be signaled in the form of a rem_intra_luma_pred_mode or intra_luma_mpm_remainder syntax element.
[0547] The decoding device derives an intra prediction type for the current block from among intra prediction types based on the prediction-related information (S2110). The decoding device may derive the intra prediction type for the current block based on the prediction-related information. Here, the intra prediction types may include a first intra prediction type that uses an intra prediction reference line adjacent to the current block, a second intra prediction type that uses an intra prediction reference line that is not adjacent to the current block, and a third intra prediction type to which an ISP (Intra Sub-Partitions mode) is applied. The first intra prediction type may represent the general intra prediction described above, the second intra prediction type may represent the MRL described above, and the third intra prediction type may represent the ISP described above.
[0548] For example, the decoding device can derive the intra prediction type for the current block based on the prediction-related information shown in Table 2 described above. For example, the decoding device can determine whether the intra prediction type for the current block is the second intra prediction type based on a reference line index of the current block. The prediction-related information can include the reference line index. The reference line index can indicate an intra prediction reference line of the current block. For example, when the value of the reference line index is 0, the reference line index may indicate a reference line adjacent to the upper boundary and / or the left boundary of the current block, when the value of the reference line index is 1, the reference line index may indicate a reference line that is 1 sample away from the upper boundary and / or the left boundary of the current block, when the value of the reference line index is 2, the reference line index may indicate a reference line that is 2 samples away from the upper boundary and / or the left boundary of the current block, and when the value of the reference line index is 3, the reference line index may indicate a reference line that is 3 samples away from the upper boundary and / or the left boundary of the current block. When the reference line index indicates a reference line adjacent to the current block, the decoding device may derive the reference line adjacent to the current block as an intra prediction reference line of the current block, and may determine that the intra prediction type for the current block is not the second intra prediction type. Additionally, if the reference line index points to a reference line that is not adjacent to the current block, the decoding device can derive the reference line that is not adjacent to the current block as an intra prediction reference line of the current block, and can derive the second intra prediction type as the intra prediction type for the current block.Here, the reference line not adjacent to the current block may be a reference line that is 1, 2, or 3 samples away from the upper boundary and / or left boundary of the current block.
[0549] In addition, when the reference line index points to a reference line adjacent to the current block, i.e., when the intra prediction type for the current block is not the second intra prediction type, the decoding device may determine whether the intra prediction type for the current block is the third intra prediction type based on an ISP (Intra Sub-Partitions mode) flag. The prediction-related information may include the ISP flag. The ISP flag may indicate whether the third intra prediction type to which the ISP is applied is applied to the current block. That is, the ISP flag may indicate whether the ISP is applied to the current block. For example, when the value of the IPS flag is 1, the ISP flag may indicate that the third intra prediction type is applied to the current block, and when the value of the IPS flag is 0, the ISP flag may indicate that the third intra prediction type is not applied to the current block. When the ISP flag indicates that the third intra prediction type is applied, the decoding device can derive the third intra prediction type as the intra prediction type for the current block, and when the ISP flag indicates that the third intra prediction type is not applied, the decoding device can derive the first intra prediction type as the intra prediction type for the current block.
[0550] The decoding device constructs a candidate list of intra prediction modes of the current block based on the intra prediction modes of surrounding blocks of the current block (S2120).
[0551] For example, the decoding device may construct the intra prediction mode candidate list of the current block by performing the intra prediction mode candidate list construction process illustrated in Table 3 described above. Meanwhile, the intra prediction mode candidate list may refer to the MPM (most probable mode) list described above.
[0552] For example, the decoding device can construct the intra prediction mode candidate list based on a first candidate intra prediction mode and a second candidate intra prediction mode. The decoding device can construct the intra prediction mode candidate list based on whether the first candidate intra prediction mode and the second candidate intra prediction mode are the same and / or whether a mode number of the first candidate intra prediction mode and / or a mode number of the second candidate intra prediction mode is greater than a DC intra prediction mode. Here, the first candidate intra prediction mode can be derived based on an intra prediction mode of a left neighboring block of the current block, and the second candidate intra prediction mode can be derived based on an intra prediction mode of an upper neighboring block of the current block. For example, an intra prediction mode of a left neighboring block of the current block can be derived as the first candidate intra prediction mode, and an intra prediction mode of an upper neighboring block of the current block can be derived as the second candidate intra prediction mode.
[0553] Specifically, for example, when the first candidate intra prediction mode and the second candidate intra prediction mode are the same, the decoding device can determine whether the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, and when the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, the decoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0554] - mpm[0] = leftIntraDir
[0555] - mpm[1] = PLANAR_IDX
[0556] - mpm[2] = DC_IDX
[0557] - mpm[3] = ((leftIntraDir + offset) % mod) + 2
[0558] - mpm[4] = ((leftIntraDir - 1) % mod) + 2
[0559] - mpm[5] = ((leftIntraDir + offset - 1) % mod) + 2
[0560] Here, mpm[0], mpm[1], mpm[2], mpm[3], mpm[4], mpm[5] represent intra prediction mode candidate 0, intra prediction mode candidate 1, intra prediction mode candidate 2, intra prediction mode candidate 3, intra prediction mode candidate 4, and intra prediction mode candidate 5, leftIntraDir represents the first candidate intra prediction mode, PLANAR_IDX represents the planar intra prediction mode, and DC_IDX represents the DC intra prediction mode.That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as the DC intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as the intra prediction mode whose mode number is ((leftIntraDir + offset) % mod) + 2, that is, the intra prediction mode whose mode number is the value obtained by adding an offset to the mode number of the first candidate intra prediction mode modulo arithmetic operation and adding 2, and intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as the intra prediction mode whose mode number is ((leftIntraDir - 1) % mod) + 2, that is, the value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode modulo arithmetic operation. An intra prediction mode having a mode number obtained by performing a modular arithmetic operation and adding 2 can be derived, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode having a mode number of ((leftIntraDir + offset - 1) % mod) + 2, that is, an intra prediction mode having a mode number obtained by performing a modular arithmetic operation on a mode number obtained by adding an offset of -1 to the mode number of the first candidate intra prediction mode and adding 2 to it.
[0561] Alternatively, for example, if the first candidate intra prediction mode and the second candidate intra prediction mode are not the same, the decoding device may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as described below.
[0562] - mpm[0] = leftIntraDir
[0563] - mpm[1] = aboveIntraDir
[0564] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as the second candidate intra prediction mode. In addition, the decoding device can derive maxCandModeIdx as 0 if the mode number of the intra prediction mode candidate 0 is greater than the mode number of the intra prediction mode candidate 1, and can derive maxCandModeIdx as 1 if the mode number of the intra prediction mode candidate 0 is not greater than the mode number of the intra prediction mode candidate 1.
[0565] Thereafter, if the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode are greater than the mode number of the DC intra prediction mode, the decoding device can derive intra prediction mode candidate 2 and intra prediction mode candidate 3 as described below.
[0566] - mpm[2] = PLANAR_IDX
[0567] - mpm[3] = DC_IDX
[0568] That is, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a DC intra prediction mode.
[0569] Afterwards, if the value obtained by subtracting the mode number of mpm[!maxCandModeIdx] from the mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the decoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0570] - mpm[4] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0571] - mpm[5] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0572] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as the value obtained by adding offset to mpm[maxCandModeIdx] and adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as the value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2.
[0573] Alternatively, if the value obtained by subtracting the mode number of mpm[!maxCandModeIdx] from the mode number of mpm[maxCandModeIdx] is 63 or greater or 1 or less, the decoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0574] - mpm[4] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0575] - mpm[5] = ((mpm[maxCandModeIdx]) % mod) + 2
[0576] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding offset -1 to mpm[maxCandModeIdx] and performing modular arithmetic with mod and adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx]) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by performing modular arithmetic with mod on mpm[maxCandModeIdx] and adding 2.
[0577] Alternatively, if at least one of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is not greater than the mode number of the DC intra prediction mode, the decoding device may determine whether the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or greater. If the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or greater, the decoding device may derive intra prediction mode candidate 2 to intra prediction mode candidate 5 as described below.
[0578] - mpm[2] = (mpm[!maxCandModeIdx] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0579] - mpm[3] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0580] - mpm[4] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0581] - mpm[5] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0582] That is, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a DC intra prediction mode if the mpm[!maxCandModeIdx] is a planar intra prediction mode, and can be derived as a planar intra prediction mode if the mpm[!maxCandModeIdx] is not a planar intra prediction mode. In addition, the intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to the mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and the intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from the mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and the intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + A 2-person intra prediction mode can be derived, that is, an intra prediction mode having a mode number obtained by performing a modular arithmetic operation on the value obtained by adding an offset of -1 to the above mpm[maxCandModeIdx] and adding 2.
[0583] Alternatively, if the conditions described above are not met, the decoding device may derive intra prediction mode candidate 0 to intra prediction mode candidate 5 as described below.
[0584] - mpm[0] = leftIntraDir
[0585] - mpm[1] = (mpm[0] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0586] - mpm[2] = VER_IDX
[0587] - mpm[3] = HOR_IDX
[0588] - mpm[4] = VER_IDX - 4
[0589] - mpm[5] = VER_IDX + 4
[0590] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a DC intra prediction mode if the intra prediction mode candidate 0 is a planar intra prediction mode, and can be derived as a planar intra prediction mode if the intra prediction mode candidate 0 is not a planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a vertical intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a horizontal intra prediction mode, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, i.e., an intra prediction mode number 46, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, That is, it can be derived as 54 intra prediction modes.
[0591] Alternatively, as an example, the decoding device may construct the intra prediction mode candidate list of the current block by performing the intra prediction mode candidate list construction process shown in Table 4 described above.
[0592] For example, the decoding device can construct the intra prediction mode candidate list based on a first candidate intra prediction mode and a second candidate intra prediction mode. The decoding device can construct the intra prediction mode candidate list based on whether the first candidate intra prediction mode and the second candidate intra prediction mode are the same and / or whether a mode number of the first candidate intra prediction mode and / or a mode number of the second candidate intra prediction mode is greater than a DC intra prediction mode. Here, the first candidate intra prediction mode can be derived based on an intra prediction mode of a left neighboring block of the current block, and the second candidate intra prediction mode can be derived based on an intra prediction mode of an upper neighboring block of the current block. For example, an intra prediction mode of a left neighboring block of the current block can be derived as the first candidate intra prediction mode, and an intra prediction mode of an upper neighboring block of the current block can be derived as the second candidate intra prediction mode.
[0593] Specifically, for example, when the first candidate intra prediction mode and the second candidate intra prediction mode are the same, the decoding device can determine whether the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, and when the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, the decoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0594] - mpm[0] = leftIntraDir
[0595] - mpm[1] = PLANAR_IDX
[0596] - mpm[2] = ((leftIntraDir + offset) % mod) + 2
[0597] - mpm[3] = ((leftIntraDir - 1) % mod) + 2
[0598] - mpm[4] = DC_IDX
[0599] - mpm[5] = ((leftIntraDir + offset - 1) % mod) + 2
[0600] Here, mpm[0], mpm[1], mpm[2], mpm[3], mpm[4], mpm[5] represent intra prediction mode candidate 0, intra prediction mode candidate 1, intra prediction mode candidate 2, intra prediction mode candidate 3, intra prediction mode candidate 4, and intra prediction mode candidate 5, leftIntraDir represents the first candidate intra prediction mode, PLANAR_IDX represents the planar intra prediction mode, and DC_IDX represents the DC intra prediction mode.That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((leftIntraDir + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to the mode number of the first candidate intra prediction mode, modulo arithmetic operation, and adding 2, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((leftIntraDir - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode, modulo arithmetic operation, and adding 2, and Intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as a DC intra prediction mode, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((leftIntraDir + offset - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by performing a modular arithmetic operation on the mode number of the first candidate intra prediction mode plus an offset of -1 and then adding 2 to it.
[0601] Alternatively, for example, if the first candidate intra prediction mode and the second candidate intra prediction mode are not the same, the decoding device may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as described below.
[0602] - mpm[0] = leftIntraDir
[0603] - mpm[1] = aboveIntraDir
[0604] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as the second candidate intra prediction mode. In addition, the decoding device can derive maxCandModeIdx as 0 if the mode number of the intra prediction mode candidate 0 is greater than the mode number of the intra prediction mode candidate 1, and can derive maxCandModeIdx as 1 if the mode number of the intra prediction mode candidate 0 is not greater than the mode number of the intra prediction mode candidate 1.
[0605] Thereafter, if the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode are greater than the mode number of the DC intra prediction mode, the decoding device can derive intra prediction mode candidate 1 to intra prediction mode candidate 3 as described below.
[0606] - mpm[1] = PLANAR_IDX
[0607] - mpm[2] = aboveIntraDir
[0608] - maxCandModeIdx = mpm[0] > mpm[2] ? 0:2
[0609] - int minCandModeidx = mpm[0] > mpm[2] ? 2 : 0
[0610] - mpm[3] = DC_IDX;
[0611] That is, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a second candidate intra prediction mode, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a DC intra prediction mode. In addition, the decoding device can derive maxCandModeIdx as 0 if the mode number of the intra prediction mode candidate 0 is greater than the mode number of the intra prediction mode candidate 2, and can derive maxCandModeIdx as 2 if the mode number of the intra prediction mode candidate 0 is not greater than the mode number of the intra prediction mode candidate 2. Additionally, the decoding device can derive minCandModeidx as 2 if the mode number of the intra prediction mode candidate 0 is greater than the mode number of the intra prediction mode candidate 2, and can derive minCandModeidx as 0 if the mode number of the intra prediction mode candidate 0 is not greater than the mode number of the intra prediction mode candidate 2.
[0612] Afterwards, if the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the decoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0613] - mpm[4] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0614] - mpm[5] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0615] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as the value obtained by adding offset to mpm[maxCandModeIdx] and adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as the value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2.
[0616] Alternatively, if the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is 63 or greater or 1 or less, the decoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0617] - mpm[4] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0618] - mpm[5] = ((mpm[maxCandModeIdx]) % mod) + 2
[0619] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding offset -1 to mpm[maxCandModeIdx] and performing modular arithmetic with mod and adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx]) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by performing modular arithmetic with mod on mpm[maxCandModeIdx] and adding 2.
[0620] Alternatively, if at least one of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is not greater than the mode number of the DC intra prediction mode, the decoding device may determine whether the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or greater. If the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or greater, the decoding device may determine whether at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is a planar intra prediction mode.
[0621] If at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is a planar intra prediction mode, the decoding device can derive intra prediction mode candidate 0 to intra prediction mode candidate 1 as described below.
[0622] - mpm[0] = PLANAR_IDX
[0623] - mpm[1] = (leftIntraDir < aboveIntraDir) ? aboveIntraDir : leftIntraDir
[0624] - maxCandModeIdx = 1
[0625] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode with a mode number, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a second candidate intra prediction mode if the mode number of the first candidate intra prediction mode is smaller than the mode number of the second candidate intra prediction mode, and can be derived as a first candidate intra prediction mode if the mode number of the first candidate intra prediction mode is greater than or equal to the mode number of the second candidate intra prediction mode. In addition, the decoding device can derive maxCandModeIdx as 1.
[0626] If the first candidate intra prediction mode and the second candidate intra prediction mode are not planar intra prediction modes, the decoding device can derive intra prediction mode candidate 2 to intra prediction mode candidate 5 as described below.
[0627] - mpm[2] = (mpm[!maxCandModeIdx] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0628] - mpm[3] = ((mpm[maxCandModeIdx] + offset) % mod) + 2
[0629] - mpm[4] = ((mpm[maxCandModeIdx] - 1) % mod) + 2
[0630] - mpm[5] = ((mpm[maxCandModeIdx] + offset - 1) % mod) + 2
[0631] That is, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a DC intra prediction mode if the mpm[!maxCandModeIdx] is a planar intra prediction mode, and can be derived as a planar intra prediction mode if the mpm[!maxCandModeIdx] is not a planar intra prediction mode. In addition, the intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by adding an offset to the mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and the intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is a value obtained by subtracting 1 from the mpm[maxCandModeIdx] and performing a modular arithmetic operation with mod and adding 2, and the intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((mpm[maxCandModeIdx] + offset - 1) % mod) + A 2-person intra prediction mode can be derived, that is, an intra prediction mode having a mode number obtained by performing a modular arithmetic operation on the value obtained by adding an offset of -1 to the above mpm[maxCandModeIdx] and adding 2.
[0632] Alternatively, if the conditions described above are not met, the decoding device may derive intra prediction mode candidate 0 to intra prediction mode candidate 5 as described below.
[0633] - mpm[0] = leftIntraDir
[0634] - mpm[1] = (mpm[0] == PLANAR_IDX) ? DC_IDX : PLANAR_IDX
[0635] - mpm[2] = VER_IDX
[0636] - mpm[3] = HOR_IDX
[0637] - mpm[4] = VER_IDX - 4
[0638] - mpm[5] = VER_IDX + 4
[0639] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a DC intra prediction mode if the intra prediction mode candidate 0 is a planar intra prediction mode, and can be derived as a planar intra prediction mode if the intra prediction mode candidate 0 is not a planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a vertical intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a horizontal intra prediction mode, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, i.e., an intra prediction mode number 46, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode of a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, That is, it can be derived as 54 intra prediction modes.
[0640] Alternatively, as an example, the decoding device may construct the intra prediction mode candidate list of the current block by performing the intra prediction mode candidate list construction process illustrated in Table 5 described above.
[0641] For example, the decoding device can construct the intra prediction mode candidate list based on a first candidate intra prediction mode and a second candidate intra prediction mode. The decoding device can construct the intra prediction mode candidate list based on whether the first candidate intra prediction mode and the second candidate intra prediction mode are the same and / or whether a mode number of the first candidate intra prediction mode and / or a mode number of the second candidate intra prediction mode is greater than a DC intra prediction mode. Here, the first candidate intra prediction mode can be derived based on an intra prediction mode of a left neighboring block of the current block, and the second candidate intra prediction mode can be derived based on an intra prediction mode of an upper neighboring block of the current block. For example, an intra prediction mode of a left neighboring block of the current block can be derived as the first candidate intra prediction mode, and an intra prediction mode of an upper neighboring block of the current block can be derived as the second candidate intra prediction mode.
[0642] Specifically, for example, when the first candidate intra prediction mode and the second candidate intra prediction mode are the same, the decoding device can determine whether the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, and when the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, the decoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0643] - mpm[0] = g_intraMode65to33AngMapping[leftIntraDir]
[0644] - mpm[1] = ((g_intraMode65to33AngMapping[leftIntraDir] + offset) % mod) + 2
[0645] - mpm[2] = ((g_intraMode65to33AngMapping[leftIntraDir] - 1) % mod) + 2
[0646] That is, intra prediction mode candidate 0 of the above intra prediction mode candidate list can be derived as the first candidate intra prediction mode. In addition, the intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((g_intraMode65to33AngMapping[leftIntraDir] + offset) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as a value obtained by adding an offset to the mode number of the first candidate intra prediction mode and adding 2 to it, and the intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is ((g_intraMode65to33AngMapping[leftIntraDir] - 1) % mod) + 2, that is, an intra prediction mode whose mode number is obtained by performing a modular arithmetic operation with mod as a value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode and adding 2 to it.
[0647] Alternatively, if the mode number of the first candidate intra prediction mode is not greater than the mode number of the DC intra prediction mode, the decoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0648] - mpm[0] = g_intraMode65to33AngMapping[PLANAR_IDX]
[0649] - mpm[1] = g_intraMode65to33AngMapping[DC_IDX]
[0650] - mpm[2] = g_intraMode65to33AngMapping[VER_IDX]
[0651] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a DC intra prediction mode, and intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a vertical intra prediction mode.
[0652] Alternatively, if the first candidate intra prediction mode and the second candidate intra prediction mode are not the same, the decoding device can derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as described below.
[0653] - mpm[0] = g_intraMode65to33AngMapping[leftIntraDir]
[0654] - mpm[1] = g_intraMode65to33AngMapping[aboveIntraDir]
[0655] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as a second candidate intra prediction mode.
[0656] Thereafter, if both the first candidate intra prediction mode and the second candidate intra prediction mode are planar intra prediction modes, the decoding device can derive intra prediction mode candidate 2 as described below.
[0657] - mpm[2] = g_intraMode65to33AngMapping[PLANAR_IDX]
[0658] That is, intra prediction mode candidate 2 of the above intra prediction mode candidate list can be derived as a planar intra prediction mode.
[0659] Alternatively, if at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is a planar intra prediction mode, the decoding device can derive intra prediction mode candidate 2 as described below.
[0660] - mpm[2] = g_intraMode65to33AngMapping[(leftIntraDir + aboveIntraDir) < 2 ? VER_IDX : DC_IDX]
[0661] That is, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a vertical intra prediction mode if the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is less than 2, and as a DC intra prediction mode if the sum of the mode number of the first candidate intra prediction mode and the mode number of the second candidate intra prediction mode is 2 or more.
[0662] Alternatively, as an example, the decoding device may construct the intra prediction mode candidate list of the current block based on the intra prediction modes of the surrounding blocks of the current block, as illustrated in Table 6 described above. Meanwhile, the intra prediction mode candidate list may refer to the most probable mode (MPM) list described above.
[0663] For example, the decoding device may construct the intra-prediction mode candidate list based on the intra-prediction mode of the left neighboring block of the current block and the intra-prediction mode of the upper neighboring block of the current block. The decoding device may determine whether the intra-prediction mode of the left neighboring block of the current block and the intra-prediction mode of the upper neighboring block are the same and the mode number of the intra-prediction mode of the left neighboring block is greater than the mode number of the DC intra-prediction mode. The decoding device may construct the intra-prediction mode candidate list based on whether the intra-prediction mode of the left neighboring block of the current block and the intra-prediction mode of the upper neighboring block are the same and / or whether the mode number of the intra-prediction mode of the left neighboring block is greater than the mode number of the DC intra-prediction mode.
[0664] If the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are the same, and the mode number of the intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode, the decoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0665] - mpm[0] = INTRA_PLANAR
[0666] - mpm[1] = candIntraPredModeA
[0667] - mpm[2] = 2 + ((candIntraPredModeA + 61) % 64)
[0668] - mpm[3] = 2 + ((candIntraPredModeA - 1) % 64)
[0669] - mpm[4] = INTRA_DC
[0670] - mpm[5] = 2 + ((candIntraPredModeA + 60) % 64)
[0671] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as an intra prediction mode of a left peripheral block, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 61) % 64), that is, an intra prediction mode whose mode number is a value obtained by adding 61 to the mode number of the intra prediction mode of the left peripheral block, performing a modular arithmetic operation on 64, and adding 2, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((candIntraPredModeA - 1) % 64), that is, a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left peripheral block, performing a modular arithmetic operation on 64, and adding 2. The intra prediction mode can be derived as a mode number, and the intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as a DC intra prediction mode, and the intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 60) % 64), that is, the intra prediction mode whose mode number is a value obtained by adding 60 to the mode number of the intra prediction mode of the left peripheral block, performing a modular arithmetic operation on 64, and adding 2 to it.That is, for example, if the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block are the same, and the mode number of the intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode, the intra prediction mode candidate list may include the intra prediction mode of the left neighboring block, the intra prediction mode of the upper neighboring block, the intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 61) % 64), the intra prediction mode whose mode number is 2 + ((candIntraPredModeA - 1) % 64), and the intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 60) % 64) as intra prediction mode candidates. Here, candIntraPredModeA may represent the mode number of the intra prediction mode of the left neighboring block of the current block.
[0672] Meanwhile, if the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are not the same, for example, the decoding device can determine whether at least one of the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block is greater than the mode number of the DC intra prediction mode. If at least one of the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block is greater than the mode number of the DC intra prediction mode, variables minAB and maxAB can be derived as follows.
[0673] - minAB = Min(candIntraPredModeA, candIntraPredModeB)
[0674] - maxAB = Max(candIntraPredModeA, candIntraPredModeB)
[0675] Here, candIntraPredModeA may represent a mode number of an intra prediction mode of the left neighboring block of the current block, and candIntraPredModeB may represent a mode number of an intra prediction mode of the upper neighboring block of the current block. That is, minAB may represent a smaller value between the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block, and maxAB may represent a larger value between the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block.
[0676] In addition, when the intra prediction mode of the left peripheral block of the current block and the intra prediction mode of the upper peripheral block are not the same, the decoding device can determine whether the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode and whether the mode number of the intra prediction mode of the upper peripheral block is greater than the mode number of the DC intra prediction mode.
[0677] For example, if the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode, and the mode number of the intra prediction mode of the upper peripheral block is greater than the mode number of the DC intra prediction mode, the decoding device can derive intra prediction mode candidate 0 to intra prediction mode candidate 3 as described below.
[0678] mpm[0] = INTRA_PLANAR
[0679] mpm[1] = candIntraPredModeA
[0680] mpm[2] = candIntraPredModeB
[0681] mpm[3] = INTRA_DC
[0682] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list can be derived as an intra prediction mode of a left neighboring block, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as an intra prediction mode of an upper neighboring block, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as a DC intra prediction mode. Here, candIntraPredModeB can represent a mode number of an intra prediction mode of the upper neighboring block of the current block. That is, for example, if the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are not the same, and the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block are greater than the mode number of the DC intra prediction mode, the intra prediction mode candidate list may include the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block as intra prediction mode candidates.
[0683] Thereafter, the remaining intra prediction mode candidates (intra prediction mode candidate 4 and intra prediction mode candidate 5) can be derived based on the maxAB and the minAB. Specifically, the remaining intra prediction mode candidates can be derived based on the difference between a larger value and a smaller value among the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block.
[0684] For example, if the value obtained by subtracting the minAB from the maxAB is less than 63 and greater than 1 (i.e., if the value obtained by subtracting the minAB from the maxAB is one of 2 to 62), the decoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0685] - mpm[4] = 2 + ((maxAB + 61) % 64)
[0686] - mpm[5] = 2 + ((maxAB - 1) % 64)
[0687] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB + 61) % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on 64 obtained by adding 61 to maxAB and then adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB - 1) % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on 64 obtained by subtracting 1 from maxAB and then adding 2. Here, maxAB can represent a larger value between the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block.
[0688] Alternatively, if the value obtained by subtracting the minAB from the maxAB is 63 or more or 1 or less, the decoding device can derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
[0689] - mpm[4] = 2 + ((maxAB + 60) % 64)
[0690] - mpm[5] = 2 + (maxAB % 64)
[0691] That is, intra prediction mode candidate 4 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB + 60) % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on maxAB plus 60 to 64 and then adding 2, and intra prediction mode candidate 5 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + (maxAB % 64), that is, an intra prediction mode whose mode number is obtained by modular arithmetic operation on maxAB plus 64 and then adding 2. Here, maxAB can represent a larger value between the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block.
[0692] Meanwhile, if the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the upper neighboring block are not the same or at least one of the mode numbers of the intra prediction mode of the left neighboring block and the intra prediction mode of the upper neighboring block is smaller than the mode number of the DC intra prediction mode, the decoding device can determine whether the sum of the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the upper neighboring block is greater than or equal to the mode number of the DC intra prediction mode.
[0693] For example, if the sum of the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block is greater than or equal to the mode number of the DC intra prediction mode, the decoding device can derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
[0694] - mpm[0] = INTRA_PLANAR
[0695] - mpm[1] = maxAB
[0696] - mpm[2] = INTRA_DC
[0697] - mpm[3] = 2 + ((maxAB + 61) % 64)
[0698] - mpm[4] = 2 + ((maxAB - 1) % 64)
[0699] - mpm[5] = 2 + ((maxAB + 60) % 64)
[0700] That is, intra prediction mode candidate 0 of the intra prediction mode candidate list can be derived as a planar intra prediction mode, intra prediction mode candidate 1 can be derived as maxAB, that is, intra prediction mode candidate 1 can be derived as an intra prediction mode of the upper peripheral block if the mode number of the intra prediction mode of the left peripheral block is smaller than the mode number of the intra prediction mode of the upper peripheral block, and as an intra prediction mode of the left peripheral block if the mode number of the intra prediction mode of the left peripheral block is greater than or equal to the mode number of the intra prediction mode of the upper peripheral block, intra prediction mode candidate 2 of the intra prediction mode candidate list can be derived as a DC intra prediction mode, and intra prediction mode candidate 3 of the intra prediction mode candidate list can be derived as an intra prediction mode whose mode number is 2 + ((maxAB + 61) % 64), that is, an intra prediction mode whose mode number is 2 + ((maxAB + 61) % 64), that is, an intra prediction mode whose mode number is obtained by performin...
Claims
1. In a video decoding method performed by a decoding device, A step of receiving prediction-related information for the current block; A step of deriving an intra prediction type for the current block among intra prediction types based on the above prediction-related information; A step of constructing a candidate list of intra prediction modes of the current block based on intra prediction modes of surrounding blocks of the current block; A step of deriving an intra prediction mode of the current block based on the intra prediction mode candidate list; A step of deriving reference samples of the current block based on the intra prediction type and the intra prediction mode; and A step of generating a prediction sample of the current block based on the above reference samples, The above intra prediction types include a first intra prediction type that uses an intra prediction reference line adjacent to the current block, a second intra prediction type that uses an intra prediction reference line that is not adjacent to the current block, and a third intra prediction type to which an ISP (Intra Sub-Partitions mode) is applied. A video decoding method, characterized in that the intra prediction mode candidate list configured when the intra prediction type is the first intra prediction type, the intra prediction mode candidate list configured when the intra prediction type is the second intra prediction type, and the intra prediction mode candidate list configured when the intra prediction type is the third intra prediction type are the same.
2. In paragraph 1, When the intra prediction mode of the current block is derived as a DC intra prediction mode, and the current block is a square block, the size of the current block is WxH, and the x component and the y component of the upper left position of the current block are 0, a DC value is derived based on a reference sample at coordinates (0, -refIdx-1) to (W-1, -refIdx-1) within an intra prediction reference line indicated by a reference line index of the current block, and a reference sample at coordinates (-refIdx-1, 0) to (-refIdx-1, H-1) within the intra prediction reference line, and the prediction sample is derived as the DC value, An image decoding method, characterized in that the above refIdx is a value of the reference line index, and the prediction-related information includes the reference line index.
3. In paragraph 1, When the intra prediction mode of the current block is derived as a DC intra prediction mode, and the current block is a non-square block with a width greater than a height, and the size of the current block is WxH, and the x component and the y component of the upper left position of the current block are 0, a DC value is derived based on a reference sample at coordinates (0, -refIdx-1) to a reference sample at coordinates (W-1, -refIdx-1) within an intra prediction reference line indicated by a reference line index of the current block, and the prediction sample is derived as the DC value, An image decoding method, characterized in that the above refIdx is a value of the reference line index, and the prediction-related information includes the reference line index.
4. In paragraph 1, When the intra prediction mode of the current block is derived as a DC intra prediction mode, and the current block is a non-square block with a height greater than a width, and the size of the current block is WxH, and the x component and the y component of the upper left position of the current block are 0, a DC value is derived based on a reference sample at coordinates (-refIdx-1, 0) or a reference sample at coordinates (-refIdx-1, H-1) within an intra prediction reference line indicated by a reference line index of the current block, and the prediction sample is derived as the DC value, An image decoding method, characterized in that the above refIdx is a value of the reference line index, and the prediction-related information includes the reference line index.
5. In paragraph 1, When the intra prediction mode of the current block is derived as a planar intra prediction mode, the size of the current block is WxH, and the x component and y component of the upper left position of the current block are 0, the prediction sample is derived based on a reference sample at coordinates (W-1, -refIdx-1) and a reference sample at coordinates (-refIdx-1, H-1) within the intra prediction reference line indicated by the reference line index of the current block, An image decoding method, characterized in that the above refIdx is a value of the reference line index, and the prediction-related information includes the reference line index.
6. In paragraph 1, An image decoding method, characterized in that the above-mentioned surrounding blocks include a left-side surrounding block and an upper-side surrounding block of the current block.
7. In paragraph 6, If the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are the same, and the mode number of the intra prediction mode of the left peripheral block is greater than the mode number of the DC intra prediction mode, the intra prediction mode candidate list includes the intra prediction mode of the left peripheral block, the intra prediction mode of the upper peripheral block, the intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 61) % 64), the intra prediction mode whose mode number is 2 + ((candIntraPredModeA - 1) % 64), and the intra prediction mode whose mode number is 2 + ((candIntraPredModeA + 60) % 64) as intra prediction mode candidates, Here, candIntraPredModeA is an image decoding method characterized in that it represents the mode number of the intra prediction mode of the left peripheral block.
8. In paragraph 7, If the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block are not the same, and the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block are greater than the mode number of the DC intra prediction mode, the intra prediction mode candidate list includes the intra prediction mode of the left peripheral block and the intra prediction mode of the upper peripheral block as intra prediction mode candidates, A video decoding method, characterized in that the remaining intra prediction mode candidates in the intra prediction mode candidate list are derived based on the difference between a larger value and a smaller value among the mode number of the intra prediction mode of the left peripheral block and the mode number of the intra prediction mode of the upper peripheral block.
9. In paragraph 1, The step of deriving the intra prediction type for the current block among the intra prediction types based on the above prediction-related information is: A step of determining whether the intra prediction type for the current block is the second intra prediction type based on the reference line index of the current block, The above prediction-related information includes the above reference line index, A video decoding method, characterized in that when the reference line index points to a reference line that is not adjacent to the current block, the reference line that is not adjacent to the current block is derived as an intra prediction reference line of the current block, and the second intra prediction type is derived as the intra prediction type for the current block.
10. In paragraph 9, The step of deriving the intra prediction type for the current block among the intra prediction types based on the above prediction-related information is: If the intra prediction type for the current block is not the second intra prediction type, the method further includes a step of determining whether the intra prediction type for the current block is the third intra prediction type based on an ISP (Intra Sub-Partitions mode) flag, The above prediction related information includes the ISP flag, If the ISP flag indicates that the third intra prediction type is applied, the third intra prediction type is derived as the intra prediction type for the current block, A video decoding method, characterized in that when the ISP flag indicates that the third intra prediction type is not applied, the first intra prediction type is derived as the intra prediction type for the current block.
11. In paragraph 7, An image decoding method, characterized in that when intra prediction is not applied to the left peripheral block and the value of the CIIP (Combined Inter and Intra Prediction, CIIP) flag of the left peripheral block is not 1, the intra prediction mode of the left peripheral block is derived as a planar intra prediction mode.
12. In paragraph 1, If the intra prediction type for the current block is derived as the second intra prediction type, the intra prediction mode of the current block is derived as one of the intra prediction modes other than the planar intra prediction mode and the DC intra prediction mode, An image decoding method, characterized in that when the intra prediction type for the current block is derived as the third intra prediction type, the intra prediction mode of the current block is derived as one of the intra prediction modes other than the DC intra prediction mode.
13. In paragraph 1, An image decoding method, characterized in that when the intra prediction type for the current block is derived as the second intra prediction type, the intra prediction mode of the current block is derived as one of the intra prediction modes other than the planar intra prediction mode.
14. In paragraph 13, An image decoding method, characterized in that when the intra prediction type for the current block is derived as the third intra prediction type, the intra prediction mode of the current block is derived as one of the intra prediction modes other than the DC intra prediction mode.
15. In a video encoding method performed by an encoding device, A step of determining an intra prediction type for the current block among intra prediction types; A step of constructing a candidate list of intra prediction modes of the current block based on intra prediction modes of surrounding blocks of the current block; A step of deriving an intra prediction mode of the current block based on the intra prediction mode candidate list; A step of deriving reference samples of the current block based on the intra prediction type and the intra prediction mode; A step of generating a prediction sample of the current block based on the above reference samples; and comprising a step of encoding image information including prediction-related information for the current block; The above intra prediction types include a first intra prediction type that uses an intra prediction reference line adjacent to the current block, a second intra prediction type that uses an intra prediction reference line that is not adjacent to the current block, and a third intra prediction type to which an ISP (Intra Sub-Partitions mode) is applied. A video encoding method, characterized in that the intra prediction mode candidate list configured when the intra prediction type is the first intra prediction type, the intra prediction mode candidate list configured when the intra prediction type is the second intra prediction type, and the intra prediction mode candidate list configured when the intra prediction type is the third intra prediction type are the same.
16. A computer-readable digital storage medium storing a bitstream containing image information that causes a decoding device to perform an image decoding method, wherein the image decoding method comprises: A step of obtaining prediction-related information for the current block; A step of deriving an intra prediction type for the current block among intra prediction types based on the above prediction-related information; A step of constructing a candidate list of intra prediction modes of the current block based on intra prediction modes of surrounding blocks of the current block; A step of deriving an intra prediction mode of the current block based on the intra prediction mode candidate list; A step of deriving reference samples of the current block based on the intra prediction type and the intra prediction mode; and A step of generating a prediction sample of the current block based on the above reference samples, The above intra prediction types include a first intra prediction type that uses an intra prediction reference line adjacent to the current block, a second intra prediction type that uses an intra prediction reference line that is not adjacent to the current block, and a third intra prediction type to which an ISP (Intra Sub-Partitions mode) is applied. A computer-readable digital storage medium, characterized in that the intra prediction mode candidate list configured when the intra prediction type is the first intra prediction type, the intra prediction mode candidate list configured when the intra prediction type is the second intra prediction type, and the intra prediction mode candidate list configured when the intra prediction type is the third intra prediction type are the same.