The present disclosure relates to an image coding technique and, more specifically, to an image decoding method and apparatus for performing intra prediction by deriving an intra prediction mode candidate list from a plurality of intra prediction types in an image coding system.
Recently, demand for high-resolution, high-quality images, such as High Definition (HD) images and Ultra High Definition (UHD) images, has been increasing in various fields. As the image data has high resolution and high quality, the amount of information or bits to be transmitted increases relative to the legacy image data. Therefore, when image data is transmitted using a medium such as a conventional wired/wireless broadband line or image data is stored using an existing storage medium, the transmission cost and the storage cost thereof are increased.
Accordingly, there is a need for a highly efficient image compression technique for effectively transmitting, storing, and reproducing information of high-resolution and high-quality images.
An object of the present disclosure is to provide a method and apparatus for improving image coding efficiency.
Another object of the present disclosure is to provide a method and apparatus for improving efficiency of intra prediction.
Further another object of the present disclosure is to provide a method and apparatus for applying the same construction process to intra prediction types in constructing an intra prediction mode candidate list for deriving an intra prediction mode.
Further another object of the present disclosure is to provide a method and apparatus for deriving a reference sample used in a DC intra prediction mode in consideration of a reference line index.
According to an embodiment of the present disclosure, an image decoding method performed by a decoding apparatus is provided. The method includes receiving prediction related information for a current block, deriving an intra prediction type for the current block based on the prediction related information, constructing an intra prediction mode candidate list of the current block based on intra prediction modes of neighboring blocks of the current block, deriving an intra prediction mode of 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 generating a prediction sample based on the reference samples.
According to another embodiment of the present disclosure, a decoding apparatus performing image decoding is provided. The decoding apparatus includes an entropy decoder configured to receive prediction related information for a current block and a predictor configured to derive an intra prediction type for the current block among intra prediction types based on the prediction related information, to construct an intra prediction mode candidate list of the current block based on intra prediction modes of neighboring blocks of the current block, to derive an intra prediction mode of the current block based on the intra prediction mode candidate list, to derive reference samples of the current block based on the intra prediction type and the intra prediction mode, to generate a prediction sample based on the reference samples.
According to another embodiment of the present disclosure, an image encoding method performed by an encoding apparatus is provided. The method includes determining an intra prediction type for a current block among intra prediction types, constructing an intra prediction mode candidate list of the current block based on intra prediction modes of neighboring blocks of the current block, deriving an intra prediction mode of 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, generating a prediction sample based on the reference samples and encoding image information including prediction related information for the current block.
According to another embodiment of the present disclosure, an image encoding apparatus is provided. The encoding apparatus includes a predictor configured to determine an intra prediction type for a current block among intra prediction types, to construct an intra prediction mode candidate list of the current block based on intra prediction modes of neighboring blocks of the current block, to derive an intra prediction mode of the current block based on the intra prediction mode candidate list, to derive reference samples of the current block based on the intra prediction type and the intra prediction mode, to generate a prediction sample based on the reference samples, and an entropy encoder configured to encode image information including prediction related information for the current block.
According to the present disclosure, it is possible to improve overall image/video compression efficiency.
According to the present disclosure, it is possible to reduce hardware and software implementation complexity using a unified intra prediction mode list construction process for intra prediction types.
According to the present disclosure, it is possible to improve intra-prediction coding efficiency by reducing dependency on intra prediction types using a unified intra prediction mode list construction process for intra prediction types.
According to the present disclosure, it is possible to improve the coding efficiency of intra prediction by deriving a reference sample used when MRL is applied and the intra prediction mode is derived as the DC intra prediction mode based on the reference picture index.
According to the present disclosure, it is possible to improve the coding efficiency of intra prediction by deriving a reference sample used when MRL is applied and the intra prediction mode is derived as the DC intra prediction mode based on the reference picture index and a shape of the current block.
According to the present disclosure, it is possible to improve the coding efficiency of intra prediction by deriving a reference sample used when MRL is applied and the intra prediction mode is derived as the planar intra prediction mode based on the reference picture index.
The present disclosure may be modified in various forms, and specific embodiments thereof will be described and illustrated in the drawings. However, the embodiments are not intended for limiting the disclosure. The terms used in the following description are used to merely describe specific embodiments but are not intended to limit the disclosure. An expression of a singular number includes an expression of the plural number, so long as it is clearly read differently. The terms such as “include” and “have” are intended to indicate that features, numbers, steps, operations, elements, components, or combinations thereof used in the following description exist and it should be thus understood that the possibility of existence or addition of one or more different features, numbers, steps, operations, elements, components, or combinations thereof is not excluded.
Meanwhile, elements in the drawings described in the disclosure are independently drawn for the purpose of convenience for explanation of different specific functions, and do not mean that the elements are embodied by independent hardware or independent software. For example, two or more elements of the elements may be combined to form a single element, or one element may be partitioned into plural elements. The embodiments in which the elements are combined and/or partitioned belong to the disclosure.
Present disclosure relates to video/image coding. For example, the methods/embodiments disclosed in the present disclosure may be applied to a method disclosed in the versatile video coding (VVC). Also, the methods/embodiments disclosed in the present disclosure may be applied to a method disclosed in the EVC (essential video coding) standard, the AOMedia Video 1 (AV1) standard, the 2nd generation of audio video coding standard (AVS2), or the next generation video/image coding standard (ex. H.267 or H.268, etc.).
Present disclosure presents various embodiments of video/image coding, and the embodiments may be performed in combination with each other unless otherwise mentioned.
In the present disclosure, video may refer to a series of images over time. Picture generally refers to a unit representing one image in a specific time zone, and a slice/tile is a unit constituting part of a picture in coding. The slice/tile may include one or more coding tree units (CTUs). One picture may consist 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 is a specific sequential ordering of CTUs partitioning a picture in which the CTUs are ordered consecutively in 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 may include 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.
Meanwhile, a picture may be divided into two or more subpictures. A subpicture may be a rectangular region of one or more slices within a picture.
A pixel or a pel may mean a smallest unit constituting one picture (or image). Also, ‘sample’ may be used as a term corresponding to a pixel. A sample may generally represent a pixel or a value of a pixel, and may represent only a pixel/pixel value of a luma component or only a pixel/pixel value of a chroma component.
A unit may represent a basic unit of image processing. The unit may include at least one of a specific region of the picture and information related to the region. One unit may include one luma block and two chroma (ex. cb, cr) blocks. The unit may be used interchangeably with terms such as block or area in some cases. In a general case, an M×N block may include samples (or sample arrays) or a set (or array) of transform coefficients of M columns and N rows.
In the present specification, “A or B” may mean “only A”, “only B” or “both A and B”. In other words, “A or B” may be construed as “A and/or B” in the present specification. For example, “A, B or C” may mean “only A”, “only B”, “only C” or “any combination of A, B and C” in the present specification.
A slash (/) or a comma used in the present specification may mean “and/or”. For example, “A/B” may mean “A and/or B”. Accordingly, “A/B” may mean “only A”, “only B” or “both A and B”. For example, “A, B, C” may mean “A, B or C”.
In the present specification, “at least one of A and B” may mean “only A”, “only B” or “both A and B”. Further, “at least one of A or B” or “at least one of A and/or B” may be construed as “at least one of A and B” in the present specification.
Furthermore, “at least one of A, B and C” may mean “only A”, “only B”, “only C” or “any combination of A, B and C” in the present specification. In addition, “at least one of A, B or C” or “at least one of A, B and/or C” may mean “at least one of A, B and C”.
Moreover, a parenthesis used in the present specification may mean “for example”. Specifically, in the case of “prediction (intra-prediction)”, it may represent that “intra-prediction” is proposed as an example of “prediction”. In other words, “prediction” in the present specification is not limited to “intra-prediction” and “intra-prediction” may be proposed as an example of “prediction”. Further, in the case of “prediction (i.e., intra-prediction)”, it may also represent that “intra-prediction” is proposed as an example of “prediction”.
Technical features individually described in a single drawing may be implemented individually or simultaneously in the present specification.
Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. In addition, like reference numerals are used to indicate like elements throughout the drawings, and the same descriptions on the like elements will be omitted.
Referring to
The source device may include a video source, an encoding apparatus, and a transmitter. The receiving device may include a receiver, a decoding apparatus, and a renderer. The encoding apparatus may be called a video/image encoding apparatus, and the decoding apparatus may be called a video/image decoding apparatus. The transmitter may be included in the encoding apparatus. The receiver may be included in the decoding apparatus. The renderer may include a display, and the display may be configured as a separate device or an external component.
The video source may acquire video/image through a process of capturing, synthesizing, or generating the video/image. The video source may include a video/image capture device and/or a video/image generating device. The video/image capture device may include, for example, one or more cameras, video/image archives including previously captured video/images, and the like. The video/image generating device may include, for example, computers, tablets and smartphones, and may (electronically) generate video/images. For example, a virtual video/image may be generated through a computer or the like. In this case, the video/image capturing process may be replaced by a process of generating related data.
The encoding apparatus may encode input image/image. The encoding apparatus may perform a series of procedures such as prediction, transform, and quantization for compression and coding efficiency. The encoded data (encoded video/image information) may be output in the form of a bitstream.
The transmitter may transmit the encoded image/image information or data output in the form of a bitstream to the receiver of the receiving device through a digital storage medium or a network in the form of a file or streaming. The digital storage medium may include various storage mediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and the like. The transmitter may include an element for generating a media file through a predetermined file format and may include an element for transmission through a broadcast/communication network. The receiver may receive/extract the bitstream and transmit the received bitstream to the decoding apparatus.
The decoding apparatus may decode the video/image by performing a series of procedures such as dequantization, inverse transform, and prediction corresponding to the operation of the encoding apparatus.
The renderer may render the decoded video/image. The rendered video/image may be displayed through the display.
Referring to
The image partitioner 210 may partition an input image (or a picture or a frame) input to the encoding apparatus 200 into one or more processors. For example, the processor may be called a coding unit (CU). In this case, the coding unit may be recursively partitioned according to a quad-tree binary-tree ternary-tree (QTBTTT) structure from a coding tree unit (CTU) or a largest coding unit (LCU). For example, one coding unit may be partitioned into a plurality of coding units of a 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 ternary structure may be applied later. Alternatively, the binary tree structure may be applied first. The coding procedure according to the present disclosure may be performed based on the final coding unit that is no longer partitioned. In this case, the largest coding unit may be used as the final coding unit based on coding efficiency according to image characteristics, or if necessary, the coding unit may be recursively partitioned into coding units of deeper depth and a coding unit having an optimal size may be used as the final coding unit. Here, the coding procedure may include a procedure of prediction, transform, and reconstruction, which will be described later. As another example, the processor may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may be split or partitioned from the aforementioned final coding unit. The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving a transform coefficient and/or a unit for deriving a residual signal from the transform coefficient.
The unit may be used interchangeably with terms such as block or area in some cases. In a general case, an M×N block may represent a set of samples or transform coefficients composed of M columns and N rows. A sample may generally represent a pixel or a value of a pixel, may represent only a pixel/pixel value of a luma component or represent only a pixel/pixel value of a chroma component. A sample may be used as a term corresponding to one picture (or image) for a pixel or a pel.
In the encoding apparatus 200, a prediction signal (predicted block, prediction sample array) output from the inter predictor 221 or the intra predictor 222 is subtracted from an input image signal (original block, original sample array) to generate a residual signal residual block, residual sample array), and the generated residual signal is transmitted to the transformer 232. In this case, as shown, a unit for subtracting a prediction signal (predicted block, prediction sample array) from the input image signal (original block, original sample array) in the encoder 200 may be called a subtractor 231. The predictor may 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 predictor may determine whether intra-prediction or inter-prediction is applied on a current block or CU basis. As described later in the description of each prediction mode, the predictor may generate various information related to prediction, such as prediction mode information, and transmit the generated information to the entropy encoder 240. The information on the prediction may be encoded in the entropy encoder 240 and output in the form of a bitstream.
The intra predictor 222 may predict the current block by referring to the samples in the current picture. The referred samples may be located in the neighborhood of the current block or may be located apart according to the prediction mode. In the intra-prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The non-directional mode may include, for example, a DC mode and a planar mode. The directional mode may include, for example, 33 directional prediction modes or 65 directional prediction modes according to the degree of detail of the prediction direction. However, this is merely an example, more or less directional prediction modes may be used depending on a setting. The intra predictor 222 may determine the prediction mode applied to the current block by using a prediction mode applied to a neighboring block.
The inter predictor 221 may 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. Here, in order to reduce the amount of motion information transmitted in the inter-prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on correlation of motion information between the neighboring block and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter-prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter-prediction, the neighboring block may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a co-located CU (colCU), and the like, and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter predictor 221 may configure a motion information candidate list based on neighboring blocks and generate information indicating which candidate is used to derive a motion vector and/or a reference picture index of the current block. Inter-prediction may be performed based on various prediction modes. For example, in the case of a skip mode and a merge mode, the inter predictor 221 may use motion information of the neighboring block as motion information of the current block. In the skip mode, unlike the merge mode, the residual signal may not be transmitted. In the case of the motion vector prediction (MVP) mode, the motion vector of the neighboring block may be used as a motion vector predictor and the motion vector of the current block may be indicated by signaling a motion vector difference.
The predictor 220 may generate a prediction signal based on various prediction methods described below. For example, the predictor may not only apply intra-prediction or inter-prediction to predict one block but also simultaneously apply both intra-prediction and inter-prediction. This may be called combined inter and intra-prediction (CIIP). In addition, the predictor may 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 may be used for content image/video coding of a game or the like, for example, screen content coding (SCC). The IBC basically performs prediction in the current picture but may be performed similarly to inter-prediction in that a reference block is derived in the current picture. That is, the IBC may use at least one of the inter-prediction techniques described in the present disclosure. The palette mode may be considered as an example of intra coding or intra-prediction. When the palette mode is applied, a sample value within a picture may be signaled based on information on the palette table and the palette index.
The prediction signal generated by the predictor (including the inter predictor 221 and/or the intra predictor 222) may be used to generate a reconstructed signal or to generate a residual signal. The transformer 232 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), Karhunen-Loeve Transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT means transform obtained from a graph when relationship information between pixels is represented by the graph. The CNT refers to transform generated based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to square pixel blocks having the same size or may be applied to blocks having a variable size rather than square.
The quantizer 233 may quantize the transform coefficients and transmit them to the entropy encoder 240 and the entropy encoder 240 may encode the quantized signal (information on the quantized transform coefficients) and output a bitstream. The information on the quantized transform coefficients may be referred to as residual information. The quantizer 233 may rearrange block type quantized transform coefficients into a one-dimensional vector form based on a coefficient scanning order and generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. Information on transform coefficients may be generated. The entropy encoder 240 may perform various encoding methods such as, for example, exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), and the like. The entropy encoder 240 may encode information necessary for video/image reconstruction other than quantized transform coefficients (ex. values of syntax elements, etc.) together or separately. Encoded information (ex. encoded video/image information) may be transmitted or stored in units of NALs (network abstraction layer) in the form of a bitstream. 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 the present disclosure, information and/or syntax elements transmitted/signaled from the encoding apparatus to the decoding apparatus may be included in video/picture information. The video/image information may be encoded through the above-described encoding procedure and included in the bitstream. The bitstream may be transmitted over a network or may be stored in a digital storage medium. 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, and the like. A transmitter (not shown) transmitting a signal output from the entropy encoder 240 and/or a storage unit (not shown) storing the signal may be included as internal/external element of the encoding apparatus 200, and alternatively, the transmitter may be included in the entropy encoder 240.
The quantized transform coefficients output from the quantizer 233 may be used to generate a prediction signal. For example, the residual signal (residual block or residual samples) may be reconstructed by applying dequantization and inverse transform to the quantized transform coefficients through the dequantizer 234 and the inverse transformer 235. The adder 250 adds the reconstructed residual signal to the prediction signal output from the inter predictor 221 or the intra predictor 222 to generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array). If there is no residual for the block to be processed, such as a case where the skip mode is applied, the predicted block may be used as the reconstructed block. The adder 250 may be called a reconstructor or a reconstructed block generator. The generated reconstructed signal may be used for intra-prediction of a next block to be processed in the current picture and may be used for inter-prediction of a next picture through filtering as described below.
Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during picture encoding and/or reconstruction.
The filter 260 may improve subjective/objective image quality by applying filtering to the reconstructed signal. For example, the filter 260 may generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture and store the modified reconstructed picture in the memory 270, specifically, a DPB of the memory 270. The various filtering methods may include, for example, deblocking filtering, a sample adaptive offset, an adaptive loop filter, a bilateral filter, and the like. The filter 260 may generate various information related to the filtering and transmit the generated information to the entropy encoder 240 as described later in the description of each filtering method. The information related to the filtering may be encoded by the entropy encoder 240 and output in the form of a bitstream.
The modified reconstructed picture transmitted to the memory 270 may be used as the reference picture in the inter predictor 221. When the inter-prediction is applied through the encoding apparatus, prediction mismatch between the encoding apparatus 200 and the decoding apparatus 300 may be avoided and encoding efficiency may be improved.
The DPB of the memory 270 DPB may store the modified reconstructed picture for use as a reference picture in the inter predictor 221. The memory 270 may store the motion information of the block from which the motion information in the current picture is derived (or encoded) and/or the motion information of the blocks in the picture that have already been reconstructed. The stored motion information may be transmitted to the inter predictor 221 and used as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 270 may store reconstructed samples of reconstructed blocks in the current picture and may transfer the reconstructed samples to the intra predictor 222.
Referring to
When a bitstream including video/image information is input, the decoding apparatus 300 may reconstruct an image corresponding to a process in which the video/image information is processed in the encoding apparatus of
The decoding apparatus 300 may receive a signal output from the encoding apparatus of
The dequantizer 321 may dequantize the quantized transform coefficients and output the transform coefficients. The dequantizer 321 may rearrange the quantized transform coefficients in the form of a two-dimensional block form. In this case, the rearrangement may be performed based on the coefficient scanning order performed in the encoding apparatus. The dequantizer 321 may perform dequantization on the quantized transform coefficients by using a quantization parameter (ex. quantization step size information) and obtain transform coefficients.
The inverse transformer 322 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).
The predictor may perform prediction on the current block and generate a predicted block including prediction samples for the current block. The predictor may determine whether intra-prediction or inter-prediction is applied to the current block based on the information on the prediction output from the entropy decoder 310 and may determine a specific intra/inter-prediction mode.
The predictor 320 may generate a prediction signal based on various prediction methods described below. For example, the predictor may not only apply intra-prediction or inter-prediction to predict one block but also simultaneously apply intra-prediction and inter-prediction. This may be called combined inter and intra-prediction (CIIP). In addition, the predictor may 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 may be used for content image/video coding of a game or the like, for example, screen content coding (SCC). The IBC basically performs prediction in the current picture but may be performed similarly to inter-prediction in that a reference block is derived in the current picture. That is, the IBC may use at least one of the inter-prediction techniques described in the present disclosure. The palette mode may be considered as an example of intra coding or intra-prediction. When the palette mode is applied, a sample value within a picture may be signaled based on information on the palette table and the palette index.
The intra predictor 331 may predict the current block by referring to the samples in the current picture. The referred samples may be located in the neighborhood of the current block or may be located apart according to the prediction mode. In the intra-prediction, prediction modes may include a plurality of non-directional modes and a plurality of directional modes. The intra predictor 331 may determine the prediction mode applied to the current block by using a prediction mode applied to a neighboring block.
The inter predictor 332 may 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. In this case, in order to reduce the amount of motion information transmitted in the inter-prediction mode, motion information may be predicted in units of blocks, sub-blocks, or samples based on correlation of motion information between the neighboring block and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter-prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter-prediction, the neighboring block may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. For example, the inter predictor 332 may configure a motion information candidate list based on neighboring blocks and derive a motion vector of the current block and/or a reference picture index based on the received candidate selection information. Inter-prediction may be performed based on various prediction modes, and the information on the prediction may include information indicating a mode of inter-prediction for the current block.
The adder 340 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the obtained residual signal to the prediction signal (predicted block, predicted sample array) output from the predictor (including the inter predictor 332 and/or the intra predictor 331). If there is no residual for the block to be processed, such as when the skip mode is applied, the predicted block may be used as the reconstructed block.
The adder 340 may be called reconstructor or a reconstructed block generator. The generated reconstructed signal may be used for intra-prediction of a next block to be processed in the current picture, may be output through filtering as described below, or may be used for inter-prediction of a next picture.
Meanwhile, luma mapping with chroma scaling (LMCS) may be applied in the picture decoding process.
The filter 350 may improve subjective/objective image quality by applying filtering to the reconstructed signal. For example, the filter 350 may generate a modified reconstructed picture by applying various filtering methods to the reconstructed picture and store the modified reconstructed picture in the memory 360, specifically, a DPB of the memory 360. The various filtering methods may include, for example, deblocking filtering, a sample adaptive offset, an adaptive loop filter, a bilateral filter, and the like.
The (modified) reconstructed picture stored in the DPB of the memory 360 may be used as a reference picture in the inter predictor 332. The memory 360 may store the motion information of the block from which the motion information in the current picture is derived (or decoded) and/or the motion information of the blocks in the picture that have already been reconstructed. The stored motion information may be transmitted to the inter predictor 260 so as to be utilized as the motion information of the spatial neighboring block or the motion information of the temporal neighboring block. The memory 360 may store reconstructed samples of reconstructed blocks in the current picture and transfer the reconstructed samples to the intra predictor 331.
In the present disclosure, the embodiments described in the filter 260, the inter predictor 221, and the intra predictor 222 of the encoding apparatus 200 may be the same as or respectively applied to correspond to the filter 350, the inter predictor 332, and the intra predictor 331 of the decoding apparatus 300. The same may also apply to the unit 332 and the intra predictor 331.
Meanwhile, when video coding is performed as described above, prediction is performed in order to improve compression efficiency. Accordingly, a predicted block including prediction samples for a current block that is a coding target block may be generated. For example, when the aforementioned intra-prediction is performed, a correlation between samples may be used and a difference between an original block and a predicted block, that is, a residual, may be obtained. The aforementioned transform and quantization may be applied to the residual to remove spatial redundancy. Specifically, an encoding method and a decoding method using intra-prediction may be as follows.
Referring to
Meanwhile, the encoding device may 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.
The encoding device generates residual samples for the current block based on the (filtered) prediction samples S410. The encoding device may compare the prediction samples in the original samples of the current block based on the phase and derive the residual samples.
The encoding device may encode image information including information on the intra prediction (prediction information) and residual information on the residual samples S420. The prediction information may include the intra prediction mode information and the intra prediction type information. The encoding device may output encoded image information in the form of a bitstream. The output bitstream may be transmitted to the decoding device through a storage medium or a network.
The residual information may include residual coding syntax, which will be described later. The encoding device may transform/quantize the residual samples to derive quantized transform coefficients. The residual information may include information on the quantized transform coefficients.
Meanwhile, as described above, the encoding device may generate a reconstructed picture (including reconstructed samples and reconstructed blocks). To this end, the encoding device may derive (modified) residual samples by performing inverse quantization/inverse transformation on the quantized transform coefficients again. The reason for performing the inverse quantization/inverse transformation again after transforming/quantizing the residual samples in this way is to derive the same residual samples as the residual samples derived in the decoding device as described above. The encoding device may generate a reconstructed block including reconstructed samples for the current block based on the prediction samples and the (modified) residual samples. A reconstructed picture for the current picture may be generated based on the reconstructed block. As described above, an in-loop filtering procedure may be further applied to the reconstructed picture.
The decoding device may perform an operation corresponding to the operation performed by the encoding apparatus.
Prediction information and residual information may be obtained from a bitstream. Residual samples for the current block may be derived based on the residual information. Specifically, transform coefficients may be derived by performing inverse quantization based on the quantized transform coefficients derived based on the residual information, residual samples for the current block may be derived by performing inverse transform on the transform coefficients.
Specifically, the decoding device may derive the intra prediction mode/type for the current block based on the received prediction information (intra prediction mode/type information) S500. The decoding device may derive neighboring reference samples of the current block S510. The decoding device generates prediction samples in the current block based on the intra prediction mode/type and the neighboring reference samples S520. In this case, the decoding device may perform a prediction sample filtering procedure. The Predictive 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.
The decoding device generates residual samples for the current block based on the received residual information S530. The decoding device may generate reconstructed samples for the current block based on the prediction samples and the residual samples, and may derive a reconstructed block including the reconstructed samples S540. A reconstructed picture for the current picture may be generated based on the reconstructed block. As described above, an in-loop filtering procedure may be further applied to the reconstructed picture.
The intra prediction mode information may include, for example, flag information (ex. intra_luma_mpm_flag) indicating whether MPM (most probable mode) is applied to the current block or whether a remaining mode is applied, and, when the MPM is applied to the current block, the prediction mode information may further include index information (eg, intra_luma_mpm_idx) indicating one of the intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may be constructed of 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 includes remaining mode information (ex. intra_luma_mpm_remainder) indicating one of the remaining intra prediction modes except for the intra prediction mode candidates (MPM candidates). The decoding device may determine the intra prediction mode of the current block based on the intra prediction mode information.
Also, the intra prediction type information may be implemented in various forms. For example, the intra prediction type information may include intra prediction type index information indicating one of the intra prediction types. As another example, the intra prediction type information may include at least one of reference sample line information (ex. intra_luma_ref idx) representing whether the MRL is applied to the current block and, if applied, which reference sample line is used, ISP flag information representing whether the ISP is applied to the current block (ex. intra_subpartitions_mode_flag), ISP type information indicating a split type of subpartitions when the ISP is applied (ex. intra_subpartitions_split_flag), flag information representing whether PDCP is applied or flag information representing whether LIP is applied. Also, the intra prediction type information may include a MIP flag representing whether matrix-based intra prediction (MIP) is applied to the current block.
The intra prediction mode information and/or the intra prediction type information may be encoded/decoded through a coding method described in the present disclosure. For example, the intra prediction mode information and/or the intra prediction type information may be encoded/decoded through entropy coding (eg, CABAC, CAVLC).
Referring to
Referring to
The encoding device may determine an intra prediction mode/type applied to the current block from among the various intra prediction modes/types described above, and may generate prediction related information. The prediction related information may include intra prediction mode information representing an intra prediction mode applied to the current block and/or intra prediction type information representing an intra prediction type applied to the current block. The decoding device may determine an intra prediction mode/type applied to the current block based on the prediction related information.
The intra prediction mode information may include, for example, flag information (ex. intra_luma_mpm_flag) representing whether a most probable mode (MPM) is applied to the current block or a remaining mode is applied, and the When the MPM is applied to the current block, the prediction mode information may further include index information (eg, intra_luma_mpm_idx) indicating one of the intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may be constructed of 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 (ex. intra_luma_mpm_remainder) indicating one of the remaining intra prediction modes except for the intra prediction mode candidates (MPM candidates). The decoding device may determine the intra prediction mode of the current block based on the intra prediction mode information.
In addition, the intra prediction type information may be implemented in various forms. For example, the intra prediction type information may include intra prediction type index information indicating one of the intra prediction types. As another example, the intra prediction type information may include at least one of reference sample line information (ex. intra_luma_ref idx) representing whether the MRL is applied to the current block and, if applied, which reference sample line is used, ISP flag information representing whether the ISP is applied to the current block (ex. intra_subpartitions_mode_flag), ISP type information indicating a split type of subpartitions when the ISP is applied (ex. intra_subpartitions_split_flag), flag information representing whether PDCP is applied or flag information representing whether LIP is applied. Also, the intra prediction type information may include a MIP flag representing whether matrix-based intra prediction (MIP) is applied to the current block.
For example, when intra prediction is applied, an intra prediction mode applied to the current block may be determined using an intra prediction mode of a neighboring block. For example, the coding device may select one of most probable mode (MPM) candidates in the MPM list derived based on additional candidate modes and/or an intra prediction mode of the neighboring block (eg, the left and/or top neighboring block) of the current block, or select one of the remaining intra prediction modes not included in the MPM candidates (and planar mode) based on the MPM remainder information (remaining intra prediction mode information). The MPM list may be configured to include or not include the planner mode as a candidate. For example, when the MPM list includes a planner mode as a candidate, the MPM list may have 6 candidates, and when the MPM list does not include a planner mode as a candidate, the MPM list may have 5 candidates. When the MPM list does not include the planar mode as a candidate, a not planar flag (ex. intra_luma_not_planar_flag) representing whether the intra prediction mode of the current block is not the planar mode may be signaled. For example, the MPM flag may be signaled first, and the MPM index and not planner flag may be signaled when the value of the MPM flag is 1. Also, the MPM index may be signaled when the value of the not planner flag is 1. Here, the fact that the MPM list is configured not to include the planner mode as a candidate is that the planner mode is always considered as MPM rather than that the planner mode is not MPM, thus, the flag (not planar flag) is signaled first to check whether it is the planar mode.
For example, whether the intra prediction mode applied to the current block is among the MPM candidates (and the planar mode) or the remaining modes may be indicated based on the MPM flag (eg, intra_luma_mpm_flag). The MPM flag with a value of 1 may indicate that the intra prediction mode for the current block is within MPM candidates (and planar mode), and The MPM flag with a value of 0 may indicate that the intra prediction mode for the current block is not within MPM candidates (and planar mode). The not planar flag (ex. intra_luma_not_planar_flag) with a value of 0 may indicate that the intra prediction mode for the current block is a planar mode, and the not planar flag with a value of 1 may indicate that the intra prediction mode for the current block is not the planar mode. The MPM index may be signaled in the form of an 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 indicate one of the remaining intra prediction modes not included in the MPM candidates (and planar mode) among all intra prediction modes by indexing in the order of prediction mode number. The intra prediction mode may be an intra prediction mode for a luma component (sample). Hereinafter, the intra prediction mode information may include at least one of the MPM flag (ex. intra_luma_mpm_flag), the not planar flag (ex. intra_luma_not_planar flag), the MPM index (ex. mpm_idx or intra_luma_mpm_idx), or the remaining intra prediction mode information (rem_intra_luma_luma_mpm_mode or intra_luma_mpminder). In the present disclosure, the MPM list may be referred to by various terms such as an MPM candidate list and candModeList.
When the MIP is applied to the current block, a separate MPM flag (ex. intra_mip_mpm_flag) for the MIP, an MPM index (ex. intra_mip_mpm_idx), and remaining intra prediction mode information (ex. intra_mip_mpm_remainder) may be signaled, and the not planar flag may not be signaled.
In other words, in general, when a block partition for an image is performed, the current block to be coded and a neighboring block have similar image characteristics. Therefore, there is a high probability that the current block and the neighboring block have the same or similar intra prediction mode. Accordingly, the encoder may use the intra prediction mode of the neighboring block to encode the intra prediction mode of the current block.
The coding device may construct a most probable modes (MPM) list for the current block. The MPM list may be referred to as the MPM candidate list. Here, the MPM may refer to modes used to improve coding efficiency in consideration of the similarity between the current block and the neighboring blocks during intra prediction mode coding. As described above, the MPM list may be constructed to include the planar mode, or may be constructed to exclude the planar mode. For example, when the MPM list includes the planar mode, the number of candidates in the MPM list may be 6. And, when the MPM list does not include the planar mode, the number of candidates in the MPM list may be 5.
The encoding device may perform prediction based on various intra prediction modes, and may determine an optimal intra prediction mode based on rate-distortion optimization (RDO) based thereon. In this case, the encoding device may determine the optimal intra prediction mode by using only the MPM candidates and planar mode configured in the MPM list, or by further using the remaining intra prediction modes as well as the MPM candidates and planar mode configured in the MPM list. Specifically, for example, if the intra prediction type of the current block is a specific type (ex. LIP, MRL, or ISP) other than the normal intra prediction type, 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, encoding/signaling of the MPM flag may not be performed. In this case, the decoding device may infer that the MPM flag is 1 without separately signaling the MPM flag.
Meanwhile, in general, when the intra prediction mode of the current block is not the planar mode and is one of the MPM candidates in the MPM list, the encoding device generates an MPM index (mpm idx) indicating one of the MPM candidates. when the intra prediction mode of the current block is not included in the MPM list, the encoding device generates MPM reminder information (remaining intra prediction mode information) indicating the same mode as the intra prediction mode of the current block among the remaining intra prediction modes not included in the MPM list (and planar mode). The MPM reminder information may include, for example, an intra_luma_mpm_remainder syntax element.
The decoding device obtains intra prediction mode information from the bitstream. As described above, the intra prediction mode information may include at least one of an MPM flag, a not planner flag, an MPM index, and MPM remaster information (remaining intra prediction mode information). The decoding device may construct the MPM list. The MPM list is constructed the same as the MPM list constructed in the encoding device. That is, the MPM list may include intra prediction modes of neighboring blocks, or may further include specific intra prediction modes according to a predetermined method.
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 the planar mode as the intra prediction mode of the current block (based on not planar flag) or derive the candidate indicated by the MPM index from among the MPM candidates in the MPM list as the intra prediction mode of the current block. Here, the MPM candidates may represent only candidates included in the MPM list, or may include not only candidates included in the MPM list but also the planar mode applicable when the value of the MPM flag is 1.
As another example, when the value of the MPM flag is 0, the decoding device may derive an intra prediction mode indicated by the remaining intra prediction mode information (which may be referred to as mpm remainder information) among the remaining intra prediction modes not included in the MPM list and the planner 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 (ex. LIP, MRL or ISP, etc.), the decoding device may 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/checking the MPM flag.
The coding device derives neighboring reference samples of the current block S610. When intra prediction is applied to the current block, the neighboring reference samples to be used for the intra prediction of the current block may be derived. The neighboring reference samples of the current block may include a sample adjacent to the left boundary of the current block of size nW×nH and a total of 2×nH samples adjacent to the bottom-left of the current block, a sample adjacent to the top boundary of the current block and a total of 2×nW samples adjacent to the top-right and a sample adjacent to the top-left of the current block. Alternatively, the neighboring reference samples of the current block may include a plurality of columns of top neighboring samples and a plurality of rows of left neighboring samples. In addition, the neighboring reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block of size nW×nH, a total of nW samples adjacent to the bottom boundary of the current block and a sample adjacent to the bottom-right of the current block.
On the other hand, when the MRL is applied (that is, when the value of the MRL index is greater than 0), the neighboring reference samples may be located on lines 1 to 2 instead of line 0 adjacent to the current block on the left/top side, and in this case, the number of the neighboring reference samples may be further increased. Meanwhile, when the ISP is applied, the neighboring reference samples may be derived in units of sub-partitions.
The coding device derives prediction samples by performing intra prediction on the current block S620. The coding device may derive the prediction samples based on the intra prediction mode/type and the neighboring samples. The coding device may derive a reference sample according to an intra prediction mode of the current block among neighboring reference samples of the current block, and may derive a prediction sample of the current block based on the reference sample.
Meanwhile, when intra-prediction is applied to the current block, the encoding apparatus/decoding apparatus may derive an intra prediction mode for the current block and derive prediction samples for the current block based on the intra prediction mode, as described above. That is, the encoding apparatus/decoding apparatus may derive the prediction samples of the current block by applying a directional or non-directional mode based on neighboring reference samples of the current block.
For reference, intra prediction modes may include, for example, 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 planar intra prediction mode #0 and DC intra prediction mode #1, and the directional intra prediction modes may include 65 intra prediction modes #2 to #66. However, this is an example and the present disclosure can also be applied to cases of different numbers of intra prediction modes. Intra prediction mode #67 may be additionally used as necessary and intra prediction mode #67 may represent a linear model (LM) mode.
Referring to
As an embodiment of intra-prediction, a method of selecting a reference sample line having highest prediction accuracy from a plurality of reference sample lines of the current block and deriving a prediction sample using a reference sample located in a prediction direction in the selected reference sample line may be proposed. This method may be called multi-reference line (MRL) intra-prediction or MRL based intra-prediction.
Specifically, only neighboring samples of the first line above the current block and neighboring samples of the first line on the left of the current block can be used as reference samples for intra-prediction in conventional intra-prediction. However, in MRL, intra-prediction can be performed using neighboring samples positioned in upper and/or left sample lines separated from the current block by 1, 2 or 3 sample distances as reference samples.
As an embodiment of intra-prediction, a method of partitioning the current block in the horizontal direction or the vertical direction and performing intra-prediction in units of partitioned blocks may be proposed. That is, a method of partitioning the current block in the horizontal direction or the vertical direction to derive sub-blocks and performing intra-prediction on the sub-blocks may be proposed. In this case, encoding/decoding may be performed per partitioned sub-block to generate a reconstructed block, and the reconstructed block may be used as a reference block of the next partitioned sub-block. The aforementioned method may also be called intra sub-partitions prediction (ISP prediction), intra sub-partitions (ISP) mode or intra sub-partitions (ISP) based prediction. Otherwise, the aforementioned method may also be called ISP based intra-prediction. Further, a sub-block may be called an intra sub-partition. Otherwise, sub-blocks (or sub-partitions) partitioned according to ISP may called transform units (TUs).
According to ISP, the current block may be partitioned into two or four sub-partitions in the vertical or horizontal direction based on the size of the current block. For example, when ISP is performed, the current block may be partitioned into the number of sub-blocks shown in the following table depending on the size of the current block.
Referring to Table 1, ISP may be disabled when the size of the current block is 4×4. The current block may be partitioned into two sub-blocks when the size of the current block is 4×8 or 8×4 and may be partitioned into four sub-blocks when the current block has sizes other than 4×4, 4×8 and 8×4 (i.e., sizes greater than 4×8 or 8×4).
Meanwhile, M×128 (M<64) and 128×N (N<64) ISP blocks (i.e., intra sub-partitions) may cause potential problems for 64×64 VDPU. For example, an M×128 CU in a single tree may have M×128 luma TBs and two M/2×64 chroma TBs corresponding to the luma TBs. When ISP is applied to the CU, a luma TB may be partitioned into four M×32 TBs, that is, four M×32 sub-blocks (only horizontal split is possible), and each TB is smaller than a 64×64 block. In this case, however, a chroma block to which ISP is applied may not be partitioned in design according to current video standards. Accordingly, the size of the two chroma component TBs for the luma component TBs is greater than 32×32. Likewise, a 128×N CU may cause a situation similar to the aforementioned situation. Accordingly, the aforementioned two cases may become problems in a 64×64 decoder pipeline. For this reason, a maximum size of a CU for which ISP can be used may be limited to 64×64.
When ISP is applied, the encoding apparatus may generate an MPM list depending on a partitioning method (e.g., horizontal split or vertical split) in order to reduce coding complexity and compare intra prediction modes in the generated MPM list in terms of rate distortion optimization (RDO) to derive an optimal intra prediction mode. When the aforementioned MRL is used, ISP cannot be used. That is, ISP can be applied only when a 0-th reference line is used for intra-prediction (i.e., when the value of intra_luma_ref_idx is 0). Further, when ISP is used, position dependent intra-prediction (PDPC) cannot be used.
A flag indicating whether ISP is applied may be transmitted per block, and when ISP is applied to the current block, a flag indicating whether a split type is horizontal split or vertical split, that is, whether a split direction is the horizontal direction or the vertical direction may be encoded/decoded. The flag indicating whether ISP is applied may be called an ISP flag, and a syntax element of the ISP flag may be intra_subpartitions_mode_flag. Further, the flag indicating the split type may be called an ISP split flag, and a syntax element of the ISP split type may be intra_subpartitions_split_flag.
Syntax elements related to ISP are shown in the following table.
In Table 2, ultra_luma_ref_idx may be the syntax element of the reference line index. When ISP is applied, an intra prediction mode for the current block may be equally applied to sub-partitions of the current block and intra-prediction may be performed by deriving a neighboring reference sample per sub-partition to improve intra-prediction performance. That is, when ISP is applied, a residual sample processing procedure may be performed per sub-partition. In other words, intra-prediction may be performed on each sub-partition to derive prediction samples, and a residual signal (residual samples) with respect to each sub-partition may be added to prediction samples with respect to each sub-partition to derive reconstructed samples. The residual signal (residual samples) may be derived through an inverse quantization/inverse transform procedure based on residual information (quantized transform coefficient information or a residual coding syntax) in a bitstream. Intra-prediction for the sub-partitions may be performed from the leftmost sub-partition to the rightmost sub-partition when the split type is vertical split and may be performed from the uppermost sub-partition to the lowermost sub-partition when the split type is horizontal split.
For example, intra-prediction may be performed on a first sub-partition of the current block to derive prediction samples, residual samples with respect to the first sub-partition may be derived based on residual information about the first sub-partition, and reconstructed samples with respect to the first sub-partition may be derived based on the prediction samples and the residual samples. Here, the first sub-partition may be the leftmost sub-block if the split type for the current block to which ISP is applied is vertical split and the first sub-partition may be the uppermost sub-block if the split type for the current block to which ISP is applied is horizontal split.
Subsequently, some of the reconstructed samples in the first sub-partition may be used as neighboring reference samples with respect to a second sub-partition (e.g., left or upper neighboring reference samples of the second sub-partition) in a process of deriving prediction samples with respect to the second sub-partition. Specifically, intra-prediction may be performed on the second sub-partition of the current block to derive prediction samples, residual samples with respect to the second sub-partition may be derived based on residual information about the second sub-partition, and reconstructed samples with respect to the second sub-partition may be derived based on the prediction samples and the residual samples. Likewise, when a process of deriving prediction samples with respect to a third sub-partition is performed, some of the reconstructed samples in the second sub-partition may be used as neighboring reference samples with respect to the third sub-partition (e.g., left or upper neighboring reference samples of the third sub-partition). Likewise, when a process of deriving prediction samples with respect to a fourth sub-partition is performed, some of the reconstructed samples in the third sub-partition may be used as neighboring reference samples with respect to the fourth sub-partition (e.g., left or upper neighboring reference samples of the fourth sub-partition).
Meanwhile, as another embodiment of intra prediction, Combined Inter and Intra Prediction (CIIP) may be proposed. The CIP may represent a process of deriving a prediction sample of the current block based on inter prediction and intra prediction. For example, when the CIIP is applied to the 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, a second prediction sample of the current block may be derived by performing inter prediction on the current block, and the prediction sample of the current block may be derived by weighted summing (i.e., weighted averaging) the first prediction sample and the second prediction sample. 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. Also, 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 may be constructed based on motion information of neighboring blocks of the current block, and motion information of the current block may be derived based on a merge candidate in the merge candidate list indicated by a merge index for the current block, and the second prediction sample of the current block may be derived based on the motion information.
Also, for example, a CIIP flag representing 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 (that is, the product of the width and height of the current block is 64 or more).
Also, for example, the intra prediction mode of the current block when the CIIP is applied may be derived based on two syntax elements. For example, one of up to four intra prediction modes may be used as the intra prediction mode. The four intra prediction modes may include a DC intra prediction mode, a planar intra prediction mode, a horizontal intra prediction mode, and/or a vertical intra prediction mode.
For example, in CIIP for the luma component, up to four intra prediction modes including a DC intra prediction mode, a planar intra prediction mode, a horizontal intra prediction mode, and a vertical intra prediction mode may be used. Also, for example, when the width of the current block is more than two times of the height, the vertical intra prediction mode may not be available. In this case, only three intra prediction modes are available. Also, for example, when the height of the current block is more than two times of the width, the vertical intra prediction mode may not be available. In this case, only three intra prediction modes are available.
Specifically, for example, when the CIIP is applied to the current block, the intra prediction mode of the current block may be derived as follows. For example, a Most Probable Mode (MPM) list including MPM candidates for the current block may be constructed as follows. For example, the MPM list may include three MPM candidates.
For example, the left neighboring block of the current block may be set to A, and the top neighboring block may be set to B. Thereafter, intra prediction modes of the left neighboring block A and the top neighboring block B indicated by intraModeA and intraModeB may be derived as follows.
Thereafter, the MPM candidates may be derived based on the derived intraModeA and intraModeB.
Meanwhile, for example, when the width of the current block is more than two times of the height or the height of the current block is more than two times of the width, the MPM flag may be inferred to be equal to 1 without signaling. Otherwise, the MPM flag for the current block may be signaled.
For example, when the value of the MPM flag is 1, an MPM index indicating one of the MPM candidates of the MPM list may be signaled, and the MPM candidate indicated by the MPM index may be derived as the intra prediction mode of the current block. Also, for example, when the value of the MPM flag is 0, the intra prediction mode of the current block may be set to a “missing” mode. Here, the missing mode may represent an intra prediction mode not included in the MPM list among four intra prediction modes available in the CIIP. For example, when the planar intra prediction mode is not included in the MPM list, the missing mode may be the planar intra prediction mode, and when the value of the MPM flag is 0, the intra prediction mode of the current block may be derived as the planar intra prediction mode, which is the missing mode. Meanwhile, for example, the intra prediction mode of the CU coded with the CIIP may be stored and used for prediction of neighboring CUs coded after the CU.
Meanwhile, as described above, the first prediction sample and the second prediction sample may be weighted averaged. Here, for example, 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 in the current block.
Specifically, for example, when the intra prediction mode of the current block is the DC intra prediction mode or the planar intra prediction mode, or 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, when the intra prediction mode of the current block is the DC intra prediction mode or the planar intra prediction mode, or the width or height of the current block is less than 4, weights for the first prediction sample and the second prediction sample may be derived as the same value.
In addition, in cases other than the above cases, 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 the current sample position in the current block. For example, when the intra prediction mode of the current block is the horizontal intra prediction mode, the current block may be divided into partitions of size (W/4)×H. And, when the current sample is located in the closest partition to an intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample may be set to 6 and the weight for the second prediction sample may be set to 2, or, when the current sample is located in the second closest partition to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample may be set to 5 and the weight for the second prediction sample may be set to 3, or, when the current sample is located in the third closest partition to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample may be set to 3 and the weight for the second prediction sample may be set to 5, or when the current sample is located in the partition furthest from the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample may be set to 2 and the weight for the second prediction sample may be set to 6. Here, the size of the current block may be W×H, W may represent the width of the current block, and H may represent the height of the current block.
Also, for example, when the intra prediction mode of the current block is the vertical intra prediction mode, the current block may be divided into partitions of size W×(H/4). And, when the current sample is located in the closest partition to an intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample may be set to 6 and the weight for the second prediction sample may be set to 2, or, when the current sample is located in the second closest partition to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample may be set to 5 and the weight for the second prediction sample may be set to 3, or, when the current sample is located in the third closest partition to the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample may be set to 3 and the weight for the second prediction sample may be set to 5, or when the current sample is located in the partition furthest from the intra prediction reference sample of the current block, the weight for the first prediction sample of the current sample may be set to 2 and the weight for the second prediction sample may be set to 6.
Thereafter, the prediction sample of the current sample may be derived by weighted averaging the first prediction sample and the second prediction sample based on the weights. For example, the prediction sample may be derived by the following equation.
Herein, PCIIP may represent the prediction sample, Pintra may represent the first prediction sample, Pinter may represent the 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.
Meanwhile, when intra-prediction is performed as described above, general intra-prediction, MRL and/or ISP may be applied. Here, different MPM list generation methods may be employed in general intra-prediction, MRL and ISP. 67 intra prediction modes may be used in the general intra-prediction, 65 intra prediction modes except the planar intra prediction mode and the DC intra prediction mode may be used in the MRL based intra-prediction, and 66 intra prediction modes except the DC intra prediction mode may be used in ISP. Since encoding/decoding is performed in the three intra-predictions (general intra-prediction, MRL based intra-prediction, and ISP) using different numbers of intra prediction modes, an MPM list generation method may be different for the respective intra-predictions.
Specifically, when the general intra-prediction is performed, an MPM list including six MPM candidates may be constructed using all the 67 intra prediction modes. When the MRL based intra-prediction is performed, an MPM list including six MPM candidates may be constructed using all the 65 intra prediction modes except the planar intra prediction mode and the DC intra prediction mode. Further, when ISP is performed, an MPM list including six MPM candidates may be constructed using the 66 intra prediction modes except the DC intra prediction mode. Here, an MPM list may be constructed through a method depending on whether the split type of ISP is horizontal split or vertical split.
If ISP instead of MRL is applied to the current block, the decoding apparatus may generate an ISP MPM list for the current block (S1025). Here, the ISP MPM list may be an MPM list generated through an MPM list generation method when ISP is applied. Thereafter, the decoding apparatus may parse the MPM index (S1020). The decoding apparatus may derive the MPM candidate indicated by the MPM index from among MPM candidates of the ISP MPM list as an intra prediction mode of the current block.
If any of MRL and ISP is not applied to the current block, the decoding apparatus may parse an MPM flag for the current block (S1030). Subsequently, the decoding apparatus may determine whether the intra prediction mode of the current block is an 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 may indicate whether the intra prediction mode of the current block is included in the MPM list.
If the intra prediction mode of the current block is an MPM mode, the decoding apparatus may generate an MPM list in general intra-prediction (S1040) and parse the MPM index for the current block (S1020). The decoding apparatus may derive an MPM candidate indicated by the MPM index from among MPM candidates of the MPM list as an intra prediction mode of the current block.
On the other hand, if the intra prediction mode of the current block is not an MPM mode, that is, if the intra prediction mode of the current block is not included in MPM candidates, the decoding apparatus may parse remaining intra prediction mode information representing one of the remaining intra prediction modes that are not included in the MPM candidates of the MPM list (S1045). The decoding apparatus may derive an intra prediction mode indicated by the remaining intra prediction mode information from among the remaining intra prediction modes as the intra prediction mode of the current block.
As described above, an MPM list including six MPM candidates may be configured using different methods according to intra-predictions. However, if an MPM list generation method depends on an intra-prediction execution method, coding complexity may be improved and coding efficiency may be deteriorated.
Accordingly, the present disclosure proposes a method of modifying MPM list generation methods used in the conventional general intra-prediction, MRL based intra-prediction and ISP into a generalized method. That is, the present disclosure proposes a method of generating an MPM list using a generalized method. It is possible to simplify an intra-prediction encoding/decoding structure and to improve the efficiency of encoding/decoding using an intra prediction mode to enhance video coding efficiency by using the generalized MPM list generation method.
As an embodiment, a method of generating an MPM list using the generalized method and then applying an MPM candidate in the MPM list as an intra prediction mode in the conventional general intra-prediction, MRL based intra-prediction and ISP intra-prediction is proposed.
For example, the method of generating an MPM list including six MPM candidates used in the conventional general intra-prediction may be applied as an MPM list generation method for MRL based intra-prediction and the ISP-based intra-prediction. Here, the MPM list generation method may be a conventional MPM list generation method or a method enhanced from the conventional MPM list generation method. The aforementioned method of generating an MPM list including six MPM candidates used in the conventional general intra-prediction is a method of generating an MPM list in consideration of all the 67 intra prediction modes, and the MPM list may include the planar intra prediction mode and/or the DC intra prediction mode as MPM candidates. However, since the planar intra prediction mode and the DC intra prediction mode are not used in the MRL based intra-prediction and the DC intra prediction mode is not used in the ISP based intra-prediction, an MPM list construction method different from the conventional method may be required for the MRL based intra-prediction and the ISP based intra-prediction.
If any of the MRL and ISP is not applied to the current block, the decoding apparatus may parse an 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 may indicate whether the intra prediction mode of the current block is included in the MPM candidates of the MPM list.
When the intra prediction mode of the current block is an MPM mode, that is, when the MPM flag indicates that the intra prediction mode of the current block is included in the MPM candidates of the MPM list (e.g., when the MPM flag is 1), the decoding apparatus may generate the MPM list of the current block (S1120). Here, the MPM list may be the same as the MPM list generated when MRL or ISP is applied to the current block. Subsequently, the decoding apparatus may parse the MPM index for the current block (S1130) and derive the MPM candidate indicated by the MPM index from among the MPM candidates of the MPM list as an intra prediction mode of the current block.
On the other hand, when the intra prediction mode of the current block is not an MPM mode, that is, when the MPM flag indicates that the intra prediction mode of the current block is not included in the MPM candidates of the MPM list (e.g., when the MPM flag is 0), the decoding apparatus may parse remaining intra prediction mode information of the current block (S1160). The decoding apparatus may derive an intra prediction mode indicated by the remaining intra prediction mode information from among the remaining intra prediction modes as the intra prediction mode for the current block.
The MPM list generation method proposed in the present embodiment and commonly used in the general intra-prediction, the MRL based intra-prediction, and the ISP based intra-prediction may be the same as the following examples.
An example of the MPM list generation method may be as shown in the following table.
According to an example of the MPM list generation method shown in Table 3, the encoding apparatus/decoding apparatus may derive MIPM candidate 0 as an intra prediction mode of a left neighboring block of the current block, may derive MIPM candidate 1 as the DC intra prediction mode if the derived MIPM candidate 0 is the planar intra prediction mode, may derive MIPM candidate 1 as the planar intra prediction mode if the derived MPM candidate 0 is not the planar intra prediction mode, may derive MIPM candidate 2 as a vertical intra prediction mode, may derive MPM candidate 3 as a horizontal intra prediction mode, may derive MPM candidate 4 as an intra prediction mode corresponding to a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, intra prediction mode #46, and may derive MPM candidate 5 as an intra prediction mode corresponding to a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, that is, intra prediction mode #54.
Thereafter, the encoding apparatus/decoding apparatus may determine whether the intra prediction mode of the left neighboring block of the current block is identical to the intra prediction mode of a top neighboring block, and construct an MPM list based on whether the intra prediction mode of the left neighboring block is identical to the intra prediction mode of the top neighboring block. For example, when the intra prediction mode of the left neighboring block is identical to the intra prediction mode of the top neighboring block, the encoding apparatus/decoding apparatus may 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, derive an MPM list of the current block which includes the derived MPM candidate 0 to MPM candidate 5, as described below.
That is, MPM candidate 0 of the MPM list may be derived as the intra prediction mode of the left neighboring block, MPM candidate 1 of the MPM list may be derived as the planar intra prediction mode, MPM candidate 2 of the MPM list may be derived as the DC intra prediction mode, MPM candidate 3 of the MPM list may be derived as an intra prediction mode having a mode number of ((leftIntraDir+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the intra prediction mode of the left neighboring block and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, MPM candidate 4 of the MPM list may be derived as an intra prediction mode having a mode number of ((leftIntraDir−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, and MPM candidate 5 of the MPM list may 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 value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the intra prediction mode of the left neighboring block and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
For example, if the intra prediction mode of the left neighboring block is identical to the intra prediction mode of the top neighboring block and the mode number of the intra prediction mode of the left neighboring block is not greater than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may derive an MPM list of the current block which includes previously derived MPM candidate 0 to MPM candidate 5.
On the other hand, if the intra prediction mode of the left neighboring block is not identical to the intra prediction mode of the top neighboring block, for example, the encoding apparatus/decoding apparatus may derive the intra prediction mode of the left neighboring block of the current block as MPM candidate 0 of the MPM list and may derive the intra prediction mode of the top neighboring block of the current block as MPM candidate 1 of the MPM list. Further, the encoding apparatus/decoding apparatus may derive maxCandModeIdx as 0 if the mode number of MPM candidate 0 is greater than the mode number of MPM candidate 1 and may derive maxCandModeIdx as 1 if the mode number of MPM candidate 0 is not greater than the mode number of MPM candidate 1.
Then, if the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the top neighboring block are greater than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may derive the planar intra prediction mode as MPM candidate 2 of the MPM list and may derive the DC intra prediction mode as MPM candidate 3 of the MPM list.
Then, if a value obtained by subtracting a mode number of mpm[!maxCandModeIdx] from a mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the encoding apparatus/decoding apparatus may derive an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2 as MPM candidate 4 of the MPM list and derive an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2 as MPM candidate 5 of the MPM list. Here, mpm[maxCandModeIdx] may indicate MPM candidate 0 and mpm[!maxCandModeIdx] may indicate MPM candidate 1 if maxCandModeIdx is 0, and mpm[maxCandModeIdx] may indicate MPM candidate 1 and mpm[!maxCandModeIdx] may indicate MPM candidate 0 if maxCandModeIdx is 1.
Further, if the value obtained by subtracting the mode number of mpm[!maxCandModeIdx] from the mode number of mpm[maxCandModeIdx] is equal to or greater than 63 or equal to or less than 1, the encoding apparatus/decoding apparatus may derive an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2 as MPM candidate 4 of the MPM list and may derive an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]) % mod)+2 as MPM candidate 5 of the MPM list.
For example, 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 top neighboring block is not greater than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may 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 top neighboring block is equal to or greater than 2, and if 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 top neighboring block is equal to or greater than 2, derive MPM candidate 2 to MPM candidate 5 as follows.
That is, MPM candidate 2 of the MPM list may be derived as the DC intra prediction mode if mpm[!maxCandModeIdx] is the planar intra prediction mode and may be derived as the planar intra prediction mode if mpm[!maxCandModeIdx] is not the planar intra prediction mode. In addition, MPM candidate 3 of the MPM list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, MPM candidate 4 of the MPM list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number, and MPM candidate 5 of the MPM list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
Otherwise, another example of the MPM list generation method may be used. Another example of the MPM list generation method may be as shown in the following table.
According to an example of the MPM list generation method shown in Table 4, the encoding apparatus/decoding apparatus may derive MPM candidate 0 for the current block as an intra prediction mode of the left neighboring block of the current block, may derive MPM candidate 1 as the DC intra prediction mode if the derived MPM candidate 0 is the planar intra prediction mode, may derive MPM candidate 1 as the planar intra prediction mode if the derived MPM candidate 0 is not the planar intra prediction mode, may derive MPM candidate 2 as a vertical intra prediction mode, may derive MPM candidate 3 as a horizontal intra prediction mode, may derive MPM candidate 4 as an intra prediction mode corresponding to a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, intra prediction mode #46, and may derive MPM candidate 5 as an intra prediction mode corresponding to a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, that is, intra prediction mode #54.
Thereafter, the encoding apparatus/decoding apparatus may determine whether the intra prediction mode of the left neighboring block of the current block is identical to the intra prediction mode of the top neighboring block, and construct an MPM list based on whether the intra prediction mode of the left neighboring block is identical to the intra prediction mode of the top neighboring block. For example, when the intra prediction mode of the left neighboring block is identical to the intra prediction mode of the top neighboring block, the encoding apparatus/decoding apparatus may 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, derive an MPM list of the current block which includes the derived MPM candidate 0 to MPM candidate 5, as described below.
That is, MPM candidate 0 of the MPM list may be derived as the intra prediction mode of the left neighboring block, MPM candidate 1 of the MPM list may be derived as the planar intra prediction mode, MPM candidate 2 of the MPM list may be derived as an intra prediction mode having a mode number of ((leftIntraDir+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the intra prediction mode of the left neighboring block and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, MPM candidate 3 of the MPM list may be derived as an intra prediction mode having a mode number of ((leftIntraDir−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, MPM candidate 4 of the MPM list may be derived as the DC intra prediction mode, and MPM candidate 5 of the MPM list may 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 value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the intra prediction mode of the left neighboring block and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
For example, if the intra prediction mode of the left neighboring block is identical to the intra prediction mode of the top neighboring block and the mode number of the intra prediction mode of the left neighboring block is not greater than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may derive an MPM list of the current block which includes previously derived MPM candidate 0 to MPM candidate 5.
On the other hand, if the intra prediction mode of the left neighboring block is not identical to the intra prediction mode of the top neighboring block, for example, the encoding apparatus/decoding apparatus may derive the intra prediction mode of the left neighboring block of the current block as MPM candidate 0 of the MPM list and may derive the intra prediction mode of the top neighboring block of the current block as MPM candidate 1 of the MPM list. Further, the encoding apparatus/decoding apparatus may derive maxCandModeIdx as 0 if the mode number of MPM candidate 0 is greater than the mode number of MPM candidate 1 and may derive maxCandModeIdx as 1 if the mode number of MPM candidate 0 is not greater than the mode number of MPM candidate 1.
Then, if the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the top neighboring block are greater than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may derive the planar intra prediction mode as MPM candidate 1 of the MPM list and may derive the intra prediction mode of the top neighboring block as MPM candidate 2 of the MPM list. Further, the encoding apparatus/decoding apparatus may derive maxCandModeIdx as 0 if the mode number of MPM candidate 0 is greater than the mode number of MPM candidate 2 and may derive maxCandModeIdx as 2 if the mode number of MPM candidate 0 is not greater than the mode number of MPM candidate 2. In addition, the encoding apparatus/decoding apparatus may derive minCandModeidx as 2 if the mode number of MPM candidate 0 is greater than the mode number of MPM candidate 2 and may derive maxCandModeIdx as 0 if the mode number of MPM candidate 0 is not greater than the mode number of MPM candidate 2. Further, the encoding apparatus/decoding apparatus may derive the DC intra prediction mode as MPM candidate 3 of the MPM list.
Then, if a value obtained by subtracting a mode number of mpm[minCandModeidx] from a mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the encoding apparatus/decoding apparatus may derive an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2 as MPM candidate 4 of the MPM list and derive an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2 as MPM candidate 5 of the MPM list. Here, mpm[maxCandModeIdx] may be MPM candidate 0 if maxCandModeIdx is 0, mpm[maxCandModeIdx] may be MPM candidate 1 if maxCandModeIdx is 1, mpm[maxCandModeIdx] may be MPM candidate 2 if maxCandModeIdx is 2, mpm[minCandModeidx] may be MPM candidate 0 if minCandModeidx is 0, and mpm[minCandModeidx] may be MPM candidate 2 if minCandModeidx is 2.
Further, if the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is equal to or greater than 63 or equal to or less than 1, the encoding apparatus/decoding apparatus may derive an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2 as MPM candidate 4 of the MPM list and may derive an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]) % mod)+2 as MPM candidate 5 of the MPM list.
For example, 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 top neighboring block is not greater than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may 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 top neighboring block is equal to or greater than 2, and if 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 top neighboring block is equal to or greater than 2, determine whether at least one of the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block is identical to the planar intra prediction mode.
If at least one of the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block is identical to the planar intra prediction mode, the encoding apparatus/decoding apparatus may derive MPM candidate 0 and MPM candidate 1 as follows.
That is, MPM candidate 0 of the MPM list may be derived as the planar intra prediction mode, MPM candidate 1 of the MPM list may be derived as the intra prediction mode of the top neighboring block if the mode number of the intra prediction mode of the left neighboring block is less than the mode number of the intra prediction mode of the top neighboring block, and MPM candidate 1 of the MPM list may be derived as the intra prediction mode of the left neighboring block if the mode number of the intra prediction mode of the left neighboring block is equal to or greater than the mode number of the intra prediction mode of the top neighboring block. Further, maxCandModeIdx may be derived as 1.
On the other hand, if the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring 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. Further, maxCandModeIdx may be previously derived value.
Further, if 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 top neighboring block is equal to or greater than 2, the encoding apparatus/decoding apparatus may derive MPM candidate 2 to MPM candidate 5 as follows.
That is, MPM candidate 2 of the MPM list may be derived as the DC intra prediction mode if mpm[!maxCandModeIdx] is the planar intra prediction mode and may be derived as the planar intra prediction mode if mpm[!maxCandModeIdx] is not the planar intra prediction mode. In addition, MPM candidate 3 of the MPM list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, MPM candidate 4 of the MPM list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number, and MPM candidate 5 of the MPM list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
Otherwise, another example of the MPM list generation method may be used. Another example of the MPM list generation method may be as shown in the following table.
According to an example of the MPM list generation method shown in Table 5, the encoding apparatus/decoding apparatus may determine whether the intra prediction mode of the left neighboring block of the current block is identical to the intra prediction mode of the top neighboring block.
If the intra prediction mode of the left neighboring block is identical to the intra prediction mode of the top neighboring block, the encoding apparatus/decoding apparatus may 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, may derive an MPM list of the current block which includes MPM candidate 0 to MPM candidate 2 derived as described later.
That is, MPM candidate 0 of the MPM list may be derived as the intra prediction mode of the left neighboring block. In addition, MPM candidate 1 of the MPM list may be derived as an intra prediction mode having a mode number of ((g_intraMode65to33AngMapping[leftIntraDir]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the intra prediction mode of the left neighboring block and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, and MPM candidate 2 of the MPM list may be derived as an intra prediction mode having a mode number of ((g_intraMode65to33AngMapping[leftIntraDir]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number.
If the mode number of the intra prediction mode of the left neighboring block is equal to or less than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may derive an MPM list of the current block which includes MPM candidate 0 to MPM candidate 2 derived as described later.
That is, MPM candidate 0 of the MPM list may be derived as the planar intra prediction mode, MPM candidate 1 of the MPM list may be derived as the DC intra prediction mode, and MPM candidate 2 of the MPM list may be derived as a vertical intra prediction mode.
On the other hand, the intra prediction mode of the left neighboring block is not identical to the intra prediction mode of the top neighboring block, the encoding apparatus/decoding apparatus may derive MPM candidate 0 as the intra prediction mode of the left neighboring block of the current block and may derive MPM candidate 1 as the intra prediction mode of the top neighboring block of the current block.
If both the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block are not the planar intra prediction mode, the encoding apparatus/decoding apparatus may derive MPM candidate 2 as the planar intra prediction mode. If at least one of the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block is the planar intra prediction mode, the encoding apparatus/decoding apparatus may 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 top neighboring block is less than 2, derive MPM candidate 2 as a vertical intra prediction mode if 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 top neighboring block is less than 2, and derive MPM candidate 2 as the DC intra prediction mode if 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 top neighboring block is equal to or greater than 2.
Furthermore, the present disclosure proposes another embodiment of modifying MPM list generation methods used in the conventional general intra-prediction, MRL based intra-prediction, and ISP based intra-prediction into a generalized method. A method that does not consider an intra prediction mode that is not used for multi-reference line intra-prediction and sub-partition intra-prediction in an encoder stage is proposed.
As an example, when an encoder performs multi-reference line intra-prediction, the encoder performs inter-prediction in consideration of only intra prediction modes included in an MPM list. For example, an example in which intra prediction modes that are not used for MRL and/or ISP are not considered in generation of an MPM list may be proposed in the present embodiment.
That is, when the encoding apparatus performs MRL based intra-prediction, for example, the encoding apparatus may perform intra-prediction in consideration of only intra prediction modes included in an MPM list. That is, when the MPM list includes the planar intra prediction mode or the DC intra prediction mode, the encoding apparatus may not select the planar intra prediction mode or the DC intra prediction mode as an intra prediction mode of the current block in the present embodiment. Further, as an example similar to the aforementioned example, when the encoding apparatus performs ISP, the encoding apparatus may skip the DC intra prediction mode when the MPM list includes the DC intra prediction mode.
An MPM mode generation method and a mode decoding method proposed in the present embodiment may be the same as the MPM mode generation method and the mode decoding method of the above-described embodiment and may include a feature in which a specific intra prediction mode is not considered only at the time of encoding. Accordingly, coding efficiency may be reduced to some degree during MPM index encoding and decoding, but hardware and software implementation complexity can be reduced according to generation a generalized MPM list, and MRL based intra-prediction and ISP which do not use a specific intra prediction mode can be maintained.
The present embodiment proposes a method of performing intra-prediction, by the encoding apparatus, irrespective of a specific intra prediction mode when MRL based intra-prediction and/or ISP are applied. In this case, an MPM index parsed by the decoding apparatus may not indicate the specific intra prediction mode.
For example, an example in which 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 may be proposed.
If MRL is applied to the current block, the encoding apparatus may generate an MPM list for the current block through an MPM list generation process (S1215). Thereafter, the encoding apparatus may perform intra-prediction on the current block based on MPM candidates in the MPM list except the planar intra prediction mode and the DC intra prediction mode (i.e., intra prediction modes derived as MPM candidates of the MPM list except the planar intra prediction mode and the DC intra prediction mode) (S1220) and select an optimal intra prediction mode for the current block (S1225).
If ISP is applied to the current block instead of MRL, the encoding apparatus may 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 above-described MPM list generation process performed when MRL is applied. Thereafter, the encoding apparatus may perform intra-prediction on the current block based on MPM candidates in the MPM list except the DC intra prediction mode (i.e., intra prediction modes derived as MPM candidates of the MPM list except the DC intra prediction mode) (S1235) and select an optimal intra prediction mode for the current block (S1240).
If MRL and ISP are not applied to the current block, the encoding apparatus may perform general intra-prediction on the current block based on 67 intra prediction modes (S1245) and select an optimal intra prediction mode for the current block (S1250).
As another example, an example 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 may be proposed.
If MRL is applied to the current block, the encoding apparatus may generate an MPM list for the current block through an MPM list generation process (S1315). Thereafter, the encoding apparatus may perform intra-prediction on the current block based on MPM candidates in the MPM list except the planar intra prediction mode (i.e., intra prediction modes derived as MPM candidates of the MPM list except the planar intra prediction mode) (S1320) and select an optimal intra prediction mode for the current block (S1325).
If ISP is applied to the current block instead of MRL, the encoding apparatus may 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 above-described MPM list generation process performed when MRL is applied. Thereafter, the encoding apparatus may perform intra-prediction on the current block based on MPM candidates in the MPM list except the DC intra prediction mode (i.e., intra prediction modes derived as MPM candidates of the MPM list except the DC intra prediction mode) (S1335) and select an optimal intra prediction mode for the current block (S1340).
If MRL and ISP are not applied to the current block, the encoding apparatus may perform general intra-prediction on the current block based on 67 intra prediction modes (S1345) and select an optimal intra prediction mode for the current block (S1350).
As another example, an example in which encoding using the planar intra prediction mode is prohibited when MRL based intra-prediction is applied may be proposed.
If MRL is applied to the current block, the encoding apparatus may generate an MPM list for the current block through an MPM list generation process (S1415). Thereafter, the encoding apparatus may perform intra-prediction on the current block based on MPM candidates in the MPM list except the planar intra prediction mode (i.e., intra prediction modes derived as MPM candidates of the MPM list except the planar intra prediction mode) (S1420) and select an optimal intra prediction mode for the current block (S1425).
If ISP is applied to the current block instead of MRL, the encoding apparatus may 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 above-described MPM list generation process performed when MRL is applied. Thereafter, the encoding apparatus may perform intra-prediction on the current block based on MPM candidates in the MPM list (i.e., intra prediction modes derived as MPM candidates of the MPM list) (S1435) and select an optimal intra prediction mode for the current block (S1440).
If MRL and ISP are not applied to the current block, the encoding apparatus may perform general intra-prediction on the current block based on 67 intra prediction modes (S1445) and select an optimal intra prediction mode for the current block (S1450).
Meanwhile, the present disclosure proposes a method of more efficiently performing intra prediction performed based on the DC intra prediction mode when the MRL is applied. For example, the present 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 the MRL and the intra prediction mode of the current block is the DC intra prediction mode).
(a) of
For example, the DC value may be derived as the following equation.
Herein, dcVal may represent the DC value, nTbW may represent the width of the current block, refIdx may represent the reference line indicated by the reference line index.
Also, (b) of
Herein, dcVal may represent the DC value, nTbW may represent the width of the current block, refIdx may represent the reference line indicated by the reference line index.
Also, for example, when the width of the current block is smaller than the height, the DC value may be derived based on the same number of reference samples as the height from the top end reference sample in the left reference line of the current block. In other words, when the size of the current block is W×H and 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 (−refIdx−1, 0) coordinate reference sample to (−refIdx−1, H−1) coordinate reference sample in the left reference line indicated by the reference line index. The DC value may be derived as the following equation.
Herein, dcVal may represent the DC value, nTbH may represent the height of the current block, refIdx may represent the reference line indicated by the reference line index.
Thereafter, the prediction sample of the current block may be derived as the DC value.
Meanwhile, the present disclosure proposes a method of more efficiently performing intra prediction performed based on the planar intra prediction mode when the MRL is applied. For example, the present embodiment proposes a method for determining reference samples for planar prediction 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 the MRL and the intra prediction mode of the current block is the planar intra prediction mode).
Referring to
Referring to the present embodiment, the planar intra prediction may be performed using reference samples of the reference line indicated by the reference line index, and specifically, the planar intra prediction 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, and a top reference sample in the same column (i.e., the same x-coordinate) as the current sample position, among the reference samples of the reference line and the reference sample of (W, −refIdx−1) coordinates in the top reference line and the reference sample of (−refIdx−1, H) coordinates in the left reference line. In this case, a prediction sample value of the current sample may be derived by performing bidirectional linear interpolation based on values of the above-described four reference samples. Here, the bidirectional linear interpolation may be performed assuming that the bottom left reference sample is located at the lower side of the current sample and the right top reference sample is located at the right side of the current sample.
Meanwhile, an embodiment different from the embodiments of the MPM list generation method commonly used in the above-described general intra prediction, the MRL, and the ISP may be used. That is, the present disclosure proposes another example of the MPM list generation method commonly used in the general intra prediction, the MRL, and the ISP. Another example of the MPM list generation method may be as shown in the following table.
According to an example of the MIPM list generation method shown in Table 6, the encoding apparatus/decoding apparatus may derive an intra prediction mode of the left neighboring block and an intra prediction mode of the top neighboring block of the current block. The intra prediction mode of the left neighboring block may be expressed as leftIntraDir, and the intra prediction mode of the top neighboring block may be expressed as aboveIntraDir.
Also, for example, the encoding apparatus/decoding apparatus may derive a default MIPM list. For example, the encoding apparatus/decoding apparatus may derive the planar intra prediction mode as a MIPM candidate 0 of the default MIPM list, the DC intra prediction mode as a MIPM candidate 1 of the default MIPM list, the vertical intra prediction mode as a MIPM candidate 2 of the default MPM list, the horizontal intra prediction mode as a MPM candidate 3 of the default MPM list, an intra prediction mode of the mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, the intra prediction mode #46 as a MPM candidate 4 of the default MPM list, an intra prediction mode of the mode number obtained by adding 4 from the mode number of the vertical intra prediction mode, that is, the intra prediction mode #54 as a MPM candidate 5 of the default MPM list.
Thereafter, the encoding apparatus/decoding apparatus may determine whether the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current 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.
For example, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top 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 apparatus/decoding apparatus may derive the MPM list of the current block including the derived MPM candidate 0 to MPM candidate 5 as described below.
That is, MPM candidate 0 of the MPM list may be derived as the planar intra prediction mode, MPM candidate 1 of the MPM list may be derived as the intra prediction mode of the left neighboring block, MPM candidate 2 of the MPM list may be derived as an intra prediction mode having a mode number of 2+((leftIntraDir+61) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 61 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, MPM candidate 3 of the MPM list may be derived as an intra prediction mode having a mode number of 2+((leftIntraDir−1) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, MPM candidate 4 of the MPM list may be derived as the DC intra prediction mode, and MPM candidate 5 of the MPM list may be derived as an intra prediction mode having a mode number of 2+((leftIntraDir+60) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 60 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number.
Meanwhile, when the intra prediction mode of the left neighboring block of the current block and the intra prediction mode of the top neighboring block are not the same, the encoding apparatus/decoding apparatus may determine 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 the mode number of the intra prediction mode of the top neighboring block is greater than the mode number of the DC intra prediction mode.
When 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 the mode number of the intra prediction mode of the top neighboring block is greater than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may derive the planar intra prediction mode as a MPM candidate 0 of the MPM list, the intra prediction mode of the left neighboring block as a MPM candidate 1 of the MPM list, the intra prediction mode of the top neighboring block as a MPM candidate 2 of the MPM list, the DC intra prediction mode as a MPM candidate 3 of the MPM list. In addition, when the mode number of the MPM candidate 1 is greater than the mode number of the MPM candidate 2, the encoding apparatus/decoding apparatus may derive maxCandModeIdx as 1, when the mode number of the MPM candidate 1 is not greater than the mode number of the MPM candidate 2, the encoding apparatus/decoding apparatus may derive maxCandModeIdx as 2.
Thereafter, when a 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 apparatus/decoding apparatus may derive an intra prediction mode with a mode number of 2+((maxAB+61) % 64) as MPM candidate 4 of the MPM list, and an intra prediction mode with a mode number of 2+((maxAB−1) % 64) as MPM candidate 5 of the MPM list. Here, when the maxCandModeIdx is 1, mpm[maxCandModeIdx] may be MPM candidate 1, when the maxCandModeIdx is 2, mpm[maxCandModeIdx] may be MPM candidate 2, when the minCandModeidx is 1, mpm[minCandModeidx] may be MPM candidate 1, when the minCandModeidx is 2, mpm[minCandModeidx] may be MPM candidate 2. Also, here, maxAB may be a larger value 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 top neighboring block.
Alternatively, when the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is greater than or equal to 63 or less than or equal to 1, the encoding apparatus/decoding apparatus may derive an intra prediction mode with a mode number of 2+((maxAB+60) % 64) as MPM candidate 4 of the MPM list, and an intra prediction mode with a mode number of 2+(maxAB % 64) as MPM candidate 5 of the MPM list.
Meanwhile, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current 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 top neighboring block is smaller than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may 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 top neighboring block is equal to or greater than the mode number of the DC intra prediction mode.
When 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 top neighboring block is equal to or greater than the mode number of the DC intra prediction mode, the encoding apparatus/decoding apparatus may derive the MPM list of the current block including the derived MPM candidate 0 to MPM candidate 5 as described below.
That is, MPM candidate 0 of the MPM list may be derived as the planar intra prediction mode, MPM candidate 1 of the MPM list may be derived as the intra prediction mode of the top neighboring block when the mode number of the intra prediction mode of the left neighboring block is smaller than the mode number of the intra prediction mode of the top neighboring block, MPM candidate 1 of the MPM list may be derived as the intra prediction mode of the left neighboring block when the mode number of the intra prediction mode of the left neighboring block is greater than or equal to the mode number of the intra prediction mode of the left neighboring block, MPM candidate 2 of the MPM list may be derived as the DC intra prediction mode, MPM candidate 3 of the MPM list may be derived as an intra prediction mode having a mode number of 2+((maxAB+61) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 61 from the larger 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 top neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, MPM candidate 4 of the MPM list may be derived as an intra prediction mode having a mode number of 2+((maxAB−1) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by subtracting 1 from the larger 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 top neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, MPM candidate 5 of the MPM list may be derived as an intra prediction mode having a mode number of 2+((maxAB+60) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 60 from the larger 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 top neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number.
Meanwhile, the embodiment of the above-described method for generating the MPM list may be shown in the following table as source code.
In addition, the embodiment of the above-described method for generating the MIPM list may be shown in the following table in a standard format.
The following table shows the value for the intra prediction mode IntraPredModeY[xCb][yCb] and the associated names.
In Table 9, the intra prediction modes INTRA_LT_CCLM, INTRA_L_CCLM and INTRA_T_CCLM may be only applicable to chroma components.
Meanwhile, when the intra prediction according to the intra prediction mode of the current block is expressed in a standard format, it may be as shown in the following table.
In addition, an embodiment of the planar intra prediction mode-based intra prediction performed when the MRL is applied in the present disclosure may be shown in the following table in a standard format.
In addition, an embodiment of the DC intra prediction mode-based intra prediction performed when the MRL is applied in the present disclosure may be shown in the following table in a standard format.
In addition, a horizontal transform kernel and a vertical transform kernel derived according to the intra prediction mode may be as follows.
For example, when the intra prediction mode of the current block is determined as the DC intra prediction mode, DCT2 may be used as a vertical transformation kernel for transform/inverse transform for the residual of the current block, and DCT2 may be used as a horizontal transform kernel.
Meanwhile, according to the present disclosure, a first bin among bins of a bin string of the syntax element of the MPM index may be coded based on context-based regular coding, remaining bins of the bin string may be bypass coded.
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 a value of an ISP flag for the current block and/or a value of a reference line index for the current block as follows.
For example, referring to Table 13, when the value of the reference line index is not 0, the ctxInc may be derived as 2, when the value of the reference line index is 0, if the value of the ISP flag is 1, the ctxInc may be derived as 0, and if the value of the ISP flag is not 1, the ctxInc may be derived as 1.
Meanwhile, the present disclosure proposes another embodiment of more efficiently performing intra prediction performed based on the DC intra prediction mode when the MRL is applied.
(a) of
Also, (b) of
Also, for example, when the width of the current block is smaller than the height, the DC value may be derived based on the same number of reference samples as the height from the (−refIdx−1, −refIdx) coordinate reference sample in the left reference line of the current block. For example, when the value of the reference line index is 0, the DC value may be derived based on the number of reference samples equal to the height from a reference sample of (−1, 0) coordinates in the left reference line 0 of the current block, when the value of the reference line index is 1, the DC value may be derived based on the number of reference samples equal to the height from a reference sample of (−2, −1) coordinates in the left reference line 1 of the current block, when the value of the reference line index is 2, the DC value may be derived based on the number of reference samples equal to the height from a reference sample of (−3, −2) coordinates in the left reference line 2 of the current block, when the value of the reference line index is 3, the DC value may be derived based on the number of reference samples equal to the height from a reference sample of (−4, −3) coordinates in the left reference line 3 of the current block.
Thereafter, the prediction sample of the current block may be derived as the DC value.
An embodiment of the DC intra prediction mode-based intra prediction performed when the MRL is applied in the present disclosure may be shown in the following table in a standard format.
Meanwhile, the present disclosure proposes another embodiment of more efficiently performing intra prediction performed based on the planar intra prediction mode when the MRL is applied.
Referring to
Referring to the present embodiment, the planar intra prediction may be performed using reference samples of the reference line indicated by the reference line index, and specifically, the planar intra prediction 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, and a top reference sample in the same column (i.e., the same x-coordinate) as the current sample position, among the reference samples of the reference line and the reference sample of (W-refIdx, −refIdx−1) coordinates in the top reference line and the reference sample of (−refIdx−1, H-refIdx) coordinates in the left reference line. In this case, a prediction sample value of the current sample may be derived by performing bidirectional linear interpolation based on values of the above-described four reference samples. Here, the bidirectional linear interpolation may be performed assuming that the bottom left reference sample is located at the lower side of the current sample and the right top reference sample is located at the right side of the current sample.
An embodiment of the planar intra prediction mode-based intra prediction performed when the MRL is applied in the present disclosure may be shown in the following table in a standard format.
The encoding apparatus determines an intra prediction type for a current block among intra prediction types (S1900). The encoding apparatus may determine an intra prediction type for the current block from among the intra prediction types. For example, the encoding apparatus may determine the intra prediction type for the current block in consideration of rate distortion (RD) cost. The above-described intra prediction types may include a first intra prediction type using intra-prediction reference lines adjacent to the current block, a second intra prediction type using intra-prediction reference lines that are not adjacent to the current block, and a third intra prediction type to which intra sub-partitions mode (ISP) is applied. The first intra prediction type may indicate the above-described general intra-prediction, the second intra prediction type may indicate the above-described MRL, and the third intra prediction type may indicate the above-described ISP.
For example, the encoding apparatus may generate and encode a reference line index indicating an intra prediction reference line of the current block. It may be determined whether the intra prediction type for the current block is the second intra prediction type based on the reference line index. If the intra prediction type for the current block is not the second intra prediction type, for example, the encoding apparatus may generate and encode an ISP flag representing whether the third intra prediction type is applied to the current block. It may be determined whether the intra prediction type for the current block is the third intra prediction type based on the ISP flag. The intra prediction type for the current block may be derived as the third intra prediction type if the ISP flag indicates that the third intra prediction type is applied to the current block, and the intra prediction type for the current block may be derived as the first intra prediction type if the ISP flag indicates that the third intra prediction type is not applied to the current block. 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 may further include the ISP flag when the reference line index is 0. When the ISP flag is 1, the prediction related information may further include the ISP index.
The encoding apparatus constructs an intra prediction mode candidate list of the current block based on intra prediction modes of neighboring blocks of the current block (S1910).
For example, the encoding apparatus the intra prediction mode candidate list of the current block by performing the intra prediction mode candidate list construction process shown in Table 3. Meanwhile, the intra prediction mode candidate list may mean the above-described most probable mode (MPM) list.
For example, the encoding apparatus may construct the inter-prediction mode candidate list based on a first candidate intra prediction mode and a second candidate intra prediction mode. The encoding apparatus may construct the inter-prediction mode candidate list based on whether the first candidate intra prediction mode is identical to the second candidate intra prediction mode 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 are greater than the mode number of the DC intra prediction mode. Here, the first candidate intra prediction mode may be derived based on the intra prediction mode of the left neighboring block of the current block and the second candidate intra prediction mode may be derived based on the intra prediction mode of the top neighboring block of the current block. For example, the intra prediction mode of the left neighboring block of the current block may be derived as the first candidate intra prediction mode and the intra prediction mode of the top neighboring block of the current block may be derived as the second candidate intra prediction mode.
Specifically, when the first candidate intra prediction mode is identical to the second candidate intra prediction mode, for example, the encoding apparatus may 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 if the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, derive the intra prediction mode candidate list for the current block which includes intra prediction mode candidates as follows.
Here, mpm[0], mpm[1], mpm[2], mpm[3], mpm[4], and 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 may be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of (leftIntraDir+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((leftIntraDir−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may 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 value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
For example, when the first candidate intra prediction mode is not identical to the second candidate intra prediction mode, the encoding apparatus may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode. Further, maxCandModeIdx may be derived as 0 if the mode number of intra prediction mode candidate 0 is greater than the mode number of intra prediction mode candidate 1 and maxCandModeIdx may be derived as 1 if the mode number of intra prediction mode candidate 0 is not greater than the mode number of intra prediction mode candidate 1.
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 apparatus may derive intra prediction mode candidate 2 and intra prediction mode candidate 3 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, and intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as the DC intra prediction mode.
Then, if a value obtained by subtracting a mode number of mpm[!maxCandModeIdx] from a mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the encoding apparatus/decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number.
If the value obtained by subtracting the mode number of mpm[!maxCandModeIdx] from the mode number of mpm[maxCandModeIdx] is equal to or greater than 63 or equal to or less than 1, the encoding apparatus/decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx] % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number.
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 apparatus 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 equal to or greater than 2. 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 equal to or greater than 2, the encoding apparatus may derive intra prediction mode candidate 2 to intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the DC intra prediction mode if mpm[!maxCandModeIdx] is the planar intra prediction mode and may be derived as the planar intra prediction mode if mpm[!maxCandModeIdx] is not the planar intra prediction mode. In addition, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
If the aforementioned conditions are not satisfied, the encoding apparatus may derive intra prediction mode candidate 0 to intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the DC intra prediction mode if intra prediction mode candidate 0 is the planar intra prediction mode and derived as planar intra prediction mode if intra prediction mode candidate 0 is not the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as a vertical intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as a horizontal intra prediction mode, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode corresponding to a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, intra prediction mode #46, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode corresponding to a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, that is, intra prediction mode #54.
For example, the encoding apparatus may perform the intra prediction mode candidate list construction process shown in Table 4 to construct the intra prediction mode candidate list for the current block.
For example, the encoding apparatus may construct the intra prediction mode candidate list based on the first candidate intra prediction mode and the second candidate intra prediction mode. The encoding apparatus may construct the inter-prediction mode candidate list based on whether the first candidate intra prediction mode is identical to the second candidate intra prediction mode and/or whether the mode number of the first candidate intra prediction mode and/or the mode number of the second candidate intra prediction mode are greater than the mode number of the DC intra prediction mode. Here, the first candidate intra prediction mode may be derived based on the intra prediction mode of the left neighboring block of the current block and the second candidate intra prediction mode may be derived based on the intra prediction mode of the top neighboring block of the current block. For example, the intra prediction mode of the left neighboring block of the current block may be derived as the first candidate intra prediction mode and the intra prediction mode of the top neighboring block of the current block may be derived as the second candidate intra prediction mode.
Specifically, when the first candidate intra prediction mode is identical to the second candidate intra prediction mode, for example, the encoding apparatus may 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 if the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, derive the intra prediction mode candidate list for the current block which includes intra prediction mode candidates as follows.
Here, mpm[0], mpm[1], mpm[2], mpm[3], mpm[4], and 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 may be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((leftIntraDir+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((leftIntraDir−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, and intra prediction mode candidate 5 of the intra prediction mode candidate list may 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 value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
For example, when the first candidate intra prediction mode is not identical to the second candidate intra prediction mode, the encoding apparatus may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode. Further, the encoding apparatus may derive maxCandModeIdx as 0 if the mode number of intra prediction mode candidate 0 is greater than the mode number of intra prediction mode candidate 1 and derive maxCandModeIdx as 1 if the mode number of intra prediction mode candidate 0 is not greater than the mode number of intra prediction mode candidate 1.
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 apparatus may derive intra prediction mode candidate 1 to intra prediction mode candidate 3 as follows.
That is, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode, and intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as the DC intra prediction mode. Further, the encoding apparatus may derive maxCandModeIdx as 0 if the mode number of intra prediction mode candidate 0 is greater than the mode number of intra prediction mode candidate 2 and derive maxCandModeIdx as 2 if the mode number of intra prediction mode candidate 0 is not greater than the mode number of intra prediction mode candidate 2. Further, the encoding apparatus may derive minCandModeidx as 2 if the mode number of intra prediction mode candidate 0 is greater than the mode number of intra prediction mode candidate 2 and derive minCandModeidx as 0 if the mode number of intra prediction mode candidate 0 is not greater than the mode number of intra prediction mode candidate 2.
If a value obtained by subtracting a mode number of mpm[minCandModeidx] from a mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the encoding apparatus/decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number.
If the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is equal to or greater than 63 or equal to or less than 1, the encoding apparatus/decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number.
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 apparatus 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 equal to or greater than 2. 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 equal to or greater than 2, the encoding apparatus may determine whether at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is the planar intra prediction mode.
If at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is the planar intra prediction mode, the encoding apparatus may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode if the mode number of the first candidate intra prediction mode is less than the mode number of the second candidate intra prediction mode and derived as the first candidate intra prediction mode if the mode number of the first candidate intra prediction mode is equal to or greater than the mode number of the second candidate intra prediction mode. Further, the encoding apparatus may derive maxCandModeIdx as 1.
If the first candidate intra prediction mode and the second candidate intra prediction mode are not the planar intra prediction mode, the encoding apparatus may derive intra prediction mode candidate 2 to intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the DC intra prediction mode if mpm[!maxCandModeIdx] is the planar intra prediction mode and may be derived as the planar intra prediction mode if mpm[!maxCandModeIdx] is not the planar intra prediction mode. In addition, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
If the aforementioned conditions are not satisfied, the encoding apparatus may derive intra prediction mode candidate 0 to intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the DC intra prediction mode if intra prediction mode candidate 0 is the planar intra prediction mode and derived as planar intra prediction mode if intra prediction mode candidate 0 is not the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as a vertical intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as a horizontal intra prediction mode, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode corresponding to a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, intra prediction mode #46, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode corresponding to a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, that is, intra prediction mode #54.
For example, the encoding apparatus may perform the intra prediction mode candidate list construction process shown in Table 5 to construct the intra prediction mode candidate list for the current block.
For example, the encoding apparatus may construct the intra prediction mode candidate list based on the first candidate intra prediction mode and the second candidate intra prediction mode. The encoding apparatus may construct the inter-prediction mode candidate list based on whether the first candidate intra prediction mode is identical to the second candidate intra prediction mode and/or whether the mode number of the first candidate intra prediction mode and/or the mode number of the second candidate intra prediction mode are greater than the mode number of the DC intra prediction mode. Here, the first candidate intra prediction mode may be derived based on the intra prediction mode of the left neighboring block of the current block and the second candidate intra prediction mode may be derived based on the intra prediction mode of the top neighboring block of the current block. For example, the intra prediction mode of the left neighboring block of the current block may be derived as the first candidate intra prediction mode and the intra prediction mode of the top neighboring block of the current block may be derived as the second candidate intra prediction mode.
Specifically, when the first candidate intra prediction mode is identical to the second candidate intra prediction mode, for example, the encoding apparatus may 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 if the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, derive the intra prediction mode candidate list for the current block which includes intra prediction mode candidates as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode. In addition, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((g_intraMode65to33AngMapping[leftIntraDir]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((g_intraMode65to33AngMapping[leftIntraDir]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode and adding 2 to the modulo arithmetic operation result, as a mode number.
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 apparatus may derive the intra prediction mode candidate list for the current block which includes intra prediction mode candidates as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, and intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as a vertical intra prediction mode.
Further, if the first candidate intra prediction mode is not identical to the second candidate intra prediction mode, the encoding apparatus may derive intra prediction mode candidate 0 and intra prediction mode candidate 1.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode.
Then, if both the first candidate intra prediction mode and the second candidate intra prediction mode are the planar intra prediction mode, the encoding apparatus may derive intra prediction mode candidate 2 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the planar intra prediction mode.
Otherwise, if at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is the planar intra prediction mode, the encoding apparatus may derive intra prediction mode candidate 2 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may 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 derived as the 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 equal to or greater than 2.
For example, the encoding apparatus may construct the intra prediction mode candidate list of the current block based on intra prediction modes of neighboring blocks of the current block as shown in Table 6. Meanwhile, the intra prediction mode candidate list may mean the above-described most probable mode (MPM) list.
For example, the encoding apparatus may construct the intra prediction mode candidate list based on an intra prediction mode of a left neighboring block of the current block and an intra prediction mode of a top neighboring block of the current block. The encoding apparatus may determine whether the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are the same and a mode number of the intra prediction mode of the left neighboring block is greater than a mode number of a DC intra prediction mode. The encoding apparatus may construct the intra prediction mode candidate list based on whether the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are the same and/or 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.
When the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current 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 apparatus may derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the intra prediction mode of the left neighboring block, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((candIntraPredModeA+61) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 61 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((candIntraPredModeA−1) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((candIntraPredModeA+60) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 60 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number. That is, for example, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top 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 top neighboring block, an intra prediction mode with mode number 2+((candIntraPredModeA+61)% 64), an intra prediction mode with mode number 2+((candIntraPredModeA−1)% 64), and an intra prediction mode with mode number 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.
Meanwhile, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are not the same, for example, the encoding apparatus may determine whether at least one of a mode number of an intra prediction mode of the left neighboring block and a mode number of an intra prediction mode of the top neighboring block is greater than a mode number of the DC intra prediction mode. When 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 top neighboring block is greater than the mode number of the DC intra prediction mode, a variable minAB and a variable maxAB may be derived as follows.
Here, candIntraPredModeA may represent the mode number of the intra prediction mode of the left neighboring block of the current block, and candIntraPredModeB may represent the mode number of the intra prediction mode of the top neighboring block of the current block. That is, minAB may represent 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 top neighboring block, maxAB may represent a larger 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 top neighboring block.
Also, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are not the same, the encoding apparatus may determine whether the mode number of an intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode and the mode number of the intra prediction mode of the top neighboring block is greater than the mode number of the DC intra prediction mode.
For example, when the mode number of an intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode and the mode number of the intra prediction mode of the top neighboring block is greater than the mode number of the DC intra prediction mode, the encoding apparatus may derive intra prediction mode candidate 0 to intra prediction mode candidate 3 as described below.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the intra prediction mode of the left neighboring block, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the intra prediction mode of the top neighboring block, and intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as the DC intra prediction mode. Here, candIntraPredModeB may represent the mode number of the intra prediction mode of the top neighboring block of the current block. That is, for example, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block are not the same, and the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the top neighboring 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 neighboring block and the intra prediction mode of the top neighboring block as intra prediction mode candidates.
Thereafter, remaining intra prediction mode candidates (intra prediction mode candidate 4 and intra prediction mode candidate 5) may be derived based on the maxAB and the minAB. Specifically, the remaining intra prediction mode candidates are derived based on a 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 top neighboring block.
For example, when a value obtained by subtracting the minAB from the maxAB is less than 63 and greater than 1 (that is, when the value obtained by subtracting the minAB from the maxAB is one of 2 to 62), the encoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode with mode number 2+((maxAB+61) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 61 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode with mode number 2+((maxAB−1) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by subtracting 1 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number. Here, maxAB may represent a larger 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 top neighboring block.
Alternatively, when a value obtained by subtracting the minAB from the maxAB is equal to or greater than 63 or equal to or less than 1, the encoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode with mode number 2+((maxAB+60) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 60 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode with mode number 2+(maxAB % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number. Here, maxAB may represent a larger 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 top neighboring block.
Meanwhile, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are not the same, or at least one of mode numbers of the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block is smaller than the mode number of the DC intra prediction mode, the encoding apparatus may 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 top neighboring block is equal to or greater than the mode number of the DC intra prediction mode.
For example, when 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 top neighboring block is equal to or greater than the mode number of the DC intra prediction mode, the encoding apparatus may derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 may be derived as maxAB, that is, intra prediction mode candidate 1 may be derived as the intra prediction mode of the top neighboring block when the mode number of the intra prediction mode of the left neighboring block is smaller than the mode number of the intra prediction mode of the top neighboring block, and intra prediction mode candidate 1 may be derived as the intra prediction mode of the left neighboring block when the mode number of the intra prediction mode of the left neighboring block is greater than or equal to the mode number of the intra prediction mode of the top neighboring block, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((maxAB+61) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 61 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((maxAB−1) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by subtracting 1 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((maxAB+60) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 60 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number.
Or, for example, when the above conditions are not met, the encoding apparatus may derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the vertical intra prediction mode (i.e., intra prediction mode #50), intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as the horizontal intra prediction mode (i.e., intra prediction mode #18), intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode of the mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, the intra prediction mode #46, intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode of the mode number obtained by adding 4 from the mode number of the vertical intra prediction mode, that is, the intra prediction mode #54. That is, for example, when the above conditions are not met, the intra prediction mode candidate list may include the DC intra prediction mode, the intra prediction mode #50, the intra prediction mode #18, the intra prediction mode #46, and the intra prediction mode #54 as intra prediction mode candidates.
Meanwhile, for example, when the left neighboring block is not available, intra prediction is not applied to the left neighboring block, and the intra prediction mode of the left neighboring block corresponding to at least one of a case in which a value of a CIIP flag of the top neighboring block is not 1 and a case in which the value of a pcm flag of the left neighboring block is 1 may be derived as the planar intra prediction mode. Also, when the top neighboring block is not available, intra prediction is not applied to the top neighboring block, and the intra prediction mode of the left neighboring block corresponding to at least one of a case in which a value of a CIIP flag of the top neighboring block is not 1, a case in which a value of a pcm flag of the top neighboring block is 1 and a case in which the top neighboring block is not included in the current CTU may be derived as the planar intra prediction mode.
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 identical. That is, the same intra prediction mode candidate list may be constructed irrespective of the intra prediction type for the current block. An intra prediction mode candidate list may be constructed through the same intra prediction mode construction process irrespective of the intra prediction type for the current block. The intra prediction mode construction process may be the same as one of the above-described embodiments.
The encoding apparatus derives an intra prediction mode of the current block based on the intra prediction mode candidate list (S1920). The encoding apparatus may derive an intra prediction mode having optimal RD cost as the intra prediction mode for the current block by executing various intra prediction modes. For example, the encoding apparatus may derive an intra prediction mode having optimal RD cost from 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 directional intra prediction modes. The two non-directional intra prediction modes may include the DC intra prediction mode and the planar intra prediction mode, as described above.
For example, 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 the DC intra prediction mode when the intra prediction type for the current block is derived as the second intra prediction type and selected as one of the intra prediction modes other than the DC intra prediction mode when the intra prediction type for the current block is derived as the third intra prediction type.
For example, 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 when the intra prediction type for the current block is derived as the second intra prediction type and selected as one of the intra prediction modes other than the DC intra prediction mode when the intra prediction type for the current block is derived as the third intra prediction type.
For example, 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 when the intra prediction type for the current block is derived as the second intra prediction type.
The encoding apparatus 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 also 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 apparatus may generate an MPM index indicating the determined intra prediction mode from among the intra prediction mode candidates. The MPM index may also 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 apparatus may generate remaining intra prediction mode information indicating the determined intra prediction mode from among the remaining intra prediction modes that are not included in the intra prediction mode candidates. Further, if the determined intra prediction mode is included in the intra prediction mode candidates of the intra prediction mode candidate list, the encoding apparatus may not signal the MPM flag and the value of the MPM flag may be derived as 1. Prediction related information for the current block may include the MPM flag, the MPM index, and/or the remaining intra prediction mode information.
The encoding apparatus derives reference samples of the current block based on the intra prediction type and the intra prediction mode (S1930).
For example, when the intra prediction type is derived as the first intra prediction type, the encoding apparatus may derive at least one reference sample from among reference samples in intra-prediction reference lines adjacent to the current block based on the intra prediction mode. The reference samples may include a top left corner reference sample, top reference samples and left reference samples of the current block. For example, when the size of the current block is W×H, x component of the top-left sample position of the current block is ×N, and y component thereof is yN, the left reference samples may be p[×N−1][yN] to p[×N−1] [2H+yN−1], the top left corner reference sample may be p[×N−1] [yN−1], and the top reference samples may be p[×N][yN−1] to p[2W+×N−1][yN−1].
For example, when the intra prediction type is derived as the second intra prediction type, the encoding apparatus may derive at least one reference sample from among reference samples in intra-prediction reference lines that are not adjacent to the current block based on the intra prediction mode. Here, the intra-prediction reference lines may be reference lines separated from the upper boundary and/or the left boundary of the current block by 1, 2 or 3 sample distances.
For example, when the intra prediction type is derived as the third intra prediction type, the encoding apparatus may derive an ISP split type of the current block, and partition 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, when the size of the current block is 4×4, the current block may not be partitioned. For example, when the size of the current block is 4×8 and the split type is the horizontal split type, the current block may be partitioned into two 4×4 sub-blocks. For example, when the size of the current block is 4×8 and the split type is the vertical split type, the current block may be partitioned into two 2×8 sub-blocks. For example, when the size of the current block is 8×4 and the split type is the horizontal split type, the current block may be partitioned into two 8×2 sub-blocks. For example, when the size of the current block is 8×4 and the split type is the vertical split type, the current block may be partitioned into two 4×4 sub-blocks. For example, when the size of the current block is W×H (sizes other than 4×8, 8×4, and 4×4) and the split type is the horizontal split type, the current block may be partitioned into four W×H/4 sub-blocks. For example, when the size of the current block is W×H and the split type is the vertical split type, the current block may be partitioned into four W/4×H sub-blocks. Thereafter, the encoding apparatus may derive at least one reference sample from among reference samples in an intra prediction reference line adjacent to a sub-block. The refenrece samples may include atop left corner reference sample, top reference samples and left reference samples of the current block. For example, when the size of the sub-block is W×H, x component of the top-left sample position of the sub-block is ×N, and y component thereof is yN, the left reference samples may be p[×N−1][yN] to p[×N−1] [2H+yN−1], the top left corner reference sample may be p[×N−1] [yN−1], and the top reference samples may be p[×N][yN−1] to p[2W+×N−1][yN−1].
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a square block, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, a reference sample of (0, −refIdx−1) coordinates to a reference sample of (W−1, −refIdx−1) coordinates in a top intra prediction reference line indicated by a reference line index of the current block and a reference sample of (−refIdx−1, 0) coordinates to a reference sample of (−refIdx−1, H−1) coordinates in a left intra prediction reference line indicated by the reference line index may be derived.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a non-square block whose width is greater than its height, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, a reference sample of (0, −refIdx−1) coordinates to a reference sample of (W−1, −refIdx−1) coordinates in a top intra prediction reference line indicated by a reference line index of the current block may be derived.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a non-square block whose height is greater than its width, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, a reference sample of (−refIdx−1, 0) coordinates to a reference sample of (−refIdx−1, H−1) coordinates in a left intra prediction reference line indicated by a reference line index of the current block may be derived.
For example, when the intra prediction mode of the current block is derived as the planar intra prediction mode, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, reference samples including a reference sample of (W−1, −refIdx−1) coordinates and a reference sample of (−refIdx−1, H−1) coordinates in an intra prediction reference line indicated by a reference line index of the current block may be derived.
The encoding apparatus generates a prediction sample of the current block based on the reference samples (S1940).
For example, when the intra prediction type is derived as the first intra prediction type, the encoding apparatus may derive at least one reference sample from among reference samples in intra-prediction reference lines adjacent to the current block based on the intra prediction mode and generate prediction samples of the current block based on the reference sample. The reference samples may include a top-left reference sample, upper reference samples, and left reference samples of the current block. For example, when the size of the current block is W×H, x component of the top-left sample position of the current block is ×N, and y component thereof is yN, the left reference samples may be p[×N−1][yN] to p[×N−1] [2H+yN−1], the top-left reference sample may be p[×N−1] [yN−1], and the upper reference samples may be p[×N][yN−1] to p[2W+×N−1][yN−1].
For example, when the intra prediction type is derived as the second intra prediction type, the encoding apparatus may derive at least one reference sample from among reference samples in intra-prediction reference lines that are not adjacent to the current block based on the intra prediction mode and generate prediction samples of the current block based on the reference sample. Here, the intra-prediction reference lines may be reference lines separated from the upper boundary and/or the left boundary of the current block by 1, 2 or 3 sample distances.
For example, when the intra prediction type is derived as the third intra prediction type, the encoding apparatus may determine an ISP split type of the current block and partition 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, when the size of the current block is 4×4, the current block may not be partitioned. For example, when the size of the current block is 4×8 and the split type is the horizontal split type, the current block may be partitioned into two 4×4 sub-blocks. For example, when the size of the current block is 4×8 and the split type is the vertical split type, the current block may be partitioned into two 2×8 sub-blocks. For example, when the size of the current block is 8×4 and the split type is the horizontal split type, the current block may be partitioned into two 8×2 sub-blocks. For example, when the size of the current block is 8×4 and the split type is the vertical split type, the current block may be partitioned into two 4×4 sub-blocks. For example, when the size of the current block is W×H (sizes other than 4×8, 8×4, and 4×4) and the split type is the horizontal split type, the current block may be partitioned into four W×H/4 sub-blocks. For example, when the size of the current block is W×H and the split type is the vertical split type, the current block may be partitioned into four W/4×H sub-blocks. Thereafter, the encoding apparatus may perform intra-prediction on the sub-blocks to generate prediction samples. That is, the encoding apparatus may derive at least one of reference samples in intra-prediction reference lines of each sub-block of the current block based on the intra prediction mode and generate the prediction samples based on the reference sample. The intra-prediction reference lines of each sub-block may be reference lines adjacent to each sub-block. Meanwhile, the encoding apparatus may generate and encode an ISP split flag indicating the ISP split type. The aforementioned prediction related information may include the ISP split flag.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a square block, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, the DC value may be derived based on a reference sample of (0, −refIdx−1) coordinates to a reference sample of (W−1, −refIdx−1) coordinates in a top intra prediction reference line indicated by a reference line index of the current block and a reference sample of (−refIdx−1, 0) coordinates to a reference sample of (−refIdx−1, H−1) coordinates in 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.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a non-square block whose width is greater than its height, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, the DC value may be derived based on a reference sample of (0, −refIdx−1) coordinates to a reference sample of (W−1, −refIdx−1) coordinates in a top intra prediction reference line indicated by a reference line index of the current block. A prediction sample of the current block may be derived as the DC value.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a non-square block whose height is greater than its width, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, the DC value may be derived based a reference sample of (−refIdx−1, 0) coordinates to a reference sample of (−refIdx−1, H−1) coordinates in a left intra prediction reference line indicated by a reference line index of the current block. A prediction sample of the current block may be derived as the DC value.
For example, when the intra prediction mode of the current block is derived as the planar intra prediction mode, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, the prediction sample may be derived based on a reference sample of (W−1, −refIdx−1) coordinates and a reference sample of (−refIdx−1, H−1) coordinates in an intra prediction reference line indicated by a reference line index of the current block.
The encoding apparatus encodes image information including prediction related information for the current block (S1950). The encoding apparatus may encode the image information including the prediction related information, and may output the image information in the form of a bitstream. The prediction related information may include the reference line index, the ISP flag and/or the ISP index. Also, the prediction related information may include the MPM flag, the MPM index and/or the remaining intra prediction mode information. In addition, although not illustrated, the encoding apparatus may derive a residual sample for the current block based on an original sample and a prediction sample for the current block, and may generate residual information for the current block based on the residual sample, and may encode image information including the residual information, and may output the image information in the form of a bitstream. Meanwhile, the bitstream may be transmitted to the decoding apparatus through a network or a (digital) storage medium. Here, the network may include a broadcast network and/or a communication network, and the digital storage medium may include various storage media such as a USB, an SD, a CD, a DVD, Blue-ray, an HDD, and an SSD.
The decoding apparatus receives prediction related information for a current block (S2100). The decoding apparatus may receive and parse the prediction related information for the current block. That is, for example, the decoding apparatus may receive and parse image information including the prediction related information for the current block through a bitstream. For example, the prediction related information may be as shown in Table 2 above.
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 a 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 separated by one sample distance 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 separated by 2 sample distances from the upper boundary and/or the left boundary of the current block, when the value of the reference line index is 3, the reference line index may indicate a reference line separated by 3 sample distances from the upper boundary and/or the left boundary of the current block.
Also, for example, when the reference line index indicates a reference line adjacent to the current block, that is, when the value of the reference line index is 0, the prediction related information may include an Intra Sub-Partitions mode (ISP) flag. The ISP flag may represent whether a third intra prediction type to which the ISP is applied is applied to the current block. That is, the ISP flag may represent whether the ISP is applied to the current block. For example, when a value of the IPS flag is 1, the ISP flag may represent that the third intra prediction type is applied to the current block, when the value of the IPS flag is 0, the ISP flag may represent that the third intra prediction type is not applied to the current block. Also, for example, when the value of the ISP flag is 1, the prediction related information may include an ISP split flag representing an ISP split type.
Also, for example, the prediction related information may include a most probable mode (MPM) flag. Alternatively, for example, the prediction related information may not include the MPM flag, and in this case, the decoding apparatus may derive a value of the MPM flag as 1. The MPM flag may represent whether the intra prediction mode of the current block is one of 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.
Also, for example, when the value of the MPM flag is 1, the prediction related information may include an MPM index. The MPM index may indicate one of 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 be referred to as an intra prediction mode candidate index.
Also, 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 indicate one of remaining intra prediction modes other than 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.
The decoding apparatus derives an intra prediction type for a current block among intra prediction types based on the prediction related information (S2110). The decoding apparatus 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 using intra-prediction reference lines adjacent to the current block, a second intra prediction type using intra-prediction reference lines that are not adjacent to the current block, and a third intra prediction type to which intra sub-partitions mode (ISP) is applied. The first intra prediction type may indicate the above-described general intra-prediction, the second intra prediction type may indicate the above-described MRL, and the third intra prediction type may indicate the above-described ISP.
For example, the decoding apparatus may derive the intra prediction type for the current block based on the prediction related information shown in Table 2. For example, the decoding apparatus may determine 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 prediction related information may include the reference line index. The reference line index may indicate an intra-prediction reference line of the current block. For example, 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 reference line index is 0, the reference line index may indicate a reference line separated from the upper boundary and/or the left boundary of the current block by one sample distance when the reference line index is 1, the reference line index may indicate a reference line separated from the upper boundary and/or the left boundary of the current block by 2 sample distances when the reference line index is 2, and the reference line index may indicate a reference line separated from the upper boundary and/or the left boundary of the current block by 3 sample distances when the reference line index is 3. When the reference line index indicates a reference line adjacent to the current block, the decoding apparatus may derive the reference line adjacent to the current block as the intra-prediction reference line of the current block and determine that the intra prediction type for the current block is not the second intra prediction type. Further, when the reference line index indicates a reference line that is not adjacent to the current block, the decoding apparatus may derive the reference line that is not adjacent to the current block as the intra-prediction reference line of the current block and derive the second intra prediction type as the intra prediction type for the current block. Here, the reference line that is not adjacent to the current block may be a reference line separated from the upper boundary and/or the left boundary of the current block by 1, 2 or 3 sample distances.
In addition, when the reference line index indicates a reference line adjacent to the current block, that is, when the intra prediction type for the current block is not the second intra prediction type, the decoding apparatus may determine whether the intra prediction type for the current block is the third intra prediction type based on an intra sub-partitions mode (ISP) flag. The prediction related information may include the ISP flag. The ISP flag may indicate whether the third intra prediction type to which 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, the ISP flag may indicate that the third intra prediction type is applied to the current block when set to 1 and may indicate that the third intra prediction type is not applied to the current block when set to 0. The decoding apparatus may derive the third intra prediction type as the intra prediction type for the current block when the ISP flag indicates that the third intra prediction type is applied and derive the first intra prediction type as the intra prediction type for the current block when the ISP flag indicates that the third intra prediction type is not applied.
The decoding apparatus constructs an intra prediction mode candidate list of the current block based on intra prediction modes of neighboring blocks of the current block (S2120).
For example, the decoding apparatus the intra prediction mode candidate list of the current block by performing the intra prediction mode candidate list construction process shown in Table 3. Meanwhile, the intra prediction mode candidate list may mean the above-described most probable mode (MPM) list.
For example, the decoding apparatus may construct the inter-prediction mode candidate list based on a first candidate intra prediction mode and a second candidate intra prediction mode. The decoding apparatus may construct the inter-prediction mode candidate list based on whether the first candidate intra prediction mode is identical to the second candidate intra prediction mode 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 are greater than the mode number of the DC intra prediction mode. Here, the first candidate intra prediction mode may be derived based on the intra prediction mode of the left neighboring block of the current block and the second candidate intra prediction mode may be derived based on the intra prediction mode of the top neighboring block of the current block. For example, the intra prediction mode of the left neighboring block of the current block may be derived as the first candidate intra prediction mode and the intra prediction mode of the top neighboring block of the current block may be derived as the second candidate intra prediction mode.
Specifically, when the first candidate intra prediction mode is identical to the second candidate intra prediction mode, for example, the decoding apparatus may 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 if the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, derive the intra prediction mode candidate list for the current block which includes intra prediction mode candidates as follows.
Here, mpm[0], mpm[1], mpm[2], mpm[3], mpm[4], and 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 may be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of (leftIntraDir+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((leftIntraDir−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may 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 value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
For example, when the first candidate intra prediction mode is not identical to the second candidate intra prediction mode, the decoding apparatus may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode. Further, the decoding apparatus may derive maxCandModeIdx as 0 if the mode number of intra prediction mode candidate 0 is greater than the mode number of intra prediction mode candidate 1 and derive maxCandModeIdx as 1 if the mode number of intra prediction mode candidate 0 is not greater than the mode number of intra prediction mode candidate 1.
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 apparatus may derive intra prediction mode candidate 2 and intra prediction mode candidate 3 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, and intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as the DC intra prediction mode.
Then, if a value obtained by subtracting a mode number of mpm[!maxCandModeIdx] from a mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number.
If the value obtained by subtracting the mode number of mpm[!maxCandModeIdx] from the mode number of mpm[maxCandModeIdx] is equal to or greater than 63 or equal to or less than 1, the decoding apparatus/decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx] % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number.
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 apparatus 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 equal to or greater than 2. 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 equal to or greater than 2, the decoding apparatus may derive intra prediction mode candidate 2 to intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the DC intra prediction mode if mpm[!maxCandModeIdx] is the planar intra prediction mode and may be derived as the planar intra prediction mode if mpm[!maxCandModeIdx] is not the planar intra prediction mode. In addition, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
If the aforementioned conditions are not satisfied, the decoding apparatus may derive intra prediction mode candidate 0 to intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the DC intra prediction mode if intra prediction mode candidate 0 is the planar intra prediction mode and derived as planar intra prediction mode if intra prediction mode candidate 0 is not the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as a vertical intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as a horizontal intra prediction mode, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode corresponding to a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, intra prediction mode #46, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode corresponding to a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, that is, intra prediction mode #54.
For example, the decoding apparatus may perform the intra prediction mode candidate list construction process shown in Table 4 to construct the intra prediction mode candidate list for the current block.
For example, the decoding apparatus may construct the intra prediction mode candidate list based on the first candidate intra prediction mode and the second candidate intra prediction mode. The decoding apparatus may construct the inter-prediction mode candidate list based on whether the first candidate intra prediction mode is identical to the second candidate intra prediction mode and/or whether the mode number of the first candidate intra prediction mode and/or the mode number of the second candidate intra prediction mode are greater than the mode number of the DC intra prediction mode. Here, the first candidate intra prediction mode may be derived based on the intra prediction mode of the left neighboring block of the current block and the second candidate intra prediction mode may be derived based on the intra prediction mode of the top neighboring block of the current block. For example, the intra prediction mode of the left neighboring block of the current block may be derived as the first candidate intra prediction mode and the intra prediction mode of the top neighboring block of the current block may be derived as the second candidate intra prediction mode.
Specifically, when the first candidate intra prediction mode is identical to the second candidate intra prediction mode, for example, the decoding apparatus may 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 if the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, derive the intra prediction mode candidate list for the current block which includes intra prediction mode candidates as follows.
Here, mpm[0], mpm[1], mpm[2], mpm[3], mpm[4], and 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 may be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((leftIntraDir+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((leftIntraDir−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from the mode number of the first candidate intra-prediciton mode and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, and intra prediction mode candidate 5 of the intra prediction mode candidate list may 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 value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
For example, when the first candidate intra prediction mode is not identical to the second candidate intra prediction mode, the decoding apparatus may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode. Further, the decoding apparatus may derive maxCandModeIdx as 0 if the mode number of intra prediction mode candidate 0 is greater than the mode number of intra prediction mode candidate 1 and derive maxCandModeIdx as 1 if the mode number of intra prediction mode candidate 0 is not greater than the mode number of intra prediction mode candidate 1.
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 apparatus may derive intra prediction mode candidate 1 to intra prediction mode candidate 3 as follows.
That is, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode, and intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as the DC intra prediction mode. Further, the decoding apparatus may derive maxCandModeIdx as 0 if the mode number of intra prediction mode candidate 0 is greater than the mode number of intra prediction mode candidate 2 and derive maxCandModeIdx as 2 if the mode number of intra prediction mode candidate 0 is not greater than the mode number of intra prediction mode candidate 2. Further, the decoding apparatus may derive minCandModeidx as 2 if the mode number of intra prediction mode candidate 0 is greater than the mode number of intra prediction mode candidate 2 and derive minCandModeidx as 0 if the mode number of intra prediction mode candidate 0 is not greater than the mode number of intra prediction mode candidate 2.
If a value obtained by subtracting a mode number of mpm[minCandModeidx] from a mode number of mpm[maxCandModeIdx] is less than 63 and greater than 1, the decoding apparatus/decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number.
If the value obtained by subtracting the mode number of mpm[minCandModeidx] from the mode number of mpm[maxCandModeIdx] is equal to or greater than 63 or equal to or less than 1, the decoding apparatus/decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number.
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 apparatus 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 equal to or greater than 2. 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 equal to or greater than 2, the decoding apparatus may determine whether at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is the planar intra prediction mode.
If at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is the planar intra prediction mode, the decoding apparatus may derive intra prediction mode candidate 0 and intra prediction mode candidate 1 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode if the mode number of the first candidate intra prediction mode is less than the mode number of the second candidate intra prediction mode and derived as the first candidate intra prediction mode if the mode number of the first candidate intra prediction mode is equal to or greater than the mode number of the second candidate intra prediction mode. Further, the decoding apparatus may derive maxCandModeIdx as 1.
If the first candidate intra prediction mode and the second candidate intra prediction mode are not the planar intra prediction mode, the decoding apparatus may derive intra prediction mode candidate 2 to intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the DC intra prediction mode if mpm[!maxCandModeIdx] is the planar intra prediction mode and may be derived as the planar intra prediction mode if mpm[!maxCandModeIdx] is not the planar intra prediction mode. In addition, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from mpm[maxCandModeIdx] and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((mpm[maxCandModeIdx]+offset−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of mpm[maxCandModeIdx] and (offset−1) and adding 2 to the modulo arithmetic operation result, as a mode number.
If the aforementioned conditions are not satisfied, the decoding apparatus may derive intra prediction mode candidate 0 to intra prediction mode candidate 5 as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the DC intra prediction mode if intra prediction mode candidate 0 is the planar intra prediction mode and derived as planar intra prediction mode if intra prediction mode candidate 0 is not the planar intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as a vertical intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as a horizontal intra prediction mode, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode corresponding to a mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, intra prediction mode #46, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode corresponding to a mode number obtained by adding 4 to the mode number of the vertical intra prediction mode, that is, intra prediction mode #54.
For example, the decoding apparatus may perform the intra prediction mode candidate list construction process shown in Table 5 to construct the intra prediction mode candidate list for the current block.
For example, the decoding apparatus may construct the intra prediction mode candidate list based on the first candidate intra prediction mode and the second candidate intra prediction mode. The decoding apparatus may construct the inter-prediction mode candidate list based on whether the first candidate intra prediction mode is identical to the second candidate intra prediction mode and/or whether the mode number of the first candidate intra prediction mode and/or the mode number of the second candidate intra prediction mode are greater than the mode number of the DC intra prediction mode. Here, the first candidate intra prediction mode may be derived based on the intra prediction mode of the left neighboring block of the current block and the second candidate intra prediction mode may be derived based on the intra prediction mode of the top neighboring block of the current block. For example, the intra prediction mode of the left neighboring block of the current block may be derived as the first candidate intra prediction mode and the intra prediction mode of the top neighboring block of the current block may be derived as the second candidate intra prediction mode.
Specifically, when the first candidate intra prediction mode is identical to the second candidate intra prediction mode, for example, the decoding apparatus may 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 if the mode number of the first candidate intra prediction mode is greater than the mode number of the DC intra prediction mode, derive the intra prediction mode candidate list for the current block which includes intra prediction mode candidates as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode. In addition, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((g_intraMode65to33AngMapping[leftIntraDir]+offset) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on the sum of the mode number of the first candidate intra prediction mode and an offset and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of ((g_intraMode65to33AngMapping[leftIntraDir]−1) % mod)+2, that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation on a value obtained by subtracting 1 from the mode number of the first candidate intra prediction mode and adding 2 to the modulo arithmetic operation result, as a mode number.
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 apparatus may derive the intra prediction mode candidate list for the current block which includes intra prediction mode candidates as follows.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, and intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as a vertical intra prediction mode.
Further, if the first candidate intra prediction mode is not identical to the second candidate intra prediction mode, the decoding apparatus may derive intra prediction mode candidate 0 and intra prediction mode candidate 1.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the first candidate intra prediction mode, and intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the second candidate intra prediction mode.
Then, if both the first candidate intra prediction mode and the second candidate intra prediction mode are the planar intra prediction mode, the decoding apparatus may derive intra prediction mode candidate 2 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the planar intra prediction mode.
Otherwise, if at least one of the first candidate intra prediction mode and the second candidate intra prediction mode is the planar intra prediction mode, the decoding apparatus may derive intra prediction mode candidate 2 as follows.
That is, intra prediction mode candidate 2 of the intra prediction mode candidate list may 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 derived as the 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 equal to or greater than 2.
For example, the decoding apparatus may construct the intra prediction mode candidate list of the current block based on intra prediction modes of neighboring blocks of the current block as shown in Table 6. Meanwhile, the intra prediction mode candidate list may mean the above-described most probable mode (MPM) list.
For example, the decoding apparatus may construct the intra prediction mode candidate list based on an intra prediction mode of a left neighboring block of the current block and an intra prediction mode of a top neighboring block of the current block. The decoding apparatus may determine whether the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are the same and a mode number of the intra prediction mode of the left neighboring block is greater than a mode number of a DC intra prediction mode. The decoding apparatus may construct the intra prediction mode candidate list based on whether the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are the same and/or 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.
When the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current 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 apparatus may derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the intra prediction mode of the left neighboring block, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((candIntraPredModeA+61) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 61 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((candIntraPredModeA−1) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by subtracting 1 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((candIntraPredModeA+60) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 60 from the mode number of the intra prediction mode of the left neighboring block and adding 2 to the modulo arithmetic operation result, as a mode number. That is, for example, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top 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 top neighboring block, an intra prediction mode with mode number 2+((candIntraPredModeA+61)% 64), an intra prediction mode with mode number 2+((candIntraPredModeA−1)% 64), and an intra prediction mode with mode number 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.
Meanwhile, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are not the same, for example, the decoding apparatus may determine whether at least one of a mode number of an intra prediction mode of the left neighboring block and a mode number of an intra prediction mode of the top neighboring block is greater than a mode number of the DC intra prediction mode. When 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 top neighboring block is greater than the mode number of the DC intra prediction mode, a variable minAB and a variable maxAB may be derived as follows.
Here, candIntraPredModeA may represent the mode number of the intra prediction mode of the left neighboring block of the current block, and candIntraPredModeB may represent the mode number of the intra prediction mode of the top neighboring block of the current block. That is, minAB may represent 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 top neighboring block, maxAB may represent a larger 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 top neighboring block.
Also, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are not the same, the decoding apparatus may determine whether the mode number of an intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode and the mode number of the intra prediction mode of the top neighboring block is greater than the mode number of the DC intra prediction mode.
For example, when the mode number of an intra prediction mode of the left neighboring block is greater than the mode number of the DC intra prediction mode and the mode number of the intra prediction mode of the top neighboring block is greater than the mode number of the DC intra prediction mode, the decoding apparatus may derive intra prediction mode candidate 0 to intra prediction mode candidate 3 as described below.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the intra prediction mode of the left neighboring block, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the intra prediction mode of the top neighboring block, and intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as the DC intra prediction mode. Here, candIntraPredModeB may represent the mode number of the intra prediction mode of the top neighboring block of the current block. That is, for example, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block are not the same, and the mode number of the intra prediction mode of the left neighboring block and the mode number of the intra prediction mode of the top neighboring 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 neighboring block and the intra prediction mode of the top neighboring block as intra prediction mode candidates.
Thereafter, remaining intra prediction mode candidates (intra prediction mode candidate 4 and intra prediction mode candidate 5) may be derived based on the maxAB and the minAB. Specifically, the remaining intra prediction mode candidates are derived based on a 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 top neighboring block.
For example, when a value obtained by subtracting the minAB from the maxAB is less than 63 and greater than 1 (that is, when the value obtained by subtracting the minAB from the maxAB is one of 2 to 62), the decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode with mode number 2+((maxAB+61) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 61 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode with mode number 2+((maxAB−1) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by subtracting 1 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number. Here, maxAB may represent a larger 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 top neighboring block.
Alternatively, when a value obtained by subtracting the minAB from the maxAB is equal to or greater than 63 or equal to or less than 1, the decoding apparatus may derive intra prediction mode candidate 4 and intra prediction mode candidate 5 as described below.
That is, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode with mode number 2+((maxAB+60) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 60 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode with mode number 2+(maxAB % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number. Here, maxAB may represent a larger 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 top neighboring block.
Meanwhile, when the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block of the current block are not the same, or at least one of mode numbers of the intra prediction mode of the left neighboring block and the intra prediction mode of the top neighboring block is smaller than the mode number of the DC intra prediction mode, the decoding apparatus may 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 top neighboring block is equal to or greater than the mode number of the DC intra prediction mode.
For example, when 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 top neighboring block is equal to or greater than the mode number of the DC intra prediction mode, the decoding apparatus may derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 may be derived as maxAB, that is, intra prediction mode candidate 1 may be derived as the intra prediction mode of the top neighboring block when the mode number of the intra prediction mode of the left neighboring block is smaller than the mode number of the intra prediction mode of the top neighboring block, and intra prediction mode candidate 1 may be derived as the intra prediction mode of the left neighboring block when the mode number of the intra prediction mode of the left neighboring block is greater than or equal to the mode number of the intra prediction mode of the top neighboring block, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((maxAB+61) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 61 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number, intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((maxAB−1) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by subtracting 1 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number, and intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode having a mode number of 2+((maxAB+60) % 64), that is, an intra prediction mode having a value, obtained by performing a modulo arithmetic operation with 64 on a value obtained by adding 60 from the maxAB and adding 2 to the modulo arithmetic operation result, as a mode number.
Or, for example, when the above conditions are not met, the decoding apparatus may derive the intra prediction mode candidate list of the current block including intra prediction mode candidates as described below.
That is, intra prediction mode candidate 0 of the intra prediction mode candidate list may be derived as the planar intra prediction mode, intra prediction mode candidate 1 of the intra prediction mode candidate list may be derived as the DC intra prediction mode, intra prediction mode candidate 2 of the intra prediction mode candidate list may be derived as the vertical intra prediction mode (i.e., intra prediction mode #50), intra prediction mode candidate 3 of the intra prediction mode candidate list may be derived as the horizontal intra prediction mode (i.e., intra prediction mode #18), intra prediction mode candidate 4 of the intra prediction mode candidate list may be derived as an intra prediction mode of the mode number obtained by subtracting 4 from the mode number of the vertical intra prediction mode, that is, the intra prediction mode #46, intra prediction mode candidate 5 of the intra prediction mode candidate list may be derived as an intra prediction mode of the mode number obtained by adding 4 from the mode number of the vertical intra prediction mode, that is, the intra prediction mode #54. That is, for example, when the above conditions are not met, the intra prediction mode candidate list may include the DC intra prediction mode, the intra prediction mode #50, the intra prediction mode #18, the intra prediction mode #46, and the intra prediction mode #54 as intra prediction mode candidates.
Meanwhile, for example, when the left neighboring block is not available, intra prediction is not applied to the left neighboring block, and the intra prediction mode of the left neighboring block corresponding to at least one of a case in which a value of a CIIP flag of the top neighboring block is not 1 and a case in which the value of a pcm flag of the left neighboring block is 1 may be derived as the planar intra prediction mode. Also, when the top neighboring block is not available, intra prediction is not applied to the top neighboring block, and the intra prediction mode of the left neighboring block corresponding to at least one of a case in which a value of a CIIP flag of the top neighboring block is not 1, a case in which a value of a pcm flag of the top neighboring block is 1 and a case in which the top neighboring block is not included in the current CTU may be derived as the planar intra prediction mode.
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 identical. That is, the same intra prediction mode candidate list may be constructed irrespective of the intra prediction type for the current block. An intra prediction mode candidate list may be constructed through the same intra prediction mode construction process irrespective of the intra prediction type for the current block. The intra prediction mode construction process may be the same as one of the above-described embodiments.
The decoding apparatus derives an intra prediction mode of the current block based on the intra prediction mode candidate list (S2130).
For example, the decoding apparatus may derive an MPM flag with respect to the current block. The prediction related information may include the MPM flag. For example, the decoding apparatus may receive the prediction related information for the current block, and the prediction related information may include the MPM flag with respect to the current block. The prediction related information may not include the MPM flag. In this case, the decoding apparatus may derive the value of the MPM flag 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 referred to as an intra prediction mode candidate flag.
When the MPM flag is 1, the decoding apparatus may derive an intra prediction mode candidate indicated by an MPM index from among the intra prediction mode candidates of the intra prediction mode candidate list as the intra prediction mode for the current block. The MPM index may be signaled in the form of mpm_idx or intra_luma_mpm_idx syntax element. The MPM index may also be referred to as an intra prediction mode candidate index.
When the MPM flag is 0, the decoding apparatus may derive an intra prediction mode indicated by remaining intra prediction mode information from among the remaining intra prediction modes as the intra prediction mode for the current block. The remaining intra prediction modes may represent intra prediction modes that are not included in the intra prediction mode candidates of the intra prediction mode candidate list. The aforementioned prediction related information may include the remaining intra prediction mode information. The remaining intra prediction mode information may be signaled in the form of rem_intra_luma_pred_mode or intra_luma_mpm_remainder syntax element.
For example, the intra prediction mode of the current block may be derived as one of the intra prediction modes other than the planar intra prediction mode and the DC intra prediction mode when the intra prediction type for the current block is derived as the second intra prediction type and derived as one of the intra prediction modes other than the DC intra prediction mode when the intra prediction type for the current block is derived as the third intra prediction type.
For example, the intra prediction mode of the current block may be derived as one of the intra prediction modes other than the planar intra prediction mode when the intra prediction type for the current block is derived as the second intra prediction type and derived as one of the intra prediction modes other than the DC intra prediction mode when the intra prediction type for the current block is derived as the third intra prediction type.
For example, the intra prediction mode of the current block may be derived as one of the intra prediction modes other than the planar intra prediction mode when the intra prediction type for the current block is derived as the second intra prediction type.
The decoding apparatus derives reference samples of the current block based on the intra prediction type and the intra prediction mode (S2140).
For example, when the intra prediction type is derived as the first intra prediction type, the decoding apparatus may derive at least one reference sample from among reference samples in intra-prediction reference lines adjacent to the current block based on the intra prediction mode. The reference samples may include a top left corner reference sample, top reference samples and left reference samples of the current block. For example, when the size of the current block is W×H, x component of the top-left sample position of the current block is ×N, and y component thereof is yN, the left reference samples may be p[×N−1][yN] to p[×N−1] [2H+yN−1], the top left corner reference sample may be p[×N−1] [yN−1], and the top reference samples may be p[×N][yN−1] to p[2W+×N−1][yN−1].
For example, when the intra prediction type is derived as the second intra prediction type, the decoding apparatus may derive at least one reference sample from among reference samples in intra-prediction reference lines that are not adjacent to the current block based on the intra prediction mode. Here, the intra-prediction reference lines may be reference lines separated from the upper boundary and/or the left boundary of the current block by 1, 2 or 3 sample distances.
For example, when the intra prediction type is derived as the third intra prediction type, the decoding apparatus may derive an ISP split type of the current block based on an ISP split flag indicating the ISP split type and partition 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, when the size of the current block is 4×4, the current block may not be partitioned. For example, when the size of the current block is 4×8 and the split type is the horizontal split type, the current block may be partitioned into two 4×4 sub-blocks. For example, when the size of the current block is 4×8 and the split type is the vertical split type, the current block may be partitioned into two 2×8 sub-blocks. For example, when the size of the current block is 8×4 and the split type is the horizontal split type, the current block may be partitioned into two 8×2 sub-blocks. For example, when the size of the current block is 8×4 and the split type is the vertical split type, the current block may be partitioned into two 4×4 sub-blocks. For example, when the size of the current block is W×H (sizes other than 4×8, 8×4, and 4×4) and the split type is the horizontal split type, the current block may be partitioned into four W×H/4 sub-blocks. For example, when the size of the current block is W×H and the split type is the vertical split type, the current block may be partitioned into four W/4×H sub-blocks. Thereafter, the decoding apparatus may derive at least one reference sample from among reference samples in an intra prediction reference line adjacent to a sub-block. The reference samples may include a top left corner reference sample, top reference samples and left reference samples of the current block. For example, when the size of the sub-block is W×H, x component of the top-left sample position of the sub-block is ×N, and y component thereof is yN, the left reference samples may be p[×N−1][yN] to p[×N−1][2H+yN−1], the top left corner reference sample may be p[×N−1][yN−1], and the top reference samples may be p[×N][yN−1] to p[2W+×N−1][yN−1].
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a square block, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, a reference sample of (0, −refIdx−1) coordinates to a reference sample of (W−1, −refIdx−1) coordinates in a top intra prediction reference line indicated by a reference line index of the current block and a reference sample of (−refIdx−1, 0) coordinates to a reference sample of (−refIdx−1, H−1) coordinates in a left intra prediction reference line indicated by the reference line index may be derived.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a non-square block whose width is greater than its height, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, a reference sample of (0, −refIdx−1) coordinates to a reference sample of (W−1, −refIdx−1) coordinates in a top intra prediction reference line indicated by a reference line index of the current block may be derived.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a non-square block whose height is greater than its width, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, a reference sample of (−refIdx−1, 0) coordinates to a reference sample of (−refIdx−1, H−1) coordinates in a left intra prediction reference line indicated by a reference line index of the current block may be derived.
For example, when the intra prediction mode of the current block is derived as the planar intra prediction mode, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, reference samples including a reference sample of (W−1, −refIdx−1) coordinates and a reference sample of (−refIdx−1, H−1) coordinates in an intra prediction reference line indicated by a reference line index of the current block may be derived.
The decoding apparatus generates a prediction sample of the current block based on the reference samples (S2150).
For example, when the intra prediction type is derived as the first intra prediction type, the decoding apparatus may derive at least one reference sample from among reference samples in intra-prediction reference lines adjacent to the current block based on the intra prediction mode and generate prediction samples of the current block based on the reference sample. The reference samples may include a top-left reference sample, upper reference samples, and left reference samples of the current block. For example, when the size of the current block is W×H, x component of the top-left sample position of the current block is ×N, and y component thereof is yN, the left reference samples may be p[×N−1][yN] to p[×N−1] [2H+yN−1], the top-left reference sample may be p[×N−1] [yN−1], and the upper reference samples may be p[×N][yN−1] to p[2W+×N−1][yN−1].
For example, when the intra prediction type is derived as the second intra prediction type, the decoding apparatus may derive at least one reference sample from among reference samples in intra-prediction reference lines that are not adjacent to the current block based on the intra prediction mode and generate prediction samples of the current block based on the reference sample. Here, the intra-prediction reference lines may be reference lines separated from the upper boundary and/or the left boundary of the current block by 1, 2 or 3 sample distances.
For example, when the intra prediction type is derived as the third intra prediction type, the decoding apparatus may derive an ISP split type of the current block based on an ISP split flag indicating the ISP split type and partition 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, when the size of the current block is 4×4, the current block may not be partitioned. For example, when the size of the current block is 4×8 and the split type is the horizontal split type, the current block may be partitioned into two 4×4 sub-blocks. For example, when the size of the current block is 4×8 and the split type is the vertical split type, the current block may be partitioned into two 2×8 sub-blocks. For example, when the size of the current block is 8×4 and the split type is the horizontal split type, the current block may be partitioned into two 8×2 sub-blocks. For example, when the size of the current block is 8×4 and the split type is the vertical split type, the current block may be partitioned into two 4×4 sub-blocks. For example, when the size of the current block is W×H (sizes other than 4×8, 8×4, and 4×4) and the split type is the horizontal split type, the current block may be partitioned into four W×H/4 sub-blocks. For example, when the size of the current block is W×H and the split type is the vertical split type, the current block may be partitioned into four W/4×H sub-blocks. Thereafter, the decoding apparatus may perform intra-prediction on the sub-blocks to generate a prediction sample. That is, the decoding apparatus may derive at least one of reference samples in intra-prediction reference lines of each sub-block of the current block based on the intra prediction mode and generate the prediction sample based on the reference sample. The intra-prediction reference lines of each sub-block may be reference lines adjacent to each sub-block.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a square block, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, the DC value may be derived based on a reference sample of (0, −refIdx−1) coordinates to a reference sample of (W−1, −refIdx−1) coordinates in a top intra prediction reference line indicated by a reference line index of the current block and a reference sample of (−refIdx−1, 0) coordinates to a reference sample of (−refIdx−1, H−1) coordinates in 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.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a non-square block whose width is greater than its height, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, the DC value may be derived based on a reference sample of (0, −refIdx−1) coordinates to a reference sample of (W−1, −refIdx−1) coordinates in a top intra prediction reference line indicated by a reference line index of the current block. A prediction sample of the current block may be derived as the DC value.
For example, when the intra prediction mode of the current block is derived as the DC intra prediction mode, the current block is a non-square block whose height is greater than its width, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, the DC value may be derived based a reference sample of (−refIdx−1, 0) coordinates to a reference sample of (−refIdx−1, H−1) coordinates in a left intra prediction reference line indicated by a reference line index of the current block. A prediction sample of the current block may be derived as the DC value.
For example, when the intra prediction mode of the current block is derived as the planar intra prediction mode, a size of the current block is W×H, an x component and y component of a top left position of the current block are 0, the prediction sample may be derived based on a reference sample of (W−1, −refIdx−1) coordinates and a reference sample of (−refIdx-1, H−1) coordinates in an intra prediction reference line indicated by a reference line index of the current block.
Meanwhile, although not illustrated, the decoding apparatus may directly use the prediction sample as a reconstructed sample according to a prediction mode or may generate a reconstructed sample by adding a residual sample to the prediction sample. When the residual sample with respect to the current block is present, the decoding apparatus may receive residual information about the current block, and the residual information may include a transform coefficient with respect to the residual sample. The decoding apparatus may derive the residual sample (or residual sample array) with respect to the current block based on the residual information. The decoding apparatus may generate the reconstructed sample based on the prediction sample and the residual sample and derive a reconstructed block or a reconstructed picture based on the reconstructed sample. Thereafter, the decoding apparatus may apply deblocking filtering and/or in-loop filtering procedure such as SAO procedure to the reconstructed picture in order to improve subjective/objective picture quality as necessary, as described above.
According to the above-described present disclosure, it is possible to reduce hardware and software implementation complexity using a unified intra prediction mode list construction process for intra prediction types.
Furthermore, according to the present disclosure, it is possible to reduce dependency on intra prediction type using a unified intra prediction mode list construction process for intra prediction types to improve coding efficiency of intra-prediction.
Also, according to the present disclosure, it is possible to improve the coding efficiency of intra prediction by deriving a reference sample used when MRL is applied and the intra prediction mode is derived as the DC intra prediction mode based on the reference picture index.
Also, according to the present disclosure, it is possible to improve the coding efficiency of intra prediction by deriving a reference sample used when MRL is applied and the intra prediction mode is derived as the DC intra prediction mode based on the reference picture index and a shape of the current block.
Also, according to the present disclosure, it is possible to improve the coding efficiency of intra prediction by deriving a reference sample used when MRL is applied and the intra prediction mode is derived as the planar intra prediction mode based on the reference picture index.
In the above-described embodiment, the methods are described based on the flowchart having a series of steps or blocks. The present disclosure is not limited to the order of the above steps or blocks. Some steps or blocks may occur simultaneously or in a different order from other steps or blocks as described above. Further, those skilled in the art will understand that the steps shown in the above flowchart are not exclusive, that further steps may be included, or that one or more steps in the flowchart may be deleted without affecting the scope of the present disclosure.
The embodiments described in this specification may be performed by being implemented on a processor, a microprocessor, a controller or a chip. For example, the functional units shown in each drawing may be performed by being implemented on a computer, a processor, a microprocessor, a controller or a chip. In this case, information for implementation (e.g., information on instructions) or algorithm may be stored in a digital storage medium.
In addition, the decoding apparatus and the encoding apparatus to which the present disclosure is applied may be included in a multimedia broadcasting transmission/reception apparatus, a mobile communication terminal, a home cinema video apparatus, a digital cinema video apparatus, a surveillance camera, a video chatting apparatus, a real-time communication apparatus such as video communication, a mobile streaming apparatus, a storage medium, a camcorder, a VoD service providing apparatus, an Over the top (OTT) video apparatus, an Internet streaming service providing apparatus, a three-dimensional (3D) video apparatus, a teleconference video apparatus, a transportation user equipment (e.g., vehicle user equipment, an airplane user equipment, a ship user equipment, etc.) and a medical video apparatus and may be used to process video signals and data signals. For example, the Over the top (OTT) video apparatus may include a game console, a blue-ray player, an internet access TV, a home theater system, a smart phone, a tablet PC, a Digital Video Recorder (DVR), and the like.
Furthermore, the processing method to which the present disclosure is applied may be produced in the form of a program that is to be executed by a computer and may be stored in a computer-readable recording medium. Multimedia data having a data structure according to the present disclosure may also be stored in computer-readable recording media. The computer-readable recording media include all types of storage devices in which data readable by a computer system is stored. The computer-readable recording media may include a BD, a Universal Serial Bus (USB), ROM, PROM, EPROM, EEPROM, RAM, CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, for example. Furthermore, the computer-readable recording media includes media implemented in the form of carrier waves (e.g., transmission through the Internet). In addition, a bit stream generated by the encoding method may be stored in a computer-readable recording medium or may be transmitted over wired/wireless communication networks.
In addition, the embodiments of the present disclosure may be implemented with a computer program product according to program codes, and the program codes may be performed in a computer by the embodiments of the present disclosure. The program codes may be stored on a carrier which is readable by a computer.
The content streaming system to which the embodiment(s) of the present disclosure is applied may largely include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.
The encoding server compresses content input from multimedia input devices such as a smartphone, a camera, a camcorder, etc. Into digital data to generate a bitstream and transmit the bitstream to the streaming server. As another example, when the multimedia input devices such as smartphones, cameras, camcorders, etc. directly generate a bitstream, the encoding server may be omitted.
The bitstream may be generated by an encoding method or a bitstream generating method to which the embodiment(s) of the present disclosure is applied, and the streaming server may temporarily store the bitstream in the process of transmitting or receiving the bitstream.
The streaming server transmits the multimedia data to the user device based on a user's request through the web server, and the web server serves as a medium for informing the user of a service. When the user requests a desired service from the web server, the web server delivers it to a streaming server, and the streaming server transmits multimedia data to the user. In this case, the content streaming system may include a separate control server. In this case, the control server serves to control a command/response between devices in the content streaming system.
The streaming server may receive content from a media storage and/or an encoding server. For example, when the content is received from the encoding server, the content may be received in real time. In this case, in order to provide a smooth streaming service, the streaming server may store the bitstream for a predetermined time.
Examples of the user device may include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a personal digital assistant (PDA), a portable multimedia player (PMP), navigation, a slate PC, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glasses, head mounted displays (HMDs)), digital TVs, desktops computer, digital signage, and the like. Each server in the content streaming system may be operated as a distributed server, in which case data received from each server may be distributed.
Claims of the present disclosure may be combined in various manners. For example, technical features of a process claim of the present disclosure may be combined and implemented as an apparatus, and technical features of an apparatus claim of the present disclosure may be combined and implemented as a method. In addition, technical features of a process claim and technical features of an apparatus claim of the present disclosure may be combined and implemented as an apparatus, and technical features of a process claim and technical features of an apparatus claim of the present disclosure may be combined and implemented as a method.
This application is a continuation of U.S. application Ser. No. 17/441,841, filed on Sep. 22, 2021, which is a National Stage application under 35 U.S.C. § 371 of International Application No. PCT/KR2020/003663, filed on Mar. 18, 2020, which claims the benefit of U.S. Provisional Application No. 62/822,740, filed on Mar. 22, 2019. The disclosures of the prior applications are incorporated by reference in their entirety.
Number | Date | Country | |
---|---|---|---|
62822740 | Mar 2019 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 17441841 | Sep 2021 | US |
Child | 18804497 | US |