Method and apparatus for intra prediction coding of video data
Patent Information
- Application Number
- KR1020200083979
- Authority / Receiving Office
- KR · KR
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-10-06
- Filing Date
- 2020-07-08
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2040-07-08
Smart Images

Figure 112020070849802-PAT00167_ABST
Abstract
Description
Technology Field
[0001] The present invention relates to the encoding and decoding of video data. Background Technology
[0002] Since video data contains a large amount of data compared to audio or still image data, storing or transmitting it as is without compression processing requires significant hardware resources, including memory.
[0003] Therefore, typically, when storing or transmitting video data, an encoder is used to compress the video data for storage or transmission, and a decoder receives the compressed video data, decompresses it, and plays it. Such video compression technologies include H.264 / AVC, as well as HEVC (High Efficiency Video Coding), which improves coding efficiency by about 40% compared to H.264 / AVC.
[0004] However, as picture size, resolution, and frame rates are gradually increasing, and the amount of data that needs to be encoded is also increasing accordingly, a new compression technology is required that offers better encoding efficiency and higher image quality improvement effects than existing compression technologies. The problem to be solved
[0005] The present invention presents improved techniques for intra-predictive coding blocks of video data. means of solving the problem
[0006] According to one aspect of the present disclosure, a method for decoding video data comprises: decoding a syntax element from a bitstream that indicates an intra prediction type of a current block of video data, wherein the intra prediction type includes matrix-based intra prediction (MIP) and regular intra prediction; and optionally performing matrix-based intra prediction or regular intra prediction based on the intra prediction type of the current block indicated by the syntax element to generate a prediction block for the current block.
[0007] The above method further comprises, as part of the step of performing matrix-based intra prediction to generate a prediction block for the current block, a step of decoding a syntax element indicating a matrix-based intra prediction mode for the current block, represented by a truncated binary code specifying one of a plurality of matrix-based intra prediction modes allowed for the width and height of the current block from the bitstream; a step of deriving an input boundary vector using neighboring samples adjacent to the current block based on the width and height of the current block; a step of generating prediction samples for the current block based on matrix-vector multiplication between a predefined matrix for the matrix-based intra prediction mode and the input boundary vector; and a step of deriving a prediction block for the current block based on the prediction samples.
[0008] As part of the step of generating a prediction block for the current block by performing the normalized intra prediction, the method further comprises the step of constructing a list of Most Probable Modes (MPMs) for the current block by deriving MPM candidates based on the normalized intra prediction modes of neighboring blocks adjacent to the current block, and the step of deriving a normalized intra prediction mode for the current block based on the MPM list. In deriving the MPM candidates, if the intra prediction type of the neighboring block is matrix-based intra prediction, the normalized intra prediction mode of the neighboring block is set (considered) to PLANAR mode.
[0009] According to another aspect of the present disclosure, an apparatus for decoding video data comprises: a decoding unit that decodes a syntax element indicating an intra prediction type of a current block of video data from a bitstream, wherein the intra prediction type includes matrix-based intra prediction and normalized intra prediction; and an intra prediction unit that selectively performs matrix-based intra prediction or normalized intra prediction based on the intra prediction type of a current block indicated by the syntax element to generate a prediction block for the current block.
[0010] As part of performing the matrix-based intra prediction to generate a prediction block for the current block, the intra prediction unit may further perform the steps of: decoding a syntax element indicating a matrix-based intra prediction mode for the current block, represented by a truncated binary code specifying one of a plurality of matrix-based intra prediction modes allowed for the width and height of the current block from the bitstream; deriving an input boundary vector using surrounding samples adjacent to the current block based on the width and height of the current block; generating prediction samples for the current block based on matrix-vector multiplication between a predefined matrix for the matrix-based intra prediction mode and the input boundary vector; and deriving a prediction block for the current block based on the prediction samples.
[0011] The intra prediction unit, as part of generating a prediction block for the current block by performing the normalized intra prediction, derives MPM candidates based on the normalized intra prediction modes of surrounding blocks adjacent to the current block to construct an MPM list for the current block, and derives a normalized intra prediction mode for the current block based on the MPM list. In deriving the MPM candidates, the intra prediction unit sets (considers) the normalized intra prediction mode of the surrounding block to PLANAR mode when the intra prediction type of the surrounding block is matrix-based intra prediction. Brief explanation of the drawing
[0012] FIG. 1 is an exemplary block diagram of an image encoding device capable of implementing the technologies of the present disclosure. Figure 2 is a diagram illustrating a method for dividing blocks using a QTBTTT structure. Figure 3a is a diagram showing multiple intra prediction modes. FIG. 3b is a diagram showing a plurality of intra prediction modes including wide-angle intra prediction modes. FIG. 4 is an exemplary block diagram of an image decoding device capable of implementing the technologies of the present disclosure. FIG. 5 is a conceptual diagram illustrating the main process of MIP technology that may be used in the techniques of the present disclosure. Figure 6 illustrates smoothing filtering and interpolation filtering for constructing reference samples. Figures 7a through 7c are conceptual diagrams showing an exemplary method of constructing a boundary vector input to a matrix-vector multiplication operation using left neighbor samples. Figures 8a through 8c are conceptual diagrams showing an exemplary method of constructing a boundary vector input to a matrix-vector multiplication operation using upper neighbor samples. FIG. 9 is a flowchart illustrating a method for decoding video data according to an embodiment of the present invention. Specific details for implementing the invention
[0013] Hereinafter, some embodiments of the present invention will be described in detail with reference to exemplary drawings. It should be noted that in assigning identification symbols to the components of each drawing, the same components are assigned the same symbol whenever possible, even if they are shown in different drawings. Furthermore, in describing the present invention, if it is determined that a detailed description of related known components or functions could obscure the essence of the invention, such detailed description is omitted.
[0014] FIG. 1 is an exemplary block diagram of an image encoding device capable of implementing the technologies of the present disclosure. Hereinafter, the image encoding device and its sub-components will be described with reference to FIG. 1.
[0015] The video encoding device may be configured to include a picture splitting unit (110), a prediction unit (120), a subtractor (130), a conversion unit (140), a quantization unit (145), a reordering unit (150), an entropy encoding unit (155), an inverse quantization unit (160), an inverse conversion unit (165), an adder (170), a filter unit (180), and a memory (190).
[0016] Each component of the video encoding device may be implemented in hardware or software, or as a combination of hardware and software. Additionally, the function of each component may be implemented in software, and a microprocessor may be implemented to execute the software function corresponding to each component.
[0017] A single image (video) consists of multiple pictures. Each picture is divided into multiple regions, and encoding is performed for each region. For example, a single picture is divided into one or more tiles or / and slices. Here, one or more tiles can be defined as a tile group. Each tile or / slice is divided into one or more Coding Tree Units (CTUs). And each CTU is divided into one or more Coding Units (CUs) by a tree structure. Information applicable to each CU is encoded as the CU syntax, and information applicable to all CUs included in a single CTU is encoded as the CTU syntax. Additionally, information applicable to all blocks within a single slice is encoded as the slice header syntax, and information applicable to all blocks constituting a single picture is encoded in the Picture Parameter Set (PPS) or the picture header. Furthermore, information commonly referenced by multiple pictures is encoded in a Sequence Parameter Set (SPS). Also, information commonly referenced by one or more SPSs is encoded in a Video Parameter Set (VPS). Additionally, information commonly applicable to a single tile or tile group may be encoded as the syntax of a tile or tile group header.
[0018] The picture division unit (110) determines the size of the Coding Tree Unit (CTU). Information regarding the size of the CTU (CTU size) is encoded as a syntax of SPS or PPS and transmitted to an image decoder.
[0019] The picture division unit (110) divides each picture constituting the image into multiple Coding Tree Units (CTUs) having a predetermined size, and then recursively divides the CTUs using a tree structure. The leaf nodes in the tree structure become the coding units (CUs) which are the basic units of coding.
[0020] The tree structure may be a QuadTree (QT) in which an upper node (or parent node) is divided into four lower nodes (or child nodes) of equal size, a BinaryTree (BT) in which an upper node is divided into two lower nodes, a TernaryTree (TT) in which an upper node is divided into three lower nodes in a 1:2:1 ratio, or a structure that combines two or more of these QT, BT, and TT structures. For example, a QTBT (QuadTree plus BinaryTree) structure may be used, or a QTBTTT (QuadTree plus BinaryTree TernaryTree) structure may be used. Here, BTTT combined may be referred to as an MTT (Multiple-Type Tree).
[0021] FIG. 2 shows a QTBTTT splitting tree structure. As seen in FIG. 2, the CTU can first be split into a QT structure. Quadtree splitting can be repeated until the size of the splitting block reaches the minimum block size of the leaf node allowed in QT (MinQTSize). A first flag (QT_split_flag) indicating whether each node of the QT structure is split into four nodes of the lower layer is encoded by the entropy encoder (155) and signaled to the image decoder. If the leaf node of the QT is not larger than the maximum block size of the root node allowed in BT (MaxBTSize), it can be further split into one or more of the BT structure or TT structure. In the BT structure and / or TT structure, multiple splitting directions may exist. For example, there may be two directions in which the block of the corresponding node is split horizontally and vertically. As shown in FIG. 2, when MTT splitting begins, a second flag (mtt_split_flag) indicating whether the nodes have been split, a flag indicating the splitting direction (vertical or horizontal) and / or the splitting type (binary or ternary) are encoded by the entropy encoding unit (155) and signaled to the image decoding device. Alternatively, a CU splitting flag (split_cu_flag) indicating whether the node is split may be encoded prior to encoding a first flag (QT_split_flag) indicating whether each node is split into four nodes of a lower layer. If the value of the CU splitting flag (split_cu_flag) indicates that the node has not been split, the block of the node becomes a leaf node in the splitting tree structure and becomes a coding unit (CU), which is the basic unit of encoding.When the value of the CU split flag (split_cu_flag) indicates splitting, the video encoding device starts encoding from the first flag in the manner described above.
[0022] When QTBT is used as another example of a tree structure, there may be two types: a type that divides the block of the corresponding node horizontally into two blocks of the same size (i.e., symmetric horizontal splitting) and a type that divides it vertically (i.e., symmetric vertical splitting). A splitting flag (split_flag) indicating whether each node of the BT structure is split into a block of a lower layer and splitting type information indicating the type of splitting are encoded by the entropy encoding unit (155) and transmitted to the image decoding device. Meanwhile, there may also be an additional type that divides the block of the corresponding node into two blocks of an asymmetric shape. The asymmetric shape may include a shape that divides the block of the corresponding node into two rectangular blocks with a size ratio of 1:3, or a shape that divides the block of the corresponding node diagonally.
[0023] A CU can have various sizes depending on the QTBT or QTBTTT partitioning from a CTU. Hereinafter, the block corresponding to the CU to be encoded or decoded (i.e., the leaf node of QTBTTT) is referred to as the 'current block'. Depending on the adoption of QTBTTT partitioning, the shape of the current block may be not only square but also rectangular.
[0024] The prediction unit (120) predicts the current block and generates a prediction block. The prediction unit (120) includes an intra prediction unit (122) and an inter prediction unit (124).
[0025] Generally, current blocks within a picture can each be predictively coded. Typically, the prediction of a current block can be performed using an intra-prediction technique (using data from the picture containing the current block) or an inter-prediction technique (using data from a picture coded prior to the picture containing the current block). Inter-prediction includes both unidirectional and bidirectional prediction.
[0026] The intra prediction unit (122) predicts pixels within the current block using pixels (reference pixels) located around the current block within the current picture containing the current block. Multiple intra prediction modes exist depending on the prediction direction. For example, as shown in FIG. 3a, multiple intra prediction modes may include two non-directional modes, including PLANAR mode and DC mode, and 65 directional modes. The surrounding pixels to be used and the calculation formula are defined differently for each prediction mode. The table below lists the numbers and names of the intra prediction modes.
[0027]
[0028] For efficient directional prediction for a rectangular current block, directional modes (intra-prediction modes 67 through 80 and -1 through -14) illustrated by dashed arrows in FIG. 3b may be additionally used. These may be referred to as "wide angle intra-prediction modes." In FIG. 3b, the arrows indicate corresponding reference samples used for prediction and do not indicate the prediction direction. The prediction direction is opposite to the direction indicated by the arrows. Wide angle intra-prediction modes are modes that perform prediction in the opposite direction of a specific directional mode without additional bit transmission when the current block is rectangular. Among the wide angle intra-prediction modes, some wide angle intra-prediction modes available for the current block may be determined by the ratio of the width to the height of the rectangular current block. For example, wide-angle intra prediction modes with an angle less than 45 degrees (intra prediction modes 67 to 80) are available when the current block is a rectangular shape with a height less than the width, and wide-angle intra prediction modes with an angle greater than -135 degrees (intra prediction modes -1 to -14) are available when the current block is a rectangular shape with a height greater than the width.
[0029] The intra prediction unit (122) can determine the intra prediction mode to use for encoding the current block. In some examples, the intra prediction unit (122) may encode the current block using several intra prediction modes and select an appropriate intra prediction mode to use from the tested modes. For example, the intra prediction unit (122) may calculate rate-distortion values using rate-distortion analysis of several tested intra prediction modes and select an intra prediction mode that has the best rate-distortion features among the tested modes.
[0030] The intra prediction unit (122) selects one intra prediction mode among a plurality of intra prediction modes and predicts the current block using a calculation formula and surrounding pixels (reference pixels) determined according to the selected intra prediction mode. Information regarding the selected intra prediction mode is encoded by the entropy encoding unit (155) and transmitted to the image decoding device.
[0031] Additionally, the intra prediction unit (122) may generate a prediction block for the current block using the matrix-based intra prediction (MIP) described later. The intra prediction unit (122) may generate a prediction block for the current block using boundary vectors derived from samples reconstructed on the left side of the current block and samples reconstructed on the upper side of the current block, as well as predefined matrices and offset vectors.
[0032] The inter prediction unit (124) generates a prediction block for the current block through a motion compensation process. The inter prediction unit (124) searches for the block most similar to the current block within a reference picture that is encoded and decoded before the current picture, and generates a prediction block for the current block using the searched block. Then, it generates a motion vector corresponding to the displacement between the current block in the current picture and the prediction block in the reference picture. Generally, motion estimation is performed on the luminance component, and the motion vector calculated based on the luminance component is used for both the luminance component and the chroma component. Motion information, including information on the reference picture used to predict the current block and information on the motion vector, is encoded by the entropy encoding unit (155) and transmitted to the image decoding device.
[0033] The subtractor (130) generates a residual block by subtracting the prediction block generated by the intra prediction unit (122) or the inter prediction unit (124) from the current block.
[0034] The transformation unit (140) divides the residual block into one or more transformation blocks and applies the transformation to one or more transformation blocks to transform the residual values of the transformation blocks from the pixel domain to the frequency domain. In the frequency domain, the transformed blocks are referred to as coefficient blocks containing one or more transformation coefficient values. A two-dimensional transformation kernel may be used for the transformation, and a one-dimensional transformation kernel may be used for the horizontal direction transformation and the vertical direction, respectively. The transformation kernel may be based on the Discrete Cosine Transform (DCT), Discrete Sine Transform (DST), etc.
[0035] The transformation unit (140) can transform residual signals within the residual block using the entire size of the residual block as the transformation unit. Additionally, the transformation unit (140) can divide the residual block into two sub-blocks in a horizontal or vertical direction and perform the transformation on only one of the two sub-blocks. Therefore, the size of the transformation block may differ from the size of the residual block (and thus the size of the prediction block). Non-zero residual sample values may not exist or may be very sparse in the sub-block where the transformation is not performed. Residual samples in the sub-block where the transformation is not performed are not signaled and may all be considered as "0" by the image decoder. Depending on the division direction and the division ratio, various partition types may exist. The conversion unit (140) can provide information regarding the coding mode (or conversion mode) of the residual block (e.g., information indicating whether the residual block has been converted or the residual sub-block has been converted, information indicating the partition type selected to divide the residual block into sub-blocks, information identifying the sub-block on which the conversion is performed, etc.) to the entropy encoding unit (155). The entropy encoding unit (155) can encode the information regarding the coding mode (or conversion mode) of the residual block.
[0036] The quantization unit (145) quantizes the conversion coefficients output from the conversion unit (140) and outputs the quantized conversion coefficients to the entropy encoding unit (155). The quantization unit (145) may quantize the associated residual block directly without conversion for any block or frame.
[0037] The reordering unit (150) can perform reordering of coefficient values for quantized residual values. The reordering unit (150) can change a two-dimensional coefficient array into a one-dimensional coefficient sequence through coefficient scanning. For example, the reordering unit (150) can output a one-dimensional coefficient sequence by scanning from DC coefficients to coefficients in the high-frequency range using a zig-zag scan or a diagonal scan. Depending on the size of the transformation unit and the intra-prediction mode, a vertical scan that scans the two-dimensional coefficient array in the column direction, or a horizontal scan that scans the two-dimensional block-shaped coefficients in the row direction, may be used instead of a zig-zag scan. That is, depending on the size of the transformation unit and the intra-prediction mode, the scanning method to be used among a zig-zag scan, a diagonal scan, a vertical scan, and a horizontal scan may be determined.
[0038] The entropy encoding unit (155) generates a bitstream by encoding a sequence of one-dimensional quantized transformation coefficients output from the reordering unit (150) using various encoding methods such as CABAC (Context-based Adaptive Binary Arithmetic Code) and Exponential Golomb.
[0039] Additionally, the entropy encoding unit (155) encodes information related to block division, such as CTU size, CU division flag, QT division flag, MTT division type, and MTT division direction, so that the video decoder can divide the block in the same way as the video encoding unit. Additionally, the entropy encoding unit (155) encodes information regarding a prediction type indicating whether the current block is encoded by intra prediction or by inter prediction, and encodes intra prediction information (i.e., information about the intra prediction mode) or inter prediction information (information about the reference picture and motion vector) according to the prediction type.
[0040] The inverse quantization unit (160) inversely quantizes the quantized transformation coefficients output from the quantization unit (145) to generate transformation coefficients. The inverse transformation unit (165) converts the transformation coefficients output from the inverse quantization unit (160) from the frequency domain to the spatial domain to restore the residual block.
[0041] The adder (170) restores the current block by adding the restored residual block and the prediction block generated by the prediction unit (120). The pixels within the restored current block are used as reference pixels when intra-predicting the next block in sequence.
[0042] The filter unit (180) performs filtering on the restored pixels to reduce blocking artifacts, ringing artifacts, blurring artifacts, etc. caused by block-based prediction and transformation / quantization. The filter unit (180) may include a deblocking filter (182) and a SAO (Sample Adaptive Offset) filter (184).
[0043] The deblocking filter (180) filters the boundaries between restored blocks to remove blocking artifacts caused by block-unit encoding / decoding, and the SAO filter (184) performs additional filtering on the deblocking filtered image. The SAO filter (184) is a filter used to compensate for the difference between the restored pixel and the original pixel caused by lossy coding.
[0044] The restored blocks filtered through the deblocking filter (182) and the SAO filter (184) are stored in memory (190). When all blocks within a picture are restored, the restored picture can be used as a reference picture for inter-predicting blocks within a picture to be encoded later.
[0045] FIG. 4 is an exemplary functional block diagram of an image decoding device capable of implementing the technologies of the present disclosure. Hereinafter, the image decoding device and its sub-components will be described with reference to FIG. 4.
[0046] The image decoding device may be configured to include an entropy decoding unit (410), a reordering unit (415), an inverse quantization unit (420), an inverse transformation unit (430), a prediction unit (440), an adder (450), a filter unit (460), and a memory (470).
[0047] Similar to the image encoding device of FIG. 1, each component of the image decoding device may be implemented in hardware or software, or in combination of hardware and software. Additionally, the function of each component may be implemented in software, and a microprocessor may be implemented to execute the function of the software corresponding to each component.
[0048] The entropy decoding unit (410) determines the current block to be decoded by decoding the bitstream generated by the video encoding device and extracting information related to block division, and extracts prediction information and information about residual signals necessary to restore the current block.
[0049] The entropy decoding unit (410) extracts information about the CTU size from the SPS (Sequence Parameter Set) or PPS (Picture Parameter Set) to determine the size of the CTU and divides the picture into CTUs of the determined size. Then, the CTU is determined as the top layer of the tree structure, i.e., the root node, and divides the CTU using the tree structure by extracting division information for the CTU.
[0050] For example, when splitting a CTU using a QTBTTT structure, first, a first flag (QT_split_flag) related to QT splitting is extracted to split each node into four nodes of the lower layer. Then, for the nodes corresponding to the leaf nodes of QT, a second flag (MTT_split_flag) related to MTT splitting and splitting direction (vertical / horizontal) and / or splitting type (binary / ternary) information are extracted to split the corresponding leaf nodes into an MTT structure. Through this, each node below the leaf nodes of QT is recursively split into a BT or TT structure.
[0051] As another example, when splitting a CTU using the QTBTTT structure, a CU splitting flag (split_cu_flag) indicating whether to split the CU is first extracted, and if the block is split, a first flag (QT_split_flag) is extracted. During the splitting process, each node may undergo zero or more iterative MTT splittings after zero or more iterative QT splittings. For example, the CTU may undergo MTT splitting immediately, or conversely, only multiple QT splittings may occur.
[0052] As another example, when splitting a CTU using a QTBT structure, a first flag (QT_split_flag) related to the splitting of QT is extracted to split each node into four nodes of the lower layer. Then, for the nodes corresponding to the leaf nodes of QT, a split flag (split_flag) indicating whether to further split into BTs and split direction information are extracted.
[0053] Meanwhile, when the entropy decoding unit (410) determines the current block to be decoded through the division of the tree structure, it extracts information regarding the prediction type indicating whether the current block is intra-predicted or inter-predicted. If the prediction type information indicates intra-predicted, the entropy decoding unit (410) extracts a syntax element for the intra-predicted information (intra-predicted mode) of the current block. If the prediction type information indicates inter-predicted, the entropy decoding unit (410) extracts a syntax element for the inter-predicted information, that is, information indicating a motion vector and a reference picture that the motion vector refers to.
[0054] Meanwhile, the entropy decoder (410) extracts information regarding the coding mode of the residual block (e.g., information regarding whether the residual block is encoded or only the sub-blocks of the residual block are encoded, information indicating the partition type selected to divide the residual block into sub-blocks, information identifying the encoded residual sub-blocks, quantization parameters, etc.) from the bitstream. Additionally, the entropy decoder (410) extracts information regarding the quantized transform coefficients of the current block as information regarding the residual signal.
[0055] The reordering unit (415) can change the sequence of one-dimensional quantized transformation coefficients entropy-decoded in the entropy decoding unit (410) back into a two-dimensional coefficient array (i.e., block) in the reverse order of the coefficient scanning order performed by the image encoding device.
[0056] The inverse quantization unit (420) inversely quantizes the quantized transformation coefficients, and the inverse transformation unit (430) generates a restored residual block for the current block by inversely transforming the inverse quantized transformation coefficients from the frequency domain to the spatial domain based on information regarding the coding mode of the residual block and restoring the residual signals.
[0057] The inverse transform unit (430) generates a restored residual block for the current block by performing an inverse transform on the inversely quantized transform coefficients using the size of the current block (and thus the size of the residual block to be restored) as the transform unit when information regarding the coding mode of the residual block indicates that the residual block of the current block has been encoded in the video encoding device.
[0058] Additionally, when the information regarding the coding mode of the residual block indicates that only one sub-block of the residual block has been encoded in the video encoding device, the inverse transformation unit (430) performs an inverse transformation on the inverse quantized transformation coefficients using the size of the transformed sub-block as the transformation unit to restore the residual signals for the transformed sub-block and fills the residual signals for the untransformed sub-block with "0" values, thereby generating a restored residual block for the current block.
[0059] The prediction unit (440) may include an intra prediction unit (442) and an inter prediction unit (444). The intra prediction unit (442) is activated when the prediction type of the current block is an intra prediction, and the inter prediction unit (444) is activated when the prediction type of the current block is an inter prediction.
[0060] The intra prediction unit (442) determines the intra prediction mode of the current block among a plurality of intra prediction modes from the syntax element for the intra prediction mode extracted from the entropy decoding unit (410), and predicts the current block using reference pixels around the current block according to the intra prediction mode. Additionally, the intra prediction unit (442) may generate a prediction block for the current block using the Matrix-based Intra Prediction (MIP) described later. The intra prediction unit (422) may generate a prediction block for the current block using boundary vectors derived from samples reconstructed to the left of the current block and samples reconstructed to the upper side of the current block, as well as predefined matrices and offset vectors.
[0061] The inter prediction unit (444) determines the motion vector of the current block and the reference picture that the motion vector refers to using the syntax element for the intra prediction mode extracted from the entropy decoding unit (410), and predicts the current block using the motion vector and the reference picture.
[0062] The adder (450) restores the current block by adding the residual block output from the inverse transformation unit and the prediction block output from the inter prediction unit or the intra prediction unit. The pixels within the restored current block are used as reference pixels when intra-predicting the block to be decoded later.
[0063] The filter unit (460) may include a deblocking filter (462) and an SAO filter (464). The deblocking filter (462) deblocks the boundaries between restored blocks to remove blocking artifacts caused by block-unit decoding. The SAO filter (464) performs additional filtering on the restored blocks after deblocking filtering to compensate for the difference between the restored pixels and the original pixels caused by lossy coding. The restored blocks filtered through the deblocking filter (462) and the SAO filter (464) are stored in memory (470). When all blocks within a picture are restored, the restored picture is used as a reference picture for inter-predicting blocks within a picture to be encoded later.
[0065] The technologies of the present disclosure generally relate to intra-predictive coding. The following description focuses primarily on decoding technologies, namely the operation of a video decoder, and the description of encoding technologies is simplified as it is contrary to the comprehensively described decoding technologies.
[0066] In discussions regarding the next-generation video coding standard (VVC; Versatile Video Coding), several new coding tools were introduced that enable better coding performance compared to the HEVC (High Efficiency Video Coding) standard.
[0067] Unlike HEVC, which can only use the reference sample line closest to the intra prediction, VVC can use two additional reference lines, known as MRL (Multiple Reference Line) intra prediction. These additional reference lines are available only for MPM modes and not for non-MPM modes. When the encoder performs prediction for each directional mode, it selects one of the three reference lines based on the RD COST. The index of the selected reference line (mrl_idx) is signaled separately and passed to the decoder.
[0068] Intra Sub-Partitions (ISP) is a coding tool that divides a CU into multiple sub-blocks of equal size in either the vertical or horizontal direction according to its dimensions, and performs predictions for each sub-block using the same intra prediction mode. The reconstructed sample values of each sub-block are available for prediction in the next sub-block, and this process is repeated for each sub-block. The minimum block size to which ISP is applicable is 4×8 or 8×4; if the block size is 4×8 or 8×4, it is divided into two, and if it is larger, it can be divided into four. ISP is not used if the block's MRL index is not zero.
[0069] Unlike general in-loop filtering applied directly to the restored image, LMCS (Luma Mapping with Chroma Scaling) enables efficient prediction and quantization by redistributing codewords for the dynamic range of the image signal, thereby improving encoding performance and image quality. LMCS includes luminance component mapping and chroma component scaling.
[0070] Luma mapping refers to an in-loop mapping that redistributes codewords within the dynamic range of an input luminance signal into codewords capable of improving encoding performance. Luma signal mapping can be performed through forward mapping and the corresponding backward mapping. Forward mapping divides the existing dynamic range into 16 identical segments and performs codeword redistribution of the input image using a linear model for each segment, while backward mapping performs inverse mapping from the mapped dynamic range back to the original dynamic range. Chroma scaling corrects the chroma signal based on the correlation between the luminance signal and the corresponding chroma signal.
[0071] Matrix-based Intra Prediction (MIP) is a new intra prediction technique introduced in VTM 5.0. The original idea was an intra prediction technique based on neural networks, that is, using multilayer neural networks to predict current PU pixel values based on adjacent reconstructed pixels. However, due to the high complexity of the prediction method using neural networks, an intra prediction technique based on affine linear transformations using pre-trained matrices was introduced.
[0072] To predict a rectangular block PU with width W and height H, the MIP takes H reconstructed samples from the left side of the block and W reconstructed samples from the top side of the block as input. The final predicted pixels are then obtained through averaging, matrix-vector multiplication, linear interpolation, etc.
[0073] The sizes of blocks to which MIP is applied are classified into the following three categories.
[0074]
[0075] Depending on idx(W,H), the number of MIP modes (numModes), boundary size (boundarySize), and prediction block size (predW, predH, predC) are defined as follows. In the table below, MipSizeId = idx(W,H).
[0076]
[0077] FIG. 5 is a conceptual diagram illustrating the main process of MIP technology that may be used in the techniques of the present disclosure.
[0078] (1) Averaging
[0079] The main purpose of this step is to normalize the reference samples. Depending on the block size and shape (width and height) (i.e., according to MipSizeId), 4 or 8 samples are obtained. If the current block's width and height are both 4 (W=H=4), a total of 4 samples are obtained, including 2 from the left and 2 from the top (boundarySize = 2). In the remaining cases, a total of 8 samples are obtained, including 4 from the left and 4 from the top (boundarySize = 4).
[0080] As shown in Fig. 5, the upper neighbor samples are It is denoted as , and the left neighbor samples are It is written as . and A downsampled sample set obtained by performing an average operation on each and is obtained. The average operation is the following downsampling process.
[0081]
[0082] In the above mathematical formula, bDwn is the downsampling scale value (nTbs / boundarySize), and refS refers to the original reference sample. The calculated redS is for the left neighbor. It is saved as, and in the case of the upper neighbor It is saved as.
[0083] Downsampled reference samples are stitched into a vector of length 4 or 8. Reduced boundary vector input to the vector-matrix multiplication operation. is defined as shown in the mathematical formula below. For example, when W=H=4 and the MIP mode is less than 18 and Boundary vectors are constructed by joining in the order, and if W=H=4 and the MIP mode is 18 or higher and They are joined in the order of. In the mathematical formula below, "mode" refers to the MIP mode.
[0084]
[0085] (2) Matrix-Vector Multiplication
[0086] At this stage, the reduced boundary vector Downsampled predicted signal of the current block from is generated. It is calculated as the sum of the matrix-vector product and offset as follows.
[0087]
[0089] * The size of is W red × H red is, W red and H red is defined as follows according to the size and shape of the current block. Matrix A is W red * H red It has that many rows; if W=H=4, it has 4 columns, and otherwise, it has 8 columns. Offset vector b is W red * H red It is a vector of size.
[0090]
[0091] Matrix that can be used for coding blocks A and offset vector b Sets S0, S1, and S2 are predefined according to categories of coding block sizes. The index (0, 1, 2) of set S is selected according to the aforementioned MipSizeId (i.e., idx(W,H)), and the matrix A and offset vector b It is extracted from one of sets S0, S1, and S2 according to the MIP mode applied to the current block.
[0092] Set S0 consists of 18 matrices, each with 16 rows and 4 columns ( A 0) and 18 16-dimensional offset vectors( b It consists of 0) and is used in a 4×4 block. Set S1 consists of 10 matrices, each having 16 rows and 8 columns ( A 1) and 10 16-dimensional offset vectors( b It consists of 1) and is used for blocks of size 4×8, 8×4, and 8×8. Finally, set S2 consists of 6 matrices, each having 64 rows and 8 columns ( A 2) and 6 64-dimensional offset vectors( b It consists of 2) and is used for all other block shapes.
[0093] (3) Pixel interpolation
[0094] Interpolation is an upsampling process. As mentioned above, is the downsampled prediction signal of the original block. In this case, a downsampled prediction block with sizes predW and predH is defined as follows.
[0095] pred red [x][y], with x = 0..predW - 1, y = 0..predH - 1
[0096] The prediction block of original block size (nTbW, nTbH), generated by linearly interpolating the prediction signal at the remaining positions according to each direction, is defined as follows.
[0097] predSamples[x][y], with x = 0..nTbW - 1, y = 0..nTbH - 1
[0098] Depending on the horizontal and vertical upsampling scale factors upHor (= nTbW / predW) and upVer (= nTbH / predH), as follows, Some or all of predSamples are filled from.
[0099] predSamples[(x+1) * upHor - 1][(y+1) * upVer - 1] = pred red [x][y]
[0100] If upHor = 1 All horizontal positions of predSamples are filled from, and if upVer = 1 All positions in the vertical direction of predSamples are filled from.
[0101] Subsequently, the remaining empty samples in predSamples are filled in using bi-linear interpolation. Horizontal and vertical interpolation are upsampling processes. For the interpolation of the left and upper samples within predSamples, the downsampled samples These are assigned to the values of predSamples[x][-1], and the original reference samples on the left These values are assigned to predSamples[-1][y]. The interpolation order is determined by the size of the current block. That is, interpolation is performed first in the direction of the shorter size, followed by interpolation in the direction of the longer size.
[0102] (4) Signaling of MIP intra-prediction mode
[0103] For each coding unit (CU) that is intra-predicted coded, a flag is transmitted indicating whether matrix-based intra-predicted mode (i.e., MIP mode) is applied. In the VVC 5 draft, for signaling MIP mode, a list of MPMs consisting of three MPMs is used, similar to the existing intra-predicted mode (hereinafter 'normal intra-predicted mode') rather than matrix-based intra-predicted. For example, intra_mip_mpm_flag, intra_mip_mpm_idx, and intra_mip_mpm_remainder are used for signaling MIP mode. intra_mip_mpm_idx is coded in truncated binary code, and intra_mip_mpm_remainder is coded in fixed-length code.
[0104] Depending on the size of the coding block (CU), up to 35 MIP modes can be supported. For example, for CUs where max(W, H) <= 8 and W*H < 32, 35 modes are available. Additionally, for CUs where max(W, H) = 8 and max(W, H) > 8, 19 and 11 prediction modes are used, respectively. Furthermore, a pair of modes (two modes) can share matrices and offset vectors to reduce memory requirements. Specific shared modes are calculated as follows. For example, for a 4×4 coding block, mode 19 uses the transposed matrix of the matrix allocated for mode 2.
[0105]
[0106] When there is a block to which MIP is applied surrounding a block to which a normalized intra prediction mode (hereinafter referred to as a 'normalized block') is applied rather than a matrix-based intra prediction (MIP), a mapping table defined between MIP modes and normalized modes may be used to derive the MPM of the normalized block. The mapping table is used to derive a normalized mode with similar characteristics from the MIP mode of a neighboring block to which MIP is applied. The normalized mode derived in this way is used to derive the MPM of the normalized block. Similarly, when a luminance block at the same location used in chroma DM derivation applies MIP, a mapping table is used to derive a normalized mode and use it for chroma DM derivation. The equation below represents the mapping between normalized modes and MIP modes using the mapping tables in Tables 3 and 4.
[0107]
[0108]
[0109]
[0110] As explained above, in VVC draft 5, when predicting blocks based on MIP, the reconstructed surrounding samples to the left of the block are always and reconstructed surrounding samples at the top of the block This is utilized. This approach may impair prediction performance for blocks whose textures have directional characteristics. Additionally, in VVC draft 5, for the interpolation of upper samples within predSamples, a downsampled set of samples is used, as shown in Fig. 5. By assigning and using the values of predSamples[x][-1], the interpolation process becomes more complex than necessary. Furthermore, in VVC draft 5, since MPM lists are used for signaling in MIP mode and normal mode respectively, the implementation can become very complex due to many checks and conditions, such as the requirement for mapping between MIP mode and normal mode.
[0111] In this regard, the present disclosure presents several improved techniques that can reduce the implementation complexity of MIP modes and improve prediction performance.
[0112] Use of smoothed filtered reference samples
[0113] In typical intra-predictive coding, smoothing filters, Gaussian interpolation filters, and cubic interpolation filters may be optionally used to obtain reference samples for directional modes. Figure 6 illustrates smoothing filtering and interpolation filtering. In the filtering process of reference samples, intra-predictive modes are classified into three groups. Group A consists of horizontal prediction modes and vertical prediction modes, Group B consists of diagonal modes that are multiples of 45 degrees, and Group C consists of other directional modes. No filters are applied to Group A. Since the diagonal modes belonging to Group B refer to pixels at integer positions, there is no need to apply interpolation filters, and only a [1, 2, 1] / 4 smoothing filter is applied to the reference samples. For group C, the [1, 2, 1] / 4 smoothing filter is not applied, and a 4-tap Gaussian interpolation filter or a 4-tap cubic interpolation filter is applied depending on the condition to obtain reference samples at prime positions.
[0114] Smoothing filtering for reference samples can be performed as follows. Hereinafter, the reference sample before filtering is denoted as refUnfilt[x][y], and the reference sample after filtering is denoted as refFilt[x][y]. Here, a [1, 2, 1] / 4 smoothing filter is used for filtering. refH and refW are the number of left reference samples and the number of upper reference samples, respectively.
[0115] - Filtering of top-left corner reference samples
[0116]
[0117] - Filtering of the left reference sample
[0118]
[0119] - Filtering of upper reference samples
[0120]
[0121] As shown in the formula above, filtering may be performed between adjacent reference samples located on the same reference line, but it may also be performed between reference samples located on different reference lines. For example, filtered reference samples can be obtained by calculating the average of two samples located at MRL indices 0 and 1.
[0122] As mentioned above, when using MIP, boundary samples of already decoded adjacent blocks located at the top and left of the coding block can constitute reference samples. In this case, boundary samples that have not undergone any filtering are used as reference samples. Considering that MIP mode is frequently used to predict and recover low-frequency components, it may be advantageous to filter the reference samples to remove high-frequency components and use the sample values in the MIP prediction process.
[0123] According to one aspect of the present disclosure, reference samples can be filtered and used in the MIP mode, as in the directional mode of normal intra prediction. Filtered reference samples and unfiltered reference samples can be adaptively used depending on the prediction mode of the block, the size of the block, the type of MIP mode, etc.
[0124] Filtering of reference samples may be performed when all of the following conditions are true. Therefore, if none of the following conditions are satisfied, the values of refUnfil are copied to refFilt as is without filtering. In some cases, when ISP is applied to a coding block, if the length of the width or height of a divided subblock is 16 or greater, filtering may be performed on the boundary of that side.
[0125] - The MRL index is 0.
[0126] - The product of nTbW and nTbH is greater than 32.
[0127] - cIdx is 0 (i.e., it is a luminance sample).
[0128] - IntraSubPartitionsSplitType is ISP_NO_SPLIT (i.e., ISP is applied) (does not do).
[0129] - refFilterFlag is 1 (i.e., the intra prediction mode is one of 0, 14, 12, 10, 6, 2, 34, 66, 72, 76, 78, 80 or one of the MIP modes).
[0130] Whether to perform filtering on reference pixels may be determined adaptively based on the size of the block to which MIP is applied. As previously mentioned, the sizes of the blocks to which MIP is applied are classified into three categories, and whether to perform filtering on reference pixels may be determined based on idx(W,H). For example, if Idx is less than 2 (i.e., blocks of size 4×4, 4×8, or 8×4), refUnfilt may be used, and if it is equal to 2, refFilt may be used. The opposite is also possible. As another example, if Idx is less than 1, refUnfilt may be used, and if it is greater than or equal to 1, refFilt may be used. The opposite is also possible. As yet another example, if the block size is 4×4, 4×8, or 8×4, refUnFilt may be used, and otherwise, refFilt may be used. The opposite is also possible. As another example, if either the width or the height of the block is equal to 4, refFilt may not be used. As another example, if either the width or the height of the block is equal to 4, refFilt may not be used.
[0131] Whether to perform filtering of reference pixels may be determined adaptively based on the shape of the block to which MIP is applied. For example, refFilt may be used only when the width and height of the coding block are the same. For another example, refFilt may be used only when the width and height of the coding block are different. As yet another example, by comparing the width and height of the coding block, refFilt may be used only for the boundaries of the longer block. Alternatively, it is possible to use refFilt only for the boundaries of the shorter block. As yet another example, refFilt may be used only for the boundaries of the side where either the width or height of the block is 16 or greater (or 32 or greater).
[0132] In some embodiments, a set of reference samples around the block being MIP-coded and It may be constructed as follows. For example, the reference sample set may be constructed from luminance samples mapped after LMCS (Luma Mapping with Chroma Scaling) around the block, or from luminance samples mapped before LMCS around the block. As another example, the reference sample set may be constructed from luminance samples of surrounding blocks before block boundary filtering for normalized intra prediction, or from luminance samples of surrounding blocks after block boundary filtering. As yet another example, the reference sample set may be constructed through the same process used for normalized intra prediction around the block.
[0133] Generation of input boundary vectors
[0134] As mentioned above, when predicting a coding block based on MIP, the reconstructed surrounding samples to the left of the block and reconstructed surrounding samples at the top of the block This can be used. However, this method may impair prediction performance in the case of blocks whose textures have directional characteristics.
[0135] Therefore, in order to reflect the directional characteristics that the block's texture can have, class Among these, it may be advantageous to selectively use a set of neighboring samples to generate the input boundary vector. For example, if the pixels of the current coding block have horizontal characteristics, it may be advantageous to generate a prediction signal using left neighbor samples. Similarly, if the pixels of the current coding block have vertical characteristics, it may be advantageous to generate a prediction signal using up neighbor samples. The set of neighboring samples to be used to generate the input boundary vector may also be determined differently depending on the MIP mode applied to the coding block.
[0136] For the sake of convenience of explanation, several methods for determining boundary vectors and prediction samples from them are described below, distinguishing between cases using left neighbor samples and cases using top neighbor samples.
[0137] A. Constructing a boundary vector using left neighbor samples
[0138] Figures 7a through 7c are conceptual diagrams showing an exemplary method of constructing a boundary vector input to a matrix-vector multiplication operation using left neighbor samples.
[0139] For example, as exemplified in FIG. 7a, the size (height) and boundary vector of the current coding block When the sizes are the same, the left neighbor sample set Using boundary vectors of the same size It can be filled. For example, each of the left neighbor samples can be included in the entry of the boundary vector.
[0140] As another example, as exemplified in Fig. 7b, the left neighbor sample set Downsampled sample set obtained from boundary vector using It could be filled. For example, Is It can be obtained by averaging two samples.
[0141] As another example, as exemplified in Fig. 7c, by using the two adjacent columns to the left to calculate the average value between two pixels in each row, the boundary vector It can be filled.
[0142] Adaptively depending on the size of the coding block and ... may also be used. For example, as shown in the mathematical formula below, if H <= 8 is used, and otherwise can be used.
[0143]
[0144] In some embodiments, downsampled sample set from In generating [it], different methods of downsampling may be performed depending on the characteristics of the video content. As with screen content coding (SCC), video content may have characteristics where pixel values or intensity values are identical within a specific area, or where pixel values or intensity values gradually increase or decrease. In such cases, through averaging Downsampled from Rather than generating By sampling only the entries corresponding to the even (or odd) positions of Generating can be useful for reducing downsampling complexity.
[0145] for example, It has H entries from [0] to [H-1], and from this, H / 2 size Assuming that it generates, if H≤8 as shown in the formula below Use as is, and otherwise take the entries corresponding to even positions including 0. This can be generated.
[0146]
[0147] Furthermore, As the entry value of the first position The downsampling complexity can also be further simplified by filling in all entries.
[0148]
[0149] These simplified downsampling and downsampling via average calculations can be selected depending on the characteristics of the video content. For example, if the coding block located to the left of the current block being MIP-coded applies Intra-Block Copy (IBC), a coding tool suitable for screen content coding, simple downsampling that takes entries corresponding to even (or odd) positions may be used. As another example, if the coding block located to the left of the current block being MIP-coded applies Transform Skip Mode, which is frequently used in screen content coding, simple downsampling that takes entries corresponding to even (or odd) positions may be used. As yet another example, downsampling via average calculations can be completely replaced by simple downsampling that takes entries corresponding to even (or odd) positions.
[0150] B. Constructing a boundary vector using upper neighbor samples
[0151] Figures 8a through 8c are conceptual diagrams showing an exemplary method of constructing a boundary vector input to a matrix-vector multiplication operation using upper neighbor samples.
[0152] For example, as illustrated in FIG. 8a, the size (width) and boundary vector of the current coding block When the sizes are the same, the upper neighbor sample set Using boundary vectors of the same size It can be filled. For example, each of the upper neighbor samples can be included in the entry of the boundary vector.
[0153] As another example, as exemplified in Fig. 8b, the upper neighbor sample set Downsampled sample set obtained from boundary vector using It could be filled. For example, Is It can be obtained by averaging two samples.
[0154] As another example, as exemplified in Fig. 8c, by using the two adjacent rows above and calculating the average value between two pixels in each column, the boundary vector It can be filled.
[0155] Adaptively depending on the size of the coding block and ... may also be used. For example, as shown in the mathematical formula below, if W<=8 is used, and otherwise can be used.
[0156]
[0157] As mentioned above, through the calculation of the average value Downsampled from Rather than generating By sampling only the entries corresponding to the even (or odd) positions of Generating can be useful for reducing downsampling complexity.
[0158] for example, A has W entries from [0] to [W-1], and from this, W / 2 size Assuming that it generates, if W≤8 as shown in the formula below Use as is, and otherwise take the entries corresponding to even positions including 0. This can be generated.
[0159]
[0160] Furthermore, As the entry value of the first position The downsampling complexity can also be further simplified by filling in all entries.
[0161]
[0162] These simplified downsampling and downsampling via average calculations can be selected depending on the characteristics of the video content. For example, if the coding block located to the left (or above) the current block being MIP-coded applies Intra-Block Copy (IBC), a coding tool suitable for screen content coding, simple downsampling that takes entries corresponding to even (or odd) positions may be used. As another example, if the coding block located to the left (or above) the current block being MIP-coded applies Transform Skip Mode, which is frequently used in screen content coding, simple downsampling that takes entries corresponding to even (or odd) positions may be used. As yet another example, downsampling via average calculations can be completely replaced by simple downsampling that takes entries corresponding to even (or odd) positions.
[0163] Matrix-vector multiplication
[0164] According to the MIP technique described in VVC draft 5, boundary vectors of length 4 or 8 from the left peripheral sample set and the upper peripheral sample set is obtained. Boundary vector It is input into the vector-matrix multiplication operation. Boundary vector Instead of this method of applying vector-matrix multiplication directly to, boundary vectors before applying vector-matrix multiplication It may be advantageous in terms of computational and hardware complexity to use a method that removes the DC component from and adds the DC component after applying vector-matrix multiplication. According to this method, all entries in the weight matrix used for vector-matrix multiplication can be represented as unsigned integers. That is, boundary vector Before applying vector-matrix multiplication to, It may be advantageous to make the average of the entries included in 0 or convert it to be close to 0.
[0165] For example, before applying vector-matrix multiplication, From each entry of You can subtract a single pixel value belonging to it. As another example, before applying vector-matrix multiplication, From each entry of You can subtract the average value of. As another example, before applying vector-matrix multiplication, From each entry of You can subtract the pixel value of the first entry.
[0166] As an example of implementation, the video encoder and decoder are boundary vectors Calculate the average value of and the boundary vector Vector-matrix multiplication can be applied to the vector obtained by subtracting the average value from each entry. Input boundary vectors used in the vector-matrix multiplication operation. can be defined as follows. Here, p_avr is the boundary vector It is the average value of, bitDepth represents the luma bit depth.
[0167] If MipSizeId (= idx(W,H)) is 0 or 1,
[0168]
[0169] When MipSizeId (= idx(W,H)) is 2,
[0170]
[0171] As another example of implementation, to avoid calculating the average value, the average value is a boundary vector Replacing it with the first entry of may be considered. In this case, the input boundary vector input to the vector-matrix multiplication operation It can be defined as follows.
[0172] If MipSizeId (= idx(W,H)) is 0 or 1,
[0173]
[0174] When MipSizeId (= idx(W,H)) is 2,
[0175]
[0176] That is, for the case where MipSizeId is 0 or 1, the input boundary vector The first entry of is half of the maximum value that can be represented by the bit depth ( ) and boundary vector Obtained based on the difference between the first entries of, and the input boundary vector The subsequent entries are boundary vectors It is obtained based on differencing the value of the first entry from each entry of. For MipSizeId = 2, the difference vector has a length of 7, and therefore the weight matrices (A2) of set S2 used for this have 64 rows and 7 columns respectively (in VVC draft 5, the weight matrices (A2) have 64 rows and 8 columns respectively).
[0177] In addition, by using the matrix mWeight[ x ][ y ], which has the offset vector pre-differentiated over the weight matrices (A0, A1, A2), instead of obtaining a predicted value accompanied by a slight error, The offset vector (b) can be removed from. According to the improved method, the prediction sample set pred red [x][y] can be calculated as follows.
[0178]
[0179] Here, , inSize is It is the size of.
[0180] Linear interpolation
[0181] Interpolation is required when the number of entries is smaller than the number of samples in the prediction block. A downsampled prediction block with sizes predW and predH is defined as follows.
[0182] pred red [x][y], with x = 0..predW - 1, y = 0..predH - 1
[0183] A prediction block of size (nTbW, nTbH) corresponding to a coding block, generated by linearly interpolating the prediction signal at the remaining positions according to each direction, is defined as follows.
[0184] predSamples[x][y], with x = 0..nTbW - 1, y = 0..nTbH - 1
[0185] Depending on the horizontal and vertical upsampling scale factors upHor (= nTbW / predW) and upVer (= nTbH / predH), as follows, Some or all of predSamples are filled from.
[0186] predSamples[(x+1) * upHor - 1][(y+1) * upVer - 1] = pred red [x][y]
[0187] If upHor = 1 All horizontal positions of predSamples are filled from, and if upVer = 1 All positions in the vertical direction of predSamples are filled from.
[0188] Subsequently, the remaining empty samples of predSamples are filled using bi-linear interpolation. Horizontal and vertical interpolation are upsampling processes. The interpolation order can be performed in a fixed sequence regardless of the size of the coding block. For example, interpolation can always be performed horizontally first, followed by vertical interpolation. In this case, before upsampling, pred red The values of [x][y] or predSamples[x][y] are 0 to 2 bitDepth Clipping can be performed so that it lies between -1. 2 bitDepth -1 is the maximum value that can be represented as bit depth.
[0189] For interpolation The reference pixels of the neighboring blocks can be referenced as follows. For example, the original reference samples at the top Assigned to these predSamples[x][-1] values, and the original reference samples on the left These can be assigned to the values of predSamples[-1][y]. As another example, luminance samples within neighboring blocks before or after the application of LMCS can be assigned to the locations of predSamples[x][-1] and predSamples[-1][y]. As yet another example, luminance samples within neighboring blocks before or after block boundary filtering for intra-prediction around coding blocks can be assigned to the locations of predSamples[x][-1] and predSamples[-1][y].
[0190] mip_transpose_flag
[0191] As previously mentioned, VVC draft 5 supports up to 35 MIP modes depending on the size and geometry of the coding block (CU). For example, for a CU where max(W, H) <= 8 && W*H < 32, 35 modes are available, while for a CU where max(W, H) = 8 and max(W, H) > 8, 19 and 11 prediction modes are used, respectively. Additionally, a pair of modes (two modes) can share matrices and offset vectors to reduce memory requirements. For example, for a 4×4 coding block, mode 19 uses the transposed matrix of the matrix allocated for mode 2. Furthermore, in an order determined by the MIP mode and the block size and By joining, the boundary vector input to the vector-matrix multiplication operation is generated.
[0192] An improved method can be used to achieve substantially equivalent coding efficiency while reducing complexity. According to another aspect of the present disclosure, instead of the conventional method in which one mode uses a transposed matrix used by another mode, for each mode, a boundary vector used in vector-matrix multiplication composing and A new method configured to allow changing the order of splicing can be used. For each mode, the video encoder boundary vector composing and It can signal a syntax element (mip_transpose_flag) that indicates the order of joining. The syntax element (mip_transpose_flag) and When instructing to join in the order, the prediction matrix obtained through matrix-vector multiplication can also be transposed. According to this method, the number of available MIP modes can be reduced to half the level of the existing method, and the coding complexity for generating boundary vectors and vector-matrix multiplication can be reduced.
[0193] Signaling in MIP mode
[0194] For a coding unit (CU) coded in intra prediction mode, a flag indicating whether the intra prediction type is matrix-based intra prediction (MIP) may be signaled. If MIP is applied, a syntax element indicating the MIP mode used for the current coding unit among multiple available MIP modes may be additionally signaled.
[0195] Unlike the existing intra prediction mode (normal intra prediction mode), an MPM list may not be used for signaling the MIP mode. For example, among multiple MIP modes, a single syntax element (e.g., intra_mip_mode) that can be coded as a truncated binary code indicating the MIP mode used in the current coding unit may be used.
[0196] A portion of the exemplary coding unit syntax proposed based on the VVC 5 draft is provided below. In the syntax below, graying out elements is used to aid understanding.
[0197]
[0198] If intra_mip_flag[x0][y0] is 1, it indicates that the intra prediction type of the current block is matrix-based intra prediction (MIP). If intra_mip_flag[x0][y0] is 0, it indicates that the intra prediction type of the current block is normalized intra prediction, not matrix-based intra prediction. If intra_mip_flag[x0][y0] does not exist, it can be inferred to be equal to 0. intra_mip_mode[x0][y0] indicates the MIP mode used for the current block in matrix-based intra prediction (MIP) and is represented by a truncated binary code.
[0199] MPM (Most Probable Mode)
[0200] In conventional approaches, intra-predictive coding using Most Probable Modes (MPMs) can be used. For example, in HEVC, a list of three MPMs is constructed from the intra-predictive modes of the left and top blocks. A disadvantage of this method is that more modes (non-MPM intra modes) belong to non-MPMs, which must be coded with more bits. Several methods have been proposed to extend the number of MPMs to three or more entries (e.g., six MPM modes). However, constructing such a list of MPMs containing more entries may require more checks and conditions, which can make the implementation more complex.
[0201] To keep the complexity of the MPM list configuration low, an MPM list containing six MPM candidates can be configured using the intra prediction modes of the left block and the top block adjacent to the current block. The MPM candidates may consist of a default intra prediction mode (e.g., PLANAR mode), an intra prediction mode of a neighboring block, and an intra prediction mode derived from the intra prediction mode of a neighboring block. When the intra prediction mode of a neighboring block is not used (e.g., when the neighboring block is inter-predicted, or when the neighboring block is located on a different slice or tile), the intra prediction mode of the neighboring block's intra prediction mode may be set to PLANAR.
[0202] Depending on the type of the intra-prediction mode of the left block (Left) and the top block (Above), there are broadly four cases. If Left and Above are different and both modes are directional modes, the MPM list can be generated by further distinguishing based on the difference between Left and Above. In the table below, Max refers to the larger of Left and Above modes, and MIN refers to the smaller of Left and Above modes.
[0203]
[0204] The video encoder may signal a 1-bit flag (e.g., mpm_flag) indicating whether the intra prediction mode of the current block corresponds to an MPM. Typically, if the intra prediction mode of the current block corresponds to an MPM, an additional MPM index is signaled indicating one of the six MPMs (i.e., PLANAR mode). Note in Table 6 that PLANAR mode is always included in the MPM list. That is, the six MPMs can be divided into PLANAR and five non-PLANAR MPMs. Therefore, it may be efficient for the encoder to explicitly signal whether the intra prediction mode of the current block is PLANAR mode (e.g., using a 1-bit flag) when the intra prediction mode of the current block is PLANAR mode, and to additionally signal an MPM index indicating one of the remaining five non-PLANAR MPMs when the intra prediction mode of the current block is identical to one of the remaining five non-PLANAR MPMs. If the intra prediction mode of the current block does not correspond to an MPM, a syntax element indicating one of the remaining 61 non-MPMs, excluding the 6 MPMs, can be encoded using a truncated binary code.
[0205] A. Removal of the mapping table between MIP mode and Normal mode
[0206] In VVC draft 5, MPM lists are used for signaling in MIP mode and normal mode, respectively, and a mapping table between MIP mode and normal mode is required to construct the MIP list. Due to the nature of the matrix-based intra prediction (MIP) technique, which includes mean and interpolation operations, the residual signal of a block to which MIP is applied may have a predominance of low-frequency components in the transform domain. The characteristics of this residual signal may be similar to those of a block to which PLANAR mode or DC mode is applied. Therefore, when deriving the MPM list for a block coded in normal intra prediction mode, the use of a mapping table between MIP mode and normal mode can be avoided by taking note of this similarity of residual signals.
[0207] According to one aspect of the present disclosure, in deriving an MPM list for a block coded in a normal intra-predicted mode (i.e., a normal block), if a neighbor block is coded in MIP mode, the intra-predicted mode of the neighbor block may be considered to be PLANAR mode (or DC mode). For example, if MIP mode is applied to a neighbor block, PLANAR mode (or DC mode) may be added to the MPM list instead of the MIP mode of the neighbor block. This eliminates the need for the encoder and decoder to store a mapping table between MIP mode and normal mode in memory.
[0208] Similarly, even when deriving chroma DM (direct mode), if MIP is applied to a luminance block at the same location, instead of using a mapping table between the MIP mode and the normal mode, the intra prediction mode of that luminance block can be considered as PLANAR mode (or DC mode). Thus, the encoder parses a syntax element specifying the intra prediction mode for a chroma block, and the syntax element indicates that the intra prediction mode of the chroma block uses the intra prediction mode of the luminance block at the same location as is, and if MIP is applied to that luminance block at the same location, the intra prediction mode of that luminance block can be considered as PLANAR mode (or DC mode). That is, when MIP is applied to a luminance block at the same location in chroma DM (direct mode), the intra prediction mode of the chroma block can be determined as PLANAR mode (or DC mode).
[0209] B. Integration of MIP mode into standard intra mode
[0210] Meanwhile, VVC draft 5 treats matrix-based intra prediction (MIP) as a separate intra prediction type distinct from normal intra prediction, and signals whether MIP is used at the CU level using the intra_mip_flag. If MIP is used, the selected MIP mode for the current CU is coded, and if MIP is not used, the selected normal intra prediction mode for the current CU is coded. Below, an alternative approach is presented that may improve the signaling efficiency of intra prediction modes. The proposed approach is based on replacing one of the normal modes (e.g., PLANAR, DC, or directional modes) with an MIP mode or adding an MIP mode as one of the normal modes. Replacing one of the normal modes with an MIP mode may be useful when there may be redundancy between the MIP mode and any normal mode. In such cases, the proposed approach may improve the signaling efficiency of intra prediction modes.
[0211] An exemplary method for decoding the intra-prediction mode of a coding block is described when the DC mode among the 67 aforementioned modes is replaced with the MIP mode.
[0212] The video decoder can use the MPM list to determine the intra_predictiton_mode[ x0 ][ y0 ] for a coding block. The video decoder can decode the MPM-related syntax elements to determine the intra_predictiton_mode[ x0 ][ y0 ]. If the value of intra_predictiton_mode[ x0 ][ y0 ] is one of {0, 2 ... 66}, the intra prediction type of the coding block is set to Normalized Intra Prediction. If the value of intra_predictiton_mode[ x0 ][ y0 ] is 1 (which was the mode index of the original INTRA_DC), the video decoder sets the intra prediction type of the coding block to Matrix-Based Intra Prediction (MIP) and decodes the syntax element indicating the MIP prediction mode used for encoding the coding block.
[0213] By utilizing the intra-prediction modes of the left block and the top block adjacent to the current coding block, an MPM list including, for example, 6 MPM candidates can be constructed. Depending on whether the mode of the left block (Left) and the mode of the top block (Above) are directional modes, there are four main cases. If Left and Above are different and both modes are directional modes, the MPM list can be generated by further dividing them into two cases based on the difference between Left and Above. In Table 7 below, Max refers to the larger mode between Left and Above, and Min refers to the smaller mode between Left and Above.
[0214]
[0215] Note in Table 7 that the MIP mode is always included in the MPM list. That is, the 6 MPMs can be distinguished into MIP and 5 non-MIP MPMs. Therefore, it may be efficient for the encoder to first signal whether the current block's intra-prediction mode is MIP mode (e.g., using a 1-bit flag) when the current block's intra-prediction mode is MPM, and if the current block's intra-prediction mode is not MIP mode, to additionally signal an MPM index indicating one of the remaining 5 non-MIP MPMs. When the current block's intra-prediction mode is not MPM, a syntax element indicating one of the remaining 61 non-MPMs, excluding the 6 MPMs, can be encoded using a truncated binary code.
[0216] While the normal intra prediction mode can be applied with VVC's Multiple Reference Line (MRL) and Intra Sub-Partition (ISP), the MIP mode can only be used when the MRL index is 0 (i.e., when using the reference samples of the first line) and when ISP is not applied. However, the MIP mode may be available regardless of whether MRL and ISP are applied.
[0217] A portion of the syntax related to an exemplary intra-prediction mode is provided below. In the syntax below, graying out elements is used to aid understanding.
[0218]
[0219] The intra prediction mode for the coding block of the luma component can be signaled using syntax elements including intra_luma_mpm_flag, intra_luma_not_MIP_flag, intra_luma_mpm_idx, intra_mip_mode, and intra_luma_mpm_remainder.
[0220] intra_luma_mpm_flag indicates whether the intra-predicted mode of a coding block is MPM mode. If intra_luma_mpm_flag does not exist, it is inferred that Intra_luma_mpm_flag is equal to 1. intra_luma_not_MIP_flag indicates whether the intra-predicted mode of a coding block is MIP mode, and if intra_luma_not_MIP_flag is 1, it indicates that the intra-predicted mode of the coding block is not MIP mode (i.e., is a normalized intra mode). intra_mip_mode specifies one MIP mode among multiple MIP modes available for the current size of the coding block and can be coded as a truncated binary code. If intra_luma_mpm_flag does not exist, it is inferred that intra_luma_mpm_flag is equal to 1.
[0221] intra_luma_mpm_idx specifies one MPM mode among the five non-MIP MPMs that is identical to the intra-prediction mode of the coding block. intra_luma_mpm_remainder specifies one non-MPM mode among the non-MPMs that is identical to the intra-prediction mode of the coding block. intra_luma_mpm_remainder can be coded as a truncated binary code.
[0222] Referring to Table 8, the video decoder parses intra_luma_not_MIP_flag when intra_luma_mpm_flag is 1 and MRL INDEX is 0 (i.e., intra_luma_ref_idx = 0). If intra_luma_not_MIP_flag is 0, the intra-predicted type of the coding block is MIP, and therefore the video decoder decodes intra_mip_mode to identify the MIP mode used in the coding block. If intra_luma_not_MIP_flag is 1, the video decoder constructs an MPM list consisting of 5 non-MIP MPMs and then decodes intra_luma_mpm_idx pointing to the MPM INDEX. If intra_luma_mpm_flag is 0, intra_luma_mpm_remainder is decoded.
[0223] FIG. 9 is a flowchart illustrating a method for decoding video data according to one embodiment of the present invention, employing some of the aforementioned improvements.
[0224] A video decoder can decode a syntax element from a bitstream that indicates the intra prediction type of the current block of video data (S910). The intra prediction type includes matrix-based intra prediction (MIP) and regular intra prediction. The syntax element may be a truncated binary code that specifies one of a plurality of matrix-based intra prediction modes allowed for the size and shape of the current block.
[0225] The video decoder can generate a prediction block for the current block by selectively performing matrix-based intra prediction or normalized intra prediction based on the intra prediction type of the current block.
[0226] As part of generating a prediction block for the current block by performing normalized intra prediction, the video decoder may perform the following steps (S920–S940). The video decoder may derive Most Probable Mode (MPM) candidates based on the normalized intra prediction modes of neighboring blocks adjacent to the current block to construct an MPM list for the current block (S920), and derive a normalized intra prediction mode for the current block based on the MPM list (S930). In deriving MPM candidates based on the normalized intra prediction modes of neighboring blocks, if the intra prediction type of the neighboring block is matrix-based intra prediction, the video decoder may set (consider) the normalized intra prediction mode of the neighboring block as PLANAR mode. The decoder may generate a prediction block for the current block using the normalized intra prediction mode of the current block (S940).
[0227] The video decoder may perform the following steps (S921–S951) as part of generating a prediction block for the current block by performing matrix-based intra prediction. The video decoder may decode a syntax element from the bitstream indicating a matrix-based intra prediction mode for the current block to determine a matrix-based intra prediction mode for the current block (S921). The video decoder derives an input boundary vector using surrounding samples adjacent to the current block based on the width and height of the current block (S931), and may generate prediction samples for the current block based on matrix-vector multiplication between a predefined matrix for the matrix-based intra prediction mode for the current block and the input boundary vector (S941). The video decoder may derive a prediction block for the current block by performing clipping, linear interpolation, etc., based on the prediction samples (S951).
[0228] A video decoder may generate an initial boundary vector filled with values of adjacent samples or downsampled from the adjacent samples according to the width and height of the current block, in order to derive an input boundary vector using adjacent samples adjacent to the current block, and may generate an input boundary vector to which the matrix-vector multiplication is applied by removing the DC component from the initial boundary vector. For example, removing the DC component from the initial boundary vector may involve or include differentiating the value of the first entry from each entry of the initial boundary vector. The first entry of the input boundary vector is obtained based on the difference between half of the maximum value that can be expressed as a bit depth and the first entry of the initial boundary vector, and subsequent entries of the input boundary vector may be obtained based on differentiating the value of the first entry from each entry of the initial boundary vector.
[0229] A video decoder can generate the initial boundary vector by decoding a syntax element that indicates the joining order between the first entries of the initial boundary vector derived from left peripheral samples adjacent to the current block and the second entries of the initial boundary vector derived from upper peripheral samples adjacent to the current block from the bitstream, and by joining the first entries and the second entries according to the joining order.
[0230] A video decoder may assign the predicted samples to locations within the predicted block and perform horizontal and vertical interpolation on the predicted samples, left-side peripheral samples adjacent to the current block, and upper-side peripheral samples adjacent to the current block in order to derive a predicted block for the current block based on the predicted samples, thereby generating predicted sample values for locations within the predicted block where the predicted samples are not assigned. The horizontal interpolation may be performed prior to the vertical interpolation.
[0231] When the current block is a lumina block composed of lumina components and the matrix-based intra prediction is performed, and the intra prediction mode of the chroma block corresponding to the lumina block uses the intra prediction mode of the lumina block as is, the intra prediction mode of the chroma block can be set to PLANAR mode.
[0232] It should be understood that the exemplary embodiments described above may be implemented in many different ways. The functions or methods described in one or more examples may be implemented in hardware, software, firmware, or any combination thereof. It should be understood that the functional components described herein are labeled as "...unit" to particularly emphasize their implementation independence.
[0233] Meanwhile, the various functions or methods described in this disclosure may be implemented as instructions stored in a non-transient recording medium that can be read and executed by one or more processors. A non-transient recording medium includes, for example, any type of recording device in which data is stored in a form readable by a computer system. For example, a non-transient recording medium includes storage media such as an EPROM (erasable programmable read-only memory), a flash drive, an optical drive, a magnetic hard drive, and a solid-state drive (SSD).
[0234] The foregoing description is merely an illustrative explanation of some embodiments according to the technical concept of the present invention, and those skilled in the art to which the present invention pertains will be able to make various modifications and variations within the scope of the essential characteristics of the present invention. Accordingly, the illustrative embodiments are intended to explain, not limit, the technical concept of the present invention, and the scope of the technical concept of the present invention is not limited by these embodiments. The scope of protection of the present invention shall be interpreted by the claims below, and all technical concepts within an equivalent scope shall be interpreted as being included within the scope of rights of the present invention.
Claims
Claim 1 A method for decoding video data comprises: a step of decoding a syntax element from a bitstream that indicates an intra prediction type of a current block of video data, wherein the intra prediction type includes matrix-based intra prediction (MIP) and regular intra prediction; and a step of selectively performing matrix-based intra prediction or regular intra prediction based on the intra prediction type of the current block indicated by the syntax element to generate a prediction block for the current block, wherein the step of generating a prediction block for the current block by performing matrix-based intra prediction comprises: a step of decoding a syntax element from the bitstream that indicates a matrix-based intra prediction mode for the current block, expressed as a truncated binary code specifying one of a plurality of matrix-based intra prediction modes allowed for the width and height of the current block; and a step of deriving an input boundary vector using surrounding samples adjacent to the current block based on the width and height of the current block. The method comprises: a step of generating prediction samples for the current block based on matrix-vector multiplication between a predefined matrix for the matrix-based intra-prediction mode and the input boundary vector; and a step of deriving a prediction block for the current block based on the prediction samples, wherein the step of deriving the input boundary vector includes: a step of generating an initial boundary vector filled with surrounding samples adjacent to the current block or values downsampled from the surrounding samples, according to the width and height of the current block;A method comprising the step of generating an input boundary vector to which the matrix-vector multiplication is to be applied from the initial boundary vector, wherein the step of generating the initial boundary vector comprises: decoding a syntax element indicating a joining order between a first entry of the initial boundary vector derived from left peripheral samples adjacent to the current block from the bitstream and a second entry of the initial boundary vector derived from upper peripheral samples adjacent to the current block; and joining the first entry and the second entry according to the joining order to generate the initial boundary vector. Claim 2 delete Claim 3 ◈Claim 3 was abandoned upon payment of the registration fee.◈ The method of Claim 1, wherein the step of generating an input boundary vector to which the matrix-vector multiplication is to be applied from the initial boundary vector comprises differentiating the value of the first entry from each entry of the initial boundary vector. Claim 4 ◈Claim 4 was abandoned upon payment of the registration fee.◈ The method of Claim 1, wherein the step of generating an input boundary vector to which the matrix-vector multiplication is to be applied from the initial boundary vector comprises: a step of deriving the first entry of the input boundary vector based on the difference between half of the maximum value that can be expressed in bit depth and the first entry of the initial boundary vector; and a step of deriving subsequent entries of the input boundary vector based on the difference of the value of the first entry from each entry of the initial boundary vector. Claim 5 delete Claim 6 ◈Claim 6 was abandoned upon payment of the registration fee.◈ The method of Claim 1, wherein the step of deriving a prediction block for the current block based on the prediction samples comprises: a step of assigning the prediction samples to locations within the prediction block; and a step of performing horizontal interpolation and vertical interpolation on the prediction samples, left peripheral samples adjacent to the current block, and upper peripheral samples adjacent to the current block to generate prediction sample values for locations within the prediction block where the prediction samples are not assigned. Claim 7 ◈Claim 7 was abandoned upon payment of the registration fee.◈ A method according to Claim 6, characterized in that the horizontal direction interpolation is performed prior to the vertical direction interpolation. Claim 8 ◈Claim 8 was abandoned upon payment of the registration fee.◈ In Claim 6, prior to performing the horizontal interpolation and vertical interpolation, the prediction samples are 0 to 2 bitDepth A method characterized by performing clipping on the prediction samples so as to be placed between - 1. Claim 9 ◈Claim 9 was abandoned upon payment of the registration fee.◈ Method according to Claim 1, wherein the current block is a lumina block composed of lumina components, the matrix-based intra prediction is performed on the lumina block, and when the intra prediction mode of the chroma block corresponding to the lumina block uses the intra prediction mode of the lumina block as is, the intra prediction mode of the chroma block is set to PLANAR mode. Claim 10 ◈Claim 10 was abandoned upon payment of the registration fee.◈ The method according to Claim 1, wherein the step of generating a prediction block for the current block by performing the normalized intra prediction comprises: a step of deriving Most Probable Mode (MPM) candidates based on the normalized intra prediction modes of surrounding blocks adjacent to the current block and constructing an MPM list for the current block; and a step of deriving a normalized intra prediction mode for the current block based on the MPM list, wherein if the intra prediction type of the surrounding block is matrix-based intra prediction, the normalized intra prediction mode of the surrounding block is considered to be a PLANAR mode. Claim 11 A method for encoding video data comprises: a step of encoding a syntax element representing an intra prediction type of a current block of video data into a bitstream, wherein the intra prediction type includes matrix-based intra prediction and normalized intra prediction; and a step of generating a prediction block for the current block by selectively performing matrix-based intra prediction or normalized intra prediction based on the intra prediction type of the current block represented by the syntax element, wherein the step of generating a prediction block for the current block by performing matrix-based intra prediction comprises: a step of encoding a syntax element representing a matrix-based intra prediction mode for the current block into a bitstream, wherein the syntax element representing the matrix-based intra prediction mode is represented as a truncated binary code specifying one of a plurality of matrix-based intra prediction modes allowed for the width and height of the current block; and a step of deriving an input boundary vector using surrounding samples adjacent to the current block based on the width and height of the current block. The method comprises: generating prediction samples for the current block based on matrix-vector multiplication between a predefined matrix for the matrix-based intra-prediction mode and the input boundary vector; and deriving a prediction block for the current block based on the prediction samples, wherein the step of deriving the input boundary vector includes generating an initial boundary vector filled with surrounding samples adjacent to the current block or values downsampled from the surrounding samples, depending on the width and height of the current block.A method comprising the step of generating an input boundary vector to which the matrix-vector multiplication is to be applied from the initial boundary vector, wherein the step of generating the initial boundary vector comprises: encoding a syntax element in the bitstream representing a joining order between first entries of the initial boundary vector derived from left peripheral samples adjacent to the current block and second entries of the initial boundary vector derived from upper peripheral samples adjacent to the current block; and joining the first entries and the second entries according to the joining order to generate the initial boundary vector. Claim 12 A method for providing video data to a video decoder comprises: a step of encoding the video data to generate a bitstream; and a step of transmitting the bitstream to the video decoder, wherein the step of generating the bitstream comprises: a step of encoding a syntax element representing an intra prediction type of a current block of video data into a bitstream, wherein the intra prediction type includes matrix-based intra prediction and normalized intra prediction; and a step of selectively performing matrix-based intra prediction or normalized intra prediction based on the intra prediction type of the current block represented by the syntax element to generate a prediction block for the current block, wherein the step of performing matrix-based intra prediction to generate a prediction block for the current block comprises: a step of encoding a syntax element representing a matrix-based intra prediction mode for the current block into a bitstream, wherein the syntax element representing the matrix-based intra prediction mode for the current block is represented as a truncated binary code specifying one of a plurality of matrix-based intra prediction modes allowed for the width and height of the current block. The method comprises: a step of deriving an input boundary vector using surrounding samples adjacent to the current block based on the width and height of the current block; a step of generating prediction samples for the current block based on matrix-vector multiplication between a matrix predefined for the matrix-based intra-prediction mode and the input boundary vector; and a step of deriving a prediction block for the current block based on the prediction samples, wherein the step of deriving the input boundary vector includes a step of generating an initial boundary vector filled with surrounding samples adjacent to the current block or values downsampled from the surrounding samples according to the width and height of the current block.A method comprising the step of generating an input boundary vector to which the matrix-vector multiplication is to be applied from the initial boundary vector, wherein the step of generating the initial boundary vector comprises: encoding a syntax element in the bitstream representing a joining order between first entries of the initial boundary vector derived from left peripheral samples adjacent to the current block and second entries of the initial boundary vector derived from upper peripheral samples adjacent to the current block; and joining the first entries and the second entries according to the joining order to generate the initial boundary vector. Claim 13 delete Claim 14 delete Claim 15 delete Claim 16 delete Claim 17 delete Claim 18 delete Claim 19 delete Claim 20 delete
