Apparatus and method for matrix-based intra prediction

The video decoding method employs matrix-based intra prediction to enhance coding efficiency for high-quality video data, addressing the challenges of high-resolution and immersive media by improving prediction performance and reducing complexity.

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

Patent Information

Application Number
JP2024099506
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-06-03
Filing Date
2024-06-20
Publication Date
2025-04-30
Estimated Expiration
2040-06-03

AI Technical Summary

Technical Problem

Current video coding technologies face challenges in efficiently compressing and transmitting high-quality video data, particularly for high-resolution and immersive media, which increases storage and transmission costs.

Method used

A video decoding method that uses matrix-based intra prediction (MIP) to improve coding efficiency by receiving flag information for using MIP, generating intra prediction samples based on MIP mode information, and producing reconstructed samples through truncated binary evolution of syntax elements.

Benefits of technology

The proposed method enhances overall video compression efficiency by reducing complexity and improving prediction performance through efficient intra-prediction, specifically for matrix-based intra prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007670908000053
    Figure 0007670908000053
  • Figure 0007670908000054
    Figure 0007670908000054
  • Figure 0007670908000055
    Figure 0007670908000055
Patent Text Reader

Abstract

To provide a method and a device for increasing the image coding efficiency.SOLUTION: An image decoding method according to the present document comprises the steps of: receiving flag information indicating whether matrix-based intra prediction (MIP) is to be used for a current block; receiving mode information of the matrix-based intra prediction (MIP) on the basis of the flag information; generating intra prediction samples for the current block on the basis of the MIP mode information; and generating reconstructed samples for the current block on the basis of the intra prediction samples; where a syntax element bin string for the MIP mode information is binarized by using a truncated binarization method.SELECTED DRAWING: Figure 17
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This document relates to video coding techniques, and more particularly to a matrix-based intra prediction apparatus and method. [Background technology]

[0002] In recent years, the demand for high-resolution, high-quality images / videos such as 4K or 8K or higher UHD (Ultra High Definition) images / videos is increasing in various fields. As the image / video data has higher resolution and quality, the amount of information or bits transmitted relatively increases compared to existing image / video data, so when transmitting image data using existing media such as wired or wireless broadband lines or storing image / video data using existing storage media, the transmission and storage costs increase.

[0003] In addition, interest in and demand for immersive media such as virtual reality (VR), artificial reality (AR) content, and holograms has been increasing in recent years, and the broadcast of images / videos that have different image characteristics from real images, such as game images, is increasing.

[0004] Accordingly, there is a demand for highly efficient image / video compression technology to effectively compress and transmit, store, and play back high-resolution, high-quality image / video information having the above-mentioned various characteristics. Summary of the Invention [Problem to be solved by the invention]

[0005] The technical problem of this document is to provide a method and apparatus for improving video coding efficiency.

[0006] Another technical problem of this document is to provide an efficient intra prediction method and apparatus.

[0007] Another technical problem of this document is to provide a video coding method and apparatus for matrix-based intra prediction.

[0008] Another technical object of the present invention is to provide a video coding method and apparatus for coding mode information for matrix-based intra prediction. [Means for solving the problem]

[0009] According to an embodiment of the present document, there is provided a video decoding method performed by a decoding device, the method including the steps of: receiving flag information indicating whether matrix-based intra-prediction (MIP) is used for a current block; receiving matrix-based intra-prediction (MIP) mode information based on the flag information; generating intra-prediction samples for the current block based on the MIP mode information; and generating reconstructed samples for the current block based on the intra-prediction samples, wherein a bin string of a syntax element for the MIP mode information may be binarized by a truncated binarization scheme.

[0010] The maximum length of the bin string of the syntax element for the MIP mode information can be set to different values ​​according to the size of the current block.

[0011] The maximum length is set to three values ​​according to the size of the current block, and when the width and height of the current block are four, the maximum length may be the largest.

[0012] The MIP mode information can be decoded in a bypass manner.

[0013] The MIP mode information may be index information indicating a MIP mode to be applied to the current block.

[0014] The step of generating the intra prediction sample may include a step of downsampling a reference sample adjacent to the current block to derive a reduced boundary sample, a step of deriving a reduced prediction sample based on multiplication of the reduced boundary sample and a MIP matrix, and a step of upsampling the reduced prediction sample to generate the intra prediction sample for the current block.

[0015] Here, the downscaled boundary samples may be downsampled by averaging the reference samples, and the intra prediction samples may be upsampled by linear interpolation of the downscaled prediction samples.

[0016] The MIP matrix can be derived based on the size of the current block and the index information.

[0017] The MIP matrix may be selected from one of three matrix sets classified according to the size of the current block, and each of the three matrix sets may include a plurality of MIP matrices.

[0018] According to an embodiment of the present document, there is provided a video encoding method performed by an encoding apparatus, the method including the steps of: deriving whether matrix-based intra prediction (MIP) is applied to a current block; if the MIP is applied to the current block, deriving intra prediction samples of the current block based on the MIP; deriving residual samples for the current block based on the intra prediction samples; and encoding information on the residual samples and information on the MIP, where the information on the MIP includes the matrix-based intra prediction (MIP) mode information, and a bin string of a syntax element for the MIP mode information may be binarized by a truncated binarization scheme.

[0019] According to another embodiment of the present document, a digital storage medium may be provided on which encoded video information generated by a video encoding method performed by an encoding device and video data including a bitstream are stored.

[0020] According to yet another embodiment of the present document, a digital storage medium may be provided that stores encoded video information and video data including a bitstream that causes a decoding device to perform the video decoding method. Effect of the Invention

[0021] The present document may have various effects. For example, according to an embodiment of the present document, it is possible to improve the overall image / video compression efficiency. Alternatively, according to an embodiment of the present document, it is possible to improve the overall coding efficiency by reducing the implementation complexity and improving the prediction performance through efficient intra prediction. Alternatively, according to an embodiment of the present document, it is possible to improve the coding efficiency by efficiently coding index information indicating the intra prediction based on a matrix.

[0022] The effects obtained through a specific example of this document are not limited to the effects listed above. For example, there may be various technical effects that a person having ordinary skill in the related art can understand or derive from this document. Thus, the specific effects of this document are not limited to those explicitly described in this document, and may include various effects that can be understood or derive from the technical features of this document. [Brief description of the drawings]

[0023] [Figure 1] FIG. 1 is a diagram illustrating the configuration of a video / image encoding device that can be applied to an embodiment of the present document.

[0024] [Diagram 2] FIG. 1 is a diagram illustrating the configuration of a video / image decoding device that can be applied to an embodiment of the present document.

[0025] [Diagram 3] Illustratively, CABAC (context-adaptive binary arithmetic coding) is used to encode syntax elements.

[0026] [Figure 4] 1 illustrates an example of a general intra-prediction based video encoding method to which embodiments of the present document can be applied.

[0027] [Diagram 5] 1 illustrates a schematic diagram of an intra prediction unit in an encoding device.

[0028] [Figure 6] 1 illustrates an example of a general intra-prediction based video decoding method to which embodiments of the present document can be applied.

[0029] [Figure 7] 2 illustrates a schematic diagram of an intra-prediction unit in a decoding device.

[0030] [Figure 8] 1 illustrates an example of an intra-prediction mode to which embodiments of the present document can be applied.

[0031] [Figure 9] FIG. 1 is a diagram illustrating a procedure for generating predicted samples based on MIP according to an example.

[0032] [Figure 10] FIG. 1 illustrates the MIP procedure for a 4×4 block.

[0033] [Figure 11] FIG. 2 illustrates the MIP procedure for an 8×8 block.

[0034] [Figure 12] FIG. 1 illustrates the MIP procedure for an 8×4 block.

[0035] [Figure 13] FIG. 2 illustrates the MIP procedure for a 16×16 block.

[0036] [Figure 14] FIG. 13 is a diagram for explaining a boundary averaging procedure in the MIP procedure.

[0037] [Figure 15] FIG. 2 is a diagram for explaining linear interpolation in the MIP procedure.

[0038] [Figure 16] FIG. 1 is a diagram for explaining the MIP technique according to an example of this document.

[0039] [Figure 17]1 is a flow chart illustrating a schematic decoding method that can be performed by a decoding device according to an embodiment of the present document.

[0040] [Figure 18] 1 is a flow chart illustrating an encoding method that can be performed by an encoding device according to an embodiment of the present document;

[0041] [Figure 19] 1 illustrates generally an example of a video / image coding system to which embodiments of the present document may be applied;

[0042] [Figure 20] 1 illustrates an example of a content streaming system to which the embodiments disclosed herein may be applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0043] Although this document may have various modifications and various embodiments, a specific embodiment will be illustrated in the drawings and described in detail. However, this is not intended to limit this document to a specific embodiment. Commonly used terms in this document are used merely to describe a specific embodiment, and are not intended to limit the technical ideas in this document. A singular expression includes a plural expression unless the context clearly indicates otherwise. In this document, the terms "include" or "have" are intended to specify the presence of a feature, number, step, operation, component, part, or combination thereof described in the document, and should be understood not to preclude the possibility of the presence or addition of one or more different features, numbers, steps, operations, components, parts, or combinations thereof.

[0044] Meanwhile, each component in the drawings described in this document is shown independently for the convenience of explaining the different characteristic functions, and does not mean that each component is realized by separate hardware or software. For example, two or more components among the components may be combined to form one component, and one component may be divided into multiple components. An embodiment in which each component is integrated and / or separated is also included in the scope of the rights of this document as long as it does not deviate from the essence of this document.

[0045] In this document, "A or B" may mean "only A," "only B," or "both A and B." In other words, in this document, "A or B" may be interpreted as "A and / or B." For example, in this document, "A, B or C" may mean "only A," "only B," "only C," or "any combination of A, B and C."

[0046] As used in this document, a slash ( / ) or a comma can mean "and / or." For example, "A / B" can mean "A and / or B." Thus, "A / B" can mean "only A," "only B," or "both A and B." For example, "A, B, C" can mean "A, B, or C."

[0047] In this document, "at least one of A and B" may mean "only A," "only B," or "both A and B." Also, in this document, the expressions "at least one of A or B" and "at least one of A and / or B" may be interpreted as "at least one of A and B."

[0048] Also, in this document, "at least one of A, B and C" can mean "only A," "only B," "only C," or "any combination of A, B and C." Furthermore, "at least one of A, B or C" and "at least one of A, B and / or C" can mean "at least one of A, B and C."

[0049] Furthermore, parentheses used in this document may mean "for example." Specifically, when "prediction (intra prediction)" is displayed, "intra prediction" may be proposed as an example of "prediction." In other words, "prediction" in this document is not limited to "intra prediction," and "intra prediction" may be proposed as an example of "prediction." Furthermore, even when "prediction (i.e., intra prediction)" is displayed, "intra prediction" may be proposed as an example of "prediction."

[0050] Technical features described individually in one drawing in this document may be embodied individually or simultaneously.

[0051] This document relates to video / image coding. For example, the methods / embodiments disclosed in this document may be applied to methods disclosed in the versatile video coding (VVC) standard, the essential video coding (EVC) standard, the AOMedia Video 1 (AV1) standard, the 2nd generation of audio video coding standard (AVS2), or the next generation video / image coding standard (ex. H.267 or H.268, etc.).

[0052] Various embodiments relating to video / image coding are presented herein and, unless otherwise stated, the embodiments may be implemented in combination with each other.

[0053] In this document, a video may mean a collection of a series of images over time. A picture generally means a unit showing one image at a specific time, and a slice / tile is a unit constituting a part of a picture in coding. A slice / tile may include one or more coding tree units (CTUs). A picture may be composed of one or more slices / tiles. A picture may be composed of one or more tile groups. A tile group may include one or more tiles. A brick may represent a rectangular region of CTU rows within a tile in a picture. A tile may be partitioned into multiple bricks, each of which consisting of one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may be also referred to as a brick.A brick scan may indicate a specific sequential ordering of CTUs partitioning a picture, in which the CTUs are ordered consecutively in CTU raster scan in a brick, bricks within a tile are ordered consecutively in a raster scan of the bricks of the tile, and tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture. A tile is a rectangular region of CTUs within a particular tile column and a particular tile row in a picture. The tile column is a rectangular region of CTUs having a height equal to the height of the picture and a width specified by syntax elements in the picture parameter set.The tile row is a rectangular region of CTUs having a height specified by syntax elements in the picture parameter set and a width equal to the width of the picture. A tile scan is a specific sequential ordering of CTUs partitioning a picture in which the CTUs are ordered consecutively in CTU raster scan in a tile whereas tiles in a picture are ordered consecutively in a raster scan of the tiles of the picture. A slice includes an integer number of bricks of a picture that may be exclusively contained in a single NAL unit. A slice may consist of either a number of complete tiles or only a consecutive sequence of complete bricks of one tile.In this document, tile group and slice are sometimes used interchangeably. For example, in this document, tile group / tile group header may be called slice / slice header.

[0054] A pixel or a pel may mean the smallest unit constituting one picture (or image). A term corresponding to a pixel may also be used as a "sample." A sample may generally refer to a pixel or a pixel value, may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. Alternatively, a sample may refer to a pixel value in the spatial domain, or may refer to a transform coefficient in the frequency domain when such a pixel value is transformed into the frequency domain.

[0055] A unit may indicate a basic unit of image processing. A unit may include at least one of a specific region of a picture and information about the corresponding region. One unit may include one luma block and two chroma (e.g., cb, cr) blocks. The unit may be used in combination with terms such as block or area, depending on the case. In a general case, an M×N block may include a set (or array) of samples or transform coefficients consisting of M columns and N rows.

[0056] Hereinafter, preferred embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Hereinafter, the same components in the drawings will be designated by the same reference numerals, and duplicated descriptions of the same components may be omitted.

[0057] 1 is a diagram for illustrating a schematic configuration of a video / image encoding device that can be applied to an embodiment of the present document. Hereinafter, the video encoding device may include an image encoding device.

[0058] Referring to FIG. 1, the encoding apparatus 100 may include an image partitioner 110, a predictor 120, a residual processor 130, an entropy encoder 140, an adder 150, a filter 160, and a memory 170. The predictor 120 may include an inter predictor 121 and an intra predictor 122. The residual processor 130 may include a transformer 132, a quantizer 133, a dequantizer 134, and an inverse transformer 135. The residual processor 130 may further include a subtractor 131. The adder 150 may be referred to as a reconstructor or a reconstructed block generator. The image division unit 110, the prediction unit 120, the residual processing unit 130, the entropy encoding unit 140, the addition unit 150, and the filtering unit 160 may be configured by one or more hardware components (e.g., an encoder chipset or a processor) according to an embodiment. In addition, the memory 170 may include a decoded picture buffer (DPB) and may be configured by a digital storage medium. The hardware components may further include the memory 170 as an internal / external component.

[0059] The image division unit 110 may divide an input image (or a picture or a frame) input to the encoding device 100 into one or more processing units. As an example, the processing units may be called coding units (CUs). In this case, the coding units may be recursively divided from a coding tree unit (CTU) or a largest coding unit (LCU) according to a quad-tree binary-tree ternary-tree (QTBTTT) structure. For example, one coding unit may be divided into a plurality of coding units of a deeper depth based on a quad-tree structure, a binary tree structure, and / or a ternary structure. In this case, for example, the quad-tree structure may be applied first, and then the binary tree structure and / or the ternary structure may be applied. Alternatively, the binary tree structure may be applied first. The coding procedure according to this document may be performed based on the final coding unit that is not further divided. In this case, the largest coding unit may be used as the final coding unit immediately based on coding efficiency according to image characteristics, or the coding unit may be recursively divided into coding units of lower depths as necessary, and the coding unit of the optimal size may be used as the final coding unit. Here, the coding procedure may include procedures such as prediction, transformation, and restoration, which will be described later. As another example, the processing unit may further include a prediction unit (PU) or a transform unit (TU). In this case, the prediction unit and the transform unit may each be divided or partitioned from the final coding unit described above.The prediction unit may be a unit of sample prediction, and the transform unit may be a unit for deriving transform coefficients and / or a unit for deriving a residual signal from the transform coefficients.

[0060] The unit may be used interchangeably with terms such as block or area, depending on the case. In the general case, an M×N block may refer to a set of samples or transform coefficients consisting of M columns and N rows. A sample may generally refer to a pixel or pixel value, or may refer to only a pixel / pixel value of a luma component, or may refer to only a pixel / pixel value of a chroma component. A sample may be used as a term corresponding to a pixel or pel of one picture (or image).

[0061] The encoding apparatus 100 may generate a residual signal (residual block, residual sample array) by subtracting a prediction signal (predicted block, prediction sample array) output from the inter prediction unit 121 or the intra prediction unit 122 from an input video signal (original block, original sample array), and the generated residual signal is transmitted to the conversion unit 132. In this case, as shown, a unit in the encoding apparatus 100 that subtracts a prediction signal (predicted block, prediction sample array) from an input video signal (original block, original sample array) may be called a subtraction unit 131. The prediction unit may perform prediction on a block to be processed (hereinafter, referred to as a current block) and generate a predicted block including a prediction sample for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied in units of the current block or CU. The prediction unit may generate various information related to prediction, such as prediction mode information, and transmit the information to the entropy encoding unit 140, as will be described later in the description of each prediction mode. The prediction-related information can be encoded by the entropy encoding unit 140 and output in the form of a bitstream.

[0062] The intra prediction unit 122 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on the prediction mode. Prediction modes in intra prediction may include a plurality of non-directional modes and a plurality of directional modes. The non-directional modes may include, for example, a DC mode and a planar mode. The directional modes may include, for example, 33 directional prediction modes or 65 directional prediction modes depending on the fineness of the prediction direction. However, this is merely an example, and more or less directional prediction modes may be used depending on the settings. The intra prediction unit 122 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.

[0063] The inter prediction unit 121 may derive a predicted block for a current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between a neighboring block and a current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring block may include a spatial neighboring block present in the current picture and a temporal neighboring block present in the reference picture. The reference picture including the reference block and the reference picture including the temporal neighboring block may be the same or different. The temporal neighboring block may be called a collocated reference block, a collocated CU (col CU), etc., and the reference picture including the temporal neighboring block may be called a collocated picture (colPic). For example, the inter prediction unit 121 may generate information indicating which candidate is used to construct a motion information candidate list based on neighboring blocks and derive a motion vector and / or a reference picture index for the current block. Inter prediction may be performed based on various prediction modes, and for example, in the case of skip mode and merge mode, the inter prediction unit 121 may use motion information of neighboring blocks as motion information of the current block. In the case of skip mode, unlike the merge mode, a residual signal may not be transmitted.In the case of motion vector prediction (MVP) mode, the motion vector of the current block can be indicated by using the motion vector of a neighboring block as a motion vector predictor and signaling the motion vector difference.

[0064] The prediction unit 120 may generate a prediction signal based on various prediction methods described later. For example, the prediction unit may apply not only intra prediction or inter prediction for prediction of one block, but also intra prediction and inter prediction simultaneously. This may be called combined inter and intra prediction (CIIP). The prediction unit may also be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for coding of content images / moving images such as games, for example, as in screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document. The palette mode may be seen as an example of intra coding or intra prediction. When the palette mode is applied, a sample value within a picture may be signaled based on information regarding a palette table and a palette index.

[0065] The prediction signal generated through the prediction unit (including the inter prediction unit 121 and / or the intra prediction unit 122) may be used to generate a restored signal or may be used to generate a residual signal. The transform unit 132 may generate transform coefficients by applying a transform technique to the residual signal. For example, the transform technique may include at least one of a discrete cosine transform (DCT), a discrete sine transform (DST), a Karhunen-Loeve transform (KLT), a graph-based transform (GBT), or a conditionally non-linear transform (CNT). Here, the GBT refers to a transform obtained from a graph when the relationship information between pixels is expressed as a graph. The CNT refers to a transform obtained based on a prediction signal generated using all previously reconstructed pixels. In addition, the transform process may be applied to pixel blocks having the same square size, or may be applied to blocks of variable sizes that are not square.

[0066] The quantization unit 133 quantizes the transform coefficients and transmits the quantized transform coefficients to the entropy encoding unit 140, and the entropy encoding unit 140 may encode the quantized signal (information on the quantized transform coefficients) and output the encoded signal as a bitstream. The information on the quantized transform coefficients may be referred to as residual information. The quantization unit 133 may rearrange the quantized transform coefficients in a block form into a one-dimensional vector form based on a coefficient scan order, and may generate information on the quantized transform coefficients based on the quantized transform coefficients in the one-dimensional vector form. The entropy encoding unit 140 may perform various encoding methods, such as exponential Golomb, context-adaptive variable length coding (CAVLC), and context-adaptive binary arithmetic coding (CABAC). The entropy encoding unit 140 may also encode information required for video / image reconstruction (e.g., values ​​of syntax elements, etc.) together with or separately from the quantized transform coefficients. The encoded information (e.g., encoded video / image information) may be transmitted or stored in the form of a bitstream in network abstraction layer (NAL) unit units. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). The video / image information may further include general constraint information. In this document, information and / or syntax elements transmitted / signaled from an encoding device to a decoding device may be included in the video / image information. The video / image information may be encoded through the above-mentioned encoding procedure and included in the bitstream.The bitstream may be transmitted via a network or stored in a digital storage medium, where the network may include a broadcasting network and / or a communication network, and the digital storage medium may include various storage media such as a USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. A transmitting unit (not shown) for transmitting the signal output from the entropy encoding unit 140 and / or a storing unit (not shown) for storing the signal may be configured as an internal / external element of the encoding apparatus 100, or the transmitting unit may be included in the entropy encoding unit 140.

[0067] The quantized transform coefficients output from the quantizer 133 may be used to generate a prediction signal. For example, a residual signal (residual block or residual sample) may be reconstructed by applying inverse quantization and inverse transform to the quantized transform coefficients via the inverse quantizer 134 and the inverse transformer 135. The adder 155 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the reconstructed residual signal to the prediction signal output from the inter prediction unit 121 or the intra prediction unit 122. When there is no residual for the current block, such as when the skip mode is applied, the predicted block may be used as the reconstructed block. The adder 250 may be referred to as a reconstruction unit or a reconstructed block generator. The generated reconstructed signal may be used for intra prediction of the next current block in the current picture, and may also be used for inter prediction of the next picture after filtering, as described below.

[0068] Meanwhile, luma mapping with chroma scaling (LMCS) may be applied during picture encoding and / or reconstruction.

[0069] The filtering unit 160 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 160 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may store the modified reconstructed picture in the memory 170, specifically, in the DPB of the memory 170. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc. The filtering unit 160 may generate various information related to filtering and transmit it to the entropy encoding unit 140, as will be described later in the description of each filtering method. The filtering information may be encoded by the entropy encoding unit 140 and output in the form of a bitstream.

[0070] The modified reconstructed picture transmitted to the memory 170 can be used as a reference picture in the inter prediction unit 121. When inter prediction is applied through this, the encoding apparatus can avoid a mismatch in prediction between the encoding apparatus 100 and the decoding apparatus, and can also improve encoding efficiency.

[0071] The DPB of the memory 170 may store the modified reconstructed picture to be used as a reference picture in the inter prediction unit 121. The memory 170 may store motion information of a block from which motion information in the current picture is derived (or encoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 121 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 170 may store a reconstructed sample of a reconstructed block in the current picture and transmit it to the intra prediction unit 122.

[0072] FIG. 2 is a diagram illustrating a schematic configuration of a video / image decoding device that can be applied to an embodiment of this document.

[0073] Referring to FIG. 2, the decoding device 200 may be configured to include an entropy decoder 210, a residual processor 220, a predictor 230, an adder 240, a filter 250, and a memory 260. The predictor 230 may include an inter predictor 231 and an intra predictor 232. The residual processor 220 may include a dequantizer 221 and an inverse transformer 221. The entropy decoding unit 210, the residual processor 220, the predictor 230, the adder 240, and the filter 250 may be configured as one hardware component (e.g., a decoder chipset or processor) according to an embodiment. Also, the memory 260 may include a decoded picture buffer (DPB) and may be configured as a digital storage medium. The hardware components may further include a memory 260 as an internal / external component.

[0074] When a bitstream including video / image information is input, the decoding apparatus 200 can restore an image corresponding to a process in which the video / image information is processed by the encoding apparatus of FIG. 1. For example, the decoding apparatus 200 can derive units / blocks based on information on block division acquired from the bitstream. The decoding apparatus 200 can perform decoding using a processing unit applied in the encoding apparatus. Thus, the processing unit for decoding may be, for example, a coding unit, and the coding unit may be divided from a coding tree unit or a maximal coding unit according to a quad tree structure, a binary tree structure, and / or a ternary tree structure. One or more transform units may be derived from the coding unit. Then, the restored image signal decoded and output by the decoding apparatus 200 can be reproduced through a reproduction device.

[0075] The decoding apparatus 200 may receive a signal output from the encoding apparatus of FIG. 1 in the form of a bitstream, and the received signal may be decoded via the entropy decoding unit 210. For example, the entropy decoding unit 210 may derive information (e.g., video / image information) required for image restoration (or picture restoration) by parsing the bitstream. The video / image information may further include information on various parameter sets, such as an adaptation parameter set (APS), a picture parameter set (PPS), a sequence parameter set (SPS), or a video parameter set (VPS). In addition, the video / image information may further include general constraint information. The decoding apparatus may further decode pictures based on information on the parameter set and / or the general constraint information. Signaling / received information and / or syntax elements described later in this document may be decoded via the decoding procedure and obtained from the bitstream. For example, the entropy decoding unit 210 may decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values ​​of syntax elements required for image restoration and quantized values ​​of transform coefficients related to residuals. More specifically, the CABAC entropy decoding method may receive bins corresponding to each syntax element in a bitstream, determine a context model using syntax element information to be decoded, decoding information of neighboring and to-be-decoded blocks, or information of symbols / bins decoded in a previous step, predict the occurrence probability of the bins according to the determined context model, and perform arithmetic decoding of the bins to generate symbols corresponding to the values ​​of each syntax element.In this case, the CABAC entropy decoding method may update the context model using information of the decoded symbol / bin for the context model of the next symbol / bin after determining the context model. Prediction information from the information decoded by the entropy decoding unit 210 may be provided to a prediction unit (inter prediction unit 232 and intra prediction unit 231), and residual values ​​entropy-decoded by the entropy decoding unit 210, i.e., quantized transform coefficients and related parameter information, may be input to the residual processing unit 220. The residual processing unit 220 may derive a residual signal (residual block, residual sample, residual sample array). In addition, filtering information from the information decoded by the entropy decoding unit 210 may be provided to the filtering unit 250. Meanwhile, a receiving unit (not shown) for receiving a signal output from the encoding device may be further configured as an internal / external element of the decoding device 200, or the receiving unit may be a component of the entropy decoding unit 210. Meanwhile, the decoding device according to this document may be called a video / image / picture decoding device, and the decoding device may be divided into an information decoder (video / image / picture information decoder) and a sample decoder (video / image / picture sample decoder). The information decoder may include the entropy decoding unit 210, and the sample decoder may include at least one of the inverse quantization unit 221, the inverse transform unit 222, the addition unit 240, the filtering unit 250, the memory 260, the inter prediction unit 232, and the intra prediction unit 231.

[0076] The inverse quantization unit 221 may inverse quantize the quantized transform coefficients and output the transform coefficients. The inverse quantization unit 221 may rearrange the quantized transform coefficients in a two-dimensional block form. In this case, the rearrangement may be performed based on a coefficient scanning order performed in the encoding device. The inverse quantization unit 221 may perform inverse quantization on the quantized transform coefficients using a quantization parameter (e.g., quantization step size information) and obtain transform coefficients.

[0077] The inverse transform unit 222 inversely transforms the transform coefficients to obtain a residual signal (residual block, residual sample array).

[0078] The prediction unit may perform prediction on a current block and generate a predicted block including prediction samples for the current block. The prediction unit may determine whether intra prediction or inter prediction is applied to the current block based on the prediction information output from the entropy decoding unit 210, and may determine a specific intra / inter prediction mode.

[0079] The prediction unit 220 may generate a prediction signal based on various prediction methods, which will be described later. For example, the prediction unit may apply intra prediction or inter prediction for prediction of one block, and may simultaneously apply intra prediction and inter prediction. This may be called combined inter and intra prediction (CIIP). In addition, the prediction unit may be based on an intra block copy (IBC) prediction mode or a palette mode for prediction of a block. The IBC prediction mode or palette mode may be used for content image / movie coding such as games, for example, screen content coding (SCC). IBC basically performs prediction within a current picture, but may be performed similarly to inter prediction in deriving a reference block within the current picture. That is, IBC may use at least one of the inter prediction techniques described in this document. The palette mode may be seen as an example of intra coding or intra prediction. When the palette mode is applied, information regarding a palette table and a palette index may be included in the video / image information and signaled.

[0080] The intra prediction unit 231 may predict the current block by referring to samples in the current picture. The referenced samples may be located in the neighborhood of the current block or may be located away from the current block depending on the prediction mode. Prediction modes in intra prediction may include a plurality of non-directional modes and a plurality of directional modes. The intra prediction unit 231 may also determine a prediction mode to be applied to the current block using prediction modes applied to neighboring blocks.

[0081] The inter prediction unit 232 may derive a predicted block for the current block based on a reference block (reference sample array) identified by a motion vector on a reference picture. In this case, in order to reduce the amount of motion information transmitted in the inter prediction mode, the motion information may be predicted in units of blocks, sub-blocks, or samples based on the correlation of motion information between neighboring blocks and the current block. The motion information may include a motion vector and a reference picture index. The motion information may further include inter prediction direction (L0 prediction, L1 prediction, Bi prediction, etc.) information. In the case of inter prediction, the neighboring blocks may include spatial neighboring blocks present in the current picture and temporal neighboring blocks present in the reference picture. For example, the inter prediction unit 232 may configure a motion information candidate list based on the neighboring blocks and derive a motion vector and / or a reference picture index for the current block based on the received candidate selection information. Inter prediction may be performed based on various prediction modes, and the information on the prediction may include information indicating a mode of inter prediction for the current block.

[0082] The adder 240 may generate a reconstructed signal (reconstructed picture, reconstructed block, reconstructed sample array) by adding the acquired residual signal to a prediction signal (predicted block, predicted sample array) output from a prediction unit (including the inter prediction unit 232 and / or the intra prediction unit 231). When there is no residual for a current block, such as when a skip mode is applied, the predicted block may be used as a reconstructed block.

[0083] The adder 240 may be referred to as a reconstruction unit or a reconstruction block generator. The generated reconstruction signal may be used for intra prediction of a next block to be processed in a current picture, and may be output after filtering as described below, or may be used for inter prediction of a next picture.

[0084] Meanwhile, luma mapping with chroma scaling (LMCS) can be applied during the picture decoding process.

[0085] The filtering unit 250 may apply filtering to the reconstructed signal to improve subjective / objective image quality. For example, the filtering unit 250 may apply various filtering methods to the reconstructed picture to generate a modified reconstructed picture, and may transmit the modified reconstructed picture to the memory 260, specifically, to the DPB of the memory 260. The various filtering methods may include, for example, deblocking filtering, sample adaptive offset, an adaptive loop filter, a bilateral filter, etc.

[0086] The (modified) reconstructed picture stored in the DPB of the memory 260 may be used as a reference picture in the inter prediction unit 232. The memory 260 may store motion information of a block from which motion information in the current picture is derived (or decoded) and / or motion information of a block in an already reconstructed picture. The stored motion information may be transmitted to the inter prediction unit 232 to be used as motion information of a spatial neighboring block or motion information of a temporal neighboring block. The memory 260 may store reconstructed samples of reconstructed blocks in the current picture and transmit them to the intra prediction unit 231.

[0087] In this document, the embodiments described for the filtering unit 160, the inter prediction unit 121 and the intra prediction unit 122 of the encoding device 100 can also be applied identically or correspondingly to the filtering unit 250, the inter prediction unit 232 and the intra prediction unit 231 of the decoding device 200, respectively.

[0088] As described above, prediction is performed to improve compression efficiency when performing video coding. Through this, a predicted block including a predicted sample for a current block, which is a block to be coded, can be generated. Here, the predicted block includes a predicted sample in a spatial domain (or a pixel domain). The predicted block is derived in the same way by an encoding device and a decoding device, and the encoding device can improve the efficiency of video coding by signaling information on the residual between an original block and a predicted block (residual information) to a decoding device, rather than the original sample value of the original block itself. The decoding device can derive a residual block including a residual sample based on the residual information, combine the residual block with the predicted block to generate a reconstructed block including a reconstructed sample, and generate a reconstructed picture including the reconstructed block.

[0089] The residual information may be generated through a transform and quantization procedure. For example, the encoding apparatus may derive a residual block between an original block and a predicted block, perform a transform procedure on the residual samples (residual sample array) included in the residual block to derive transform coefficients, perform a quantization procedure on the transform coefficients to derive quantized transform coefficients, and signal the related residual information (through a bitstream) to a decoding apparatus. Here, the residual information may include information such as value information, position information, transform technique, transform kernel, and quantization parameter of the quantized transform coefficients. The decoding apparatus may perform an inverse quantization / inverse transform procedure based on the residual information to derive a residual sample (or a residual block). The decoding apparatus may generate a reconstructed picture based on the predicted block and the residual block. The encoding apparatus may also derive a residual block by inverse quantizing / inverse transforming the quantized transform coefficients for reference for inter-prediction of a subsequent picture, and generate a reconstructed picture based on the residual block.

[0090] Meanwhile, as described above, the encoding apparatus can perform various encoding methods such as exponential Golomb, CAVLC (context-adaptive variable length coding), CABAC (context-adaptive binary arithmetic coding), etc. Also, the decoding apparatus can decode information in a bitstream based on a coding method such as exponential Golomb coding, CAVLC, or CABAC, and output values ​​of syntax elements required for image restoration and quantized values ​​of transform coefficients related to residuals.

[0091] For example, the coding method described above can be performed as follows:

[0092] FIG. 3 illustrates an example of CABAC (context-adaptive binary arithmetic coding) for encoding a syntax element. For example, in the CABAC encoding process, when an input signal is not a binary value but a syntax element, an encoding device may binarize the value of the input signal and convert the input signal into a binary value. Also, when the input signal is already a binary value (i.e., the value of the input signal is a binary value), the binarization may be bypassed. Here, each binary digit 0 or 1 constituting a binary value may be referred to as a bin. For example, when a binary string after binarization is 110, 1, 1, and 0 are each referred to as one bin. The bin for one syntax element may indicate the value of the syntax element. Such binarization may be based on various binarization methods such as a truncated rice binarization process and a fixed-length binarization process, and the binarization method for a target syntax element may be predefined. The binarization procedure may be performed by a binarization unit within an entropy encoding unit.

[0093] Thereafter, the binarized bins of the syntax element may be input to a regular encoding engine or a bypass encoding engine. The regular encoding engine of the encoding device may assign a context model reflecting a probability value to a corresponding bin, and may encode the corresponding bin based on the assigned context model. The regular encoding engine of the encoding device may update the context model for the corresponding bin after performing encoding for each bin. As described above, the bins to be encoded may be referred to as context-coded bins.

[0094] Meanwhile, when the binarized bin of the syntax element is input to the bypass encoding engine, it can be coded as follows. For example, the bypass encoding engine of the encoding device omits a procedure of estimating a probability for an input bin and a procedure of updating a probability model applied to the bin after encoding. When bypass encoding is applied, the encoding device can encode the input bin by applying a uniform probability distribution instead of allocating a context model, thereby improving the encoding speed. As described above, the bin to be encoded can be referred to as a bypass bin.

[0095] Entropy decoding can refer to a process of performing the same process as the entropy encoding in reverse order.

[0096] A decoding device (entropy decoding unit) may decode encoded image / video information. The image / video information may include partitioning information, prediction information (e.g., inter / intra prediction classification information, intra prediction mode information, inter prediction mode information, etc.), residual information, in-loop filtering information, etc., or may include various syntax elements related thereto. The entropy coding may be performed in units of syntax elements.

[0097] The decoding apparatus may perform binarization on the target syntax element. Here, the binarization may be based on various binarization methods such as a truncated rice binarization process, a fixed-length binarization process, etc., and the binarization method for the target syntax element may be predefined. The decoding apparatus may derive available bin strings (candidate bin strings) for available values ​​of the target syntax element through the binarization procedure. The binarization procedure may be performed by a binarization unit in an entropy decoding unit.

[0098] The decoding device sequentially decodes and parses each bin for the target syntax element from the input bits in the bitstream, and compares the derived bin string with the available bin string for the corresponding syntax element. If the derived bin string is the same as one of the available bin strings, a value corresponding to the corresponding bin string is derived as the value of the corresponding syntax element. If not, the next bit in the bitstream is further parsed, and the above-mentioned procedure is performed again. Through this process, the corresponding information can be signaled using a variable length of bits without using start bits or end bits for specific information (specific syntax element) in the bitstream. Thus, relatively fewer bits can be allocated to low values, and overall coding efficiency can be improved.

[0099] A decoding device can decode each bin in the bin string from the bitstream based on an entropy coding technique such as CABAC or CAVLC based on a context model or based on a bypass.

[0100] When a syntax element is decoded based on a context model, a decoding device may receive a bin corresponding to the syntax element through a bitstream, and may determine a context model using the syntax element and decoding information of a block to be decoded or a neighboring block, or information of a symbol / bin decoded in a previous step, and may predict an occurrence probability of the received bin according to the determined context model, perform arithmetic decoding of the bin, and derive a value of the syntax element. Thereafter, the context model of the bin to be decoded next may be updated with the determined context model.

[0101] A context model may be assigned and updated for each context coded (regularly coded) bin, and the context model may be indicated based on ctxIdx or ctxInc. ctxIdx may be derived based on ctxInc. Specifically, for example, a context index (ctxIdx) indicating a context model for each of the normally coded bins may be derived as a sum of a context index increment (ctxInc) and a context index offset (ctxIdxOffset). Here, the ctxInc may be derived differently for each bin. The ctxIdxOffset may be represented as the lowest value of the ctxIdx. The ctxIdxOffset is a value generally used for distinction from context models for other syntax elements, and a context model for one syntax element may be distinguished / derived based on ctxInc.

[0102] In the entropy encoding procedure, it is possible to determine whether to perform encoding via a regular coding engine or via a bypass coding engine, and switch the coding path. Entropy decoding performs the same process as entropy encoding in reverse order.

[0103] Meanwhile, for example, when a syntax element is bypass decoded, a decoding device may receive a bin corresponding to the syntax element through a bitstream and may decode the input bin by applying a uniform probability distribution. In this case, the decoding device may omit a procedure of deriving a context model of the syntax element and a procedure of updating the context model applied to the bin after decoding.

[0104] As described above, the residual samples may be derived as quantized transform coefficients through a transform and quantization process. The quantized transform coefficients may also be called transform coefficients. In this case, the transform coefficients in a block may be signaled in the form of residual information. The residual information may include a residual coding syntax. That is, an encoding device may configure a residual coding syntax from the residual information, encode the syntax, and output the syntax in the form of a bitstream, and a decoding device may decode the residual coding syntax from the bitstream to derive residual (quantized) transform coefficients. The residual coding syntax may include syntax elements indicating whether a transform is applied to a corresponding block, where the last valid transform coefficient in the block is located, whether a valid transform coefficient exists in a subblock, and what the magnitude / sign of the valid transform coefficient is, as described below.

[0105] Meanwhile, when intra prediction is performed, correlation between samples can be used to obtain a difference between an original block and a predicted block, i.e., a residual. The above-mentioned transform and quantization can be applied to the residual, and spatial redundancy can be removed through this. Hereinafter, an encoding method and a decoding method using intra prediction will be described in detail.

[0106] Intra prediction refers to a prediction that generates a prediction sample for a current block based on a reference sample outside the current block in a picture including the current block (hereinafter, the current picture). Here, the reference sample outside the current block refers to a sample located in the neighborhood of the current block. When intra prediction is applied to the current block, neighboring reference samples used for intra prediction of the current block can be derived.

[0107] For example, when the size (width x height) of the current block is nW x nH, the surrounding reference samples of the current block may include a total of 2 x nH samples adjacent to the left boundary and bottom-left of the current block, a total of 2 x nW samples adjacent to the top boundary and top-right of the current block, and one sample adjacent to the top-left of the current block. Alternatively, the surrounding reference samples of the current block may include multiple columns of top surrounding samples and multiple rows of left surrounding samples. In addition, the surrounding reference samples of the current block may include a total of nH samples adjacent to the right boundary of the current block having a size of nW x nH, a total of nW samples adjacent to the bottom boundary of the current block, and one sample adjacent to the bottom-right of the current block.

[0108] However, some of the neighboring reference samples of the current block may not yet be decoded or may not be available. In this case, the decoding apparatus may substitute unavailable samples with available samples to construct neighboring reference samples to be used for prediction. Alternatively, the decoding apparatus may construct neighboring reference samples to be used for prediction through interpolation of available samples.

[0109] When the neighboring reference samples are derived, (i) the prediction sample may be derived based on an average or an interpolation of the neighboring reference samples of the current block, or (ii) the prediction sample may be derived based on a reference sample that exists in a specific (prediction) direction with respect to the prediction sample among the neighboring reference samples of the current block. In the case of (i), it may be applied when the intra prediction mode is a non-directional mode or a non-angular mode, and in the case of (ii), it may be applied when the intra prediction mode is a directional mode or an angular mode.

[0110] In addition, a prediction sample may be generated by interpolating a first neighboring sample located in a prediction direction of an intra prediction mode of the current block and a second neighboring sample located in an opposite direction to the prediction direction based on a prediction sample of the current block among the neighboring reference samples. The above case may be called linear interpolation intra prediction (LIP). In addition, a chroma prediction sample may be generated based on a luma sample using a linear model. In this case, it may be called LM mode.

[0111] Also, a tentative prediction sample of the current block may be derived based on the filtered neighboring reference samples, and the prediction sample of the current block may be derived by weighting the tentative prediction sample and at least one reference sample derived according to an intra prediction mode among existing neighboring reference samples, i.e., non-filtered neighboring reference samples. The above case may be called Position Dependent Intra Prediction (PDPC).

[0112] Also, the intra prediction coding may be performed by selecting a reference sample line with the highest prediction accuracy from among multiple reference sample lines around the current block, deriving a prediction sample using a reference sample located in a prediction direction in the corresponding line, and signaling the used reference sample line to a decoding device. The above case may be called multi-reference line (MRL) intra prediction or MRL-based intra prediction.

[0113] Also, the current block may be divided into vertical or horizontal sub-partitions, and intra prediction may be performed based on the same intra prediction mode, and neighboring reference samples may be derived and used in units of sub-partitions. That is, in this case, the intra prediction mode for the current block is applied to the sub-partitions in the same way, and neighboring reference samples may be derived and used in units of sub-partitions, thereby improving the performance of intra prediction as the case may be. Such a prediction method may be called intra sub-partitions (ISP) or intra prediction based on ISP.

[0114] The above-mentioned intra prediction methods may be called intra prediction types, distinguished from intra prediction modes. The intra prediction types may be called various terms, such as intra prediction techniques or additional intra prediction modes. For example, the intra prediction types (or additional intra prediction modes, etc.) may include at least one of the above-mentioned LIP, PDPC, MRL, and ISP. A general intra prediction method other than the specific intra prediction types, such as the LIP, PDPC, MRL, and ISP, may be called a normal intra prediction type. The normal intra prediction type may be generally applied when the above-mentioned specific intra prediction types are not applied, and prediction may be performed based on the above-mentioned intra prediction modes. Meanwhile, post-processing filtering may be performed on the derived prediction samples, if necessary.

[0115] Meanwhile, in addition to the above-mentioned intra prediction types, a matrix based intra prediction (MIP) can be used as a method for intra prediction. MIP can be referred to as Affine linear weighted intra prediction (ALWIP) or Matrix weighted intra prediction (MWIP).

[0116] When MIP is applied to a current block, a prediction sample for the current block may be derived by i) using neighboring reference samples that have been subjected to an averaging procedure, ii) performing a matrix-vector-multiplication procedure, and iii) further performing a horizontal / vertical interpolation procedure as necessary. The intra prediction mode used for the MIP may be configured differently from the intra prediction mode used in the above-mentioned LIP, PDPC, MRL, and ISP intra prediction, and normal intra prediction.

[0117] The intra prediction mode for MIP may be referred to as an "affine linear weighted intra prediction mode" or a matrix-based intra prediction mode. For example, a matrix and an offset used in matrix-vector multiplication may be set differently depending on the intra prediction mode for MIP. Here, the matrix may be referred to as an (affine) weight matrix, and the offset may be referred to as an (affine) offset vector or an (affine) bias vector. In this document, the intra prediction mode for MIP may be referred to as an MIP intra prediction mode, a linear weighted intra prediction mode, a matrix weighted intra prediction mode, or a matrix based intra prediction mode. A specific MIP method will be described later.

[0118] The following drawings are created to explain a specific example of the present document. The names of specific devices and specific terms and names (e.g., syntax names, etc.) described in the drawings are presented for illustrative purposes only, and the technical features of the present document are not limited to the specific names used in the following drawings.

[0119] 4 shows an example of a video encoding method based on a schematic intra prediction to which an embodiment of the present document can be applied, and FIG 5 shows a schematic intra prediction unit in an encoding device. The intra prediction unit in the encoding device of FIG 5 may be applied in the same or corresponding manner to the intra prediction unit 122 of the encoding device 100 of FIG 1 described above.

[0120] 4 and 5, S400 may be performed by the intra prediction unit 122 of the encoding apparatus, and S410 may be performed by the residual processing unit 130 of the encoding apparatus. Specifically, S410 may be performed by the subtraction unit 131 of the encoding apparatus. In S420, prediction information may be derived by the intra prediction unit 122 and encoded by the entropy encoding unit 140. In S420, residual information may be derived by the residual processing unit 130 and encoded by the entropy encoding unit 140. The residual information is information about a residual sample. The residual information may include information about a quantized transform coefficient for the residual sample. As described above, the residual sample may be derived as a transform coefficient through the transform unit 132 of the encoding apparatus, and the transform coefficient may be derived as a quantized transform coefficient through the quantization unit 133. Information about the quantized transform coefficient may be encoded in the entropy encoding unit 140 through a residual coding procedure.

[0121] The encoding apparatus performs intra prediction on a current block (S400). The encoding apparatus may derive an intra prediction mode / type for the current block, derive surrounding reference samples for the current block, and generate prediction samples in the current block based on the intra prediction mode / type and the surrounding reference samples. Here, the procedures of determining the intra prediction mode / type, deriving the surrounding reference samples, and generating the prediction samples may be performed simultaneously, or one of the procedures may be performed prior to the other procedures.

[0122] For example, the intra prediction unit 122 of the encoding apparatus may include an intra prediction mode / type determination unit 122-1, a reference sample derivation unit 122-2, and a prediction sample derivation unit 122-3, where the intra prediction mode / type determination unit 122-1 determines an intra prediction mode / type for a current block, the reference sample derivation unit 122-2 derives a neighboring reference sample of the current block, and the prediction sample derivation unit 122-3 derives a prediction sample of the current block. Meanwhile, although not shown, if a filtering procedure of the prediction sample is performed, the intra prediction unit 122 may further include a prediction sample filter unit (not shown). The encoding apparatus may determine a mode / type to be applied to the current block from among a plurality of intra prediction modes / types. The encoding apparatus may compare RD costs for the intra prediction modes / types to determine an optimal intra prediction mode / type for the current block.

[0123] As described above, the encoding apparatus may also perform a filtering procedure of the prediction samples. The filtering of the prediction samples may be called post-filtering. The filtering procedure of the prediction samples may filter some or all of the prediction samples. In some cases, the filtering procedure of the prediction samples may be omitted.

[0124] The encoding apparatus generates a residual sample for the current block based on the (filtered) predicted sample (S410). The encoding apparatus may derive the residual sample by comparing the predicted sample with a phase base based on the original samples of the current block.

[0125] The encoding apparatus may encode video information including information on intra prediction (prediction information) and residual information on residual samples (S420). The prediction information may include intra prediction mode information and intra prediction type information. The residual information may include a syntax for residual coding. The encoding apparatus may transform / quantize the residual samples to derive quantized transform coefficients. The residual information may include information on the quantized transform coefficients.

[0126] The encoding device may output the encoded video information in the form of a bitstream, and the output bitstream may be transmitted to a decoding device via a storage medium or a network.

[0127] As described above, the encoding apparatus can generate a reconstructed picture (including reconstructed samples and reconstructed blocks). To this end, the encoding apparatus can again inverse quantize / inverse transform the quantized transform coefficients to derive (modified) residual samples. The reason for again performing inverse quantization / inverse transform after transforming / quantizing the residual samples is to derive the same residual samples as the residual samples derived by the decoding apparatus, as described above. The encoding apparatus can generate a reconstructed block including reconstructed samples for the current block based on the predicted samples and the (modified) residual samples. A reconstructed picture for the current picture can be generated based on the reconstructed block. As described above, an in-loop filtering procedure, etc. can be further applied to the reconstructed picture.

[0128] 6 shows an example of a video decoding method based on a schematic intra prediction to which an embodiment of the present document can be applied, and FIG 7 shows a schematic intra prediction unit in a decoding device. The intra prediction unit in the decoding device of FIG 7 may be applied in the same or corresponding manner to the intra prediction unit 231 of the decoding device 200 of FIG 2 described above.

[0129] 6 and 7, the decoding apparatus may perform operations corresponding to those performed by the encoding apparatus described above. S600 to S620 may be performed by an intra prediction unit 231 of the decoding apparatus, and prediction information of S600 and residual information of S630 may be acquired from a bitstream by an entropy decoding unit 210 of the decoding apparatus. The residual processing unit 220 of the decoding apparatus may derive a residual sample for a current block based on the residual information. Specifically, the inverse quantization unit 221 of the residual processing unit 220 may derive a transform coefficient by performing inverse quantization based on a quantized transform coefficient derived based on the residual information, and the inverse transform unit 222 of the residual processing unit may perform an inverse transform on the transform coefficient to derive a residual sample for a current block. S640 may be performed by an adder 240 or a reconstruction unit of the decoding apparatus.

[0130] The decoding apparatus may derive an intra prediction mode / type for a current block based on received prediction information (intra prediction mode / type information) (S600). The decoding apparatus may derive neighboring reference samples for the current block (S610). The decoding apparatus generates prediction samples in the current block based on the intra prediction mode / type and the neighboring reference samples (S620). In this case, the decoding apparatus may perform a filtering procedure of the prediction samples. The filtering of the prediction samples may be referred to as post-filtering. The filtering procedure of the prediction samples may filter some or all of the prediction samples. Depending on the case, the filtering procedure of the prediction samples may be omitted.

[0131] The decoding apparatus generates a residual sample for the current block based on the received residual information (S630). The decoding apparatus generates a reconstructed sample for the current block based on the prediction sample and the residual sample, and may derive a reconstructed block including the reconstructed sample (S640). A reconstructed picture for the current picture may be generated based on the reconstructed block. As described above, an in-loop filtering procedure or the like may be further applied to the reconstructed picture.

[0132] Here, the intra prediction unit 231 of the decoding device may include an intra prediction mode / type determination unit 231-1, a reference sample derivation unit 231-2, and a prediction sample derivation unit 231-3, where the intra prediction mode / type determination unit 231-1 determines an intra prediction mode / type for a current block based on intra prediction mode / type information acquired from the entropy decoding unit 210, the reference sample derivation unit 231-2 derives neighboring reference samples of the current block, and the prediction sample derivation unit 231-3 derives a prediction sample of the current block. Meanwhile, although not shown, if the above-mentioned prediction sample filtering procedure is performed, the intra prediction unit 231 may further include a prediction sample filter unit (not shown).

[0133] The intra prediction mode information may include, for example, flag information (ex.intra_luma_mpm_flag) indicating whether a most probable mode (MPM) is applied to the current block or a remaining mode is applied. In this case, if MPM is applied to the current block, the prediction mode information may further include index information (ex.intra_luma_mpm_idx) indicating one of intra prediction mode candidates (MPM candidates). The intra prediction mode candidates (MPM candidates) may be configured in an MPM candidate list or an MPM list. In addition, if MPM is not applied to the current block, the intra prediction mode information may further include remaining mode information (ex.intra_luma_mpm_remainder) indicating one of the remaining intra prediction modes excluding the intra prediction mode candidates (MPM candidates). The decoding apparatus may determine the intra prediction mode of the current block based on the intra prediction mode information.

[0134] Also, the intra prediction type information may be implemented in various forms. As an example, the intra prediction type information may include index information of intra prediction type indicating one of intra prediction types. As another example, the intra prediction type information may include at least one of reference sample line information (ex. intra_luma_ref_idx) indicating whether MRL is applied to the current block and, if MRL is applied, which reference sample line is used, ISP flag information (ex. intra_subpartitions_mode_flag) indicating whether ISP is applied to the current block, ISP type information (ex. intra_subpartitions_split_flag) indicating a subpartition split type when ISP is applied, flag information indicating whether PDCP is applied, or flag information indicating whether LIP is applied. Also, the intra prediction type information may include an MIP flag indicating whether MIP is applied to the current block.

[0135] The intra prediction mode information and / or intra prediction type information may be encoded / decoded through the coding method described in this document. For example, the intra prediction mode information and / or intra prediction type information may be encoded / decoded through entropy coding (e.g., CABAC, CAVLC) based on a truncated (rice) binary code.

[0136] On the other hand, when intra prediction is applied, the intra prediction mode applied to the current block may be determined using the intra prediction mode of the neighboring blocks. For example, the decoding apparatus may select one of the MPM candidates in an MPM (most probable mode) list derived based on the intra prediction modes of neighboring blocks (e.g., left and / or upper neighboring blocks) of the current block and additional candidate modes based on the received MPM index, or may select one of the remaining intra prediction modes not included in the MPM candidates (and the planar mode) based on the remaining intra prediction mode information. The MPM list may be configured to include or not include the planar mode as a candidate. For example, if the MPM list includes the planar mode as a candidate, the MPM list may have six candidates, and if the MPM list does not include the planar mode as a candidate, the MPM list may have five candidates. If the mpm list does not include the planar mode as a candidate, a not planar flag (ex. intra_luma_not_planar_flag) indicating whether the intra prediction mode of the current block is not a planar mode may be signaled. For example, the mpm flag may be signaled first, and the mpm index and not planar flag may be signaled if the value of the mpm flag is 1. Also, the mpm index may be signaled if the value of the not planar flag is 1. Here, the reason that the mpm list is configured not to include the planar mode as a candidate is that the planar mode is always considered as the mpm, rather than the planar mode being not an mpm, and therefore the flag (not planar flag) is signaled first to first check whether the mode is a planar mode.

[0137] For example, whether the intra prediction mode applied to the current block is among the mpm candidates (and planar mode) or among the remaining mode may be indicated based on the mpm flag (ex.intra_luma_mpm_flag). A value of 1 of the mpm flag may indicate that the intra prediction mode for the current block is among the mpm candidates (and planar mode), and a value of 0 of the mpm flag may indicate that the intra prediction mode for the current block is not among the mpm candidates (and planar mode). A value of 0 of the not planar flag (ex.intra_luma_not_planar_flag) may indicate that the intra prediction mode for the current block is planar mode, and a value of 1 of the not planar flag may indicate that the intra prediction mode for the current block is not planar mode. The mpm index may be signaled in the form of a syntax element of mpm_idx or intra_luma_mpm_idx, and the remaining intra prediction mode information may be signaled in the form of a syntax element of rem_intra_luma_pred_mode or intra_luma_mpm_remainder. For example, the remaining intra prediction mode information may index the remaining intra prediction modes not included in the mpm candidates (and planar modes) among all intra prediction modes in the order of prediction mode numbers and point to one of them. The intra prediction mode may be an intra prediction mode for a luma component (sample). Hereinafter, the intra prediction mode information may include at least one of an mpm flag (ex.intra_luma_mpm_flag), a not planar flag (ex.intra_luma_not_planar_flag), an mpm index (ex.mpm_idx or intra_luma_mpm_idx), and remaining intra prediction mode information (rem_intra_luma_pred_mode or intra_luma_mpm_remainder).In this document, the mpm list may be referred to by various terms, such as an mpm candidate list, a candidate mode list (candModeList), a candidate intra-prediction mode list, etc.

[0138] Generally, when an image is divided into blocks, a current block to be coded and a neighboring block have similar image characteristics. Therefore, there is a high probability that the current block and the neighboring blocks have the same or similar intra prediction modes. Therefore, an encoder can use the intra prediction mode of the neighboring blocks to encode the intra prediction mode of the current block. For example, an encoder / decoder can configure an MPM (most probable modes) list for the current block. The MPM list can also be referred to as an MPM candidate list. Here, MPM can refer to a mode used to improve coding efficiency by considering the similarity between the current block and the neighboring blocks when coding an intra prediction mode.

[0139] FIG. 8 illustrates an example of an intra prediction mode to which the embodiments of this document can be applied.

[0140] Referring to FIG. 8, intra prediction modes having horizontal directionality and intra prediction modes having vertical directionality may be distinguished from each other with respect to intra prediction mode no. 34 having a prediction direction of the upper left diagonal. H and V in FIG. 8 respectively mean horizontal directionality and vertical directionality, and numbers from -32 to 32 indicate displacements of 1 / 32 units on a sample grid position. Intra prediction modes no. 2 to 33 have horizontal directionality, and intra prediction modes no. 34 to 66 have vertical directionality. Intra prediction modes no. 18 and 50 indicate horizontal intra prediction modes and vertical intra prediction modes, respectively, and intra prediction mode no. 2 may be called a lower left diagonal intra prediction mode, intra prediction mode no. 34 may be called an upper left diagonal intra prediction mode, and intra prediction mode no. 66 may be called an upper right diagonal intra prediction mode.

[0141] Meanwhile, the intra prediction mode used in the above-mentioned MIP may indicate a matrix and offset used in intra prediction, not an existing directional mode. That is, a matrix and offset for intra prediction may be derived through an intra mode for MIP. In this case, when deriving the intra mode for generating the above-mentioned normal intra prediction or MPM list, the intra prediction mode of the block predicted with MIP may be set to a preset mode, for example, a planar mode or a DC mode. Alternatively, according to another example, the intra mode for MIP may be mapped to a planar mode, a DC mode, or a directional intra mode based on the block size.

[0142] Below, we will look at MIP (Matrix based intra prediction), which is one method of intra prediction.

[0143] As mentioned above, matrix based intra prediction (hereinafter, MIP) may be referred to as affine linear weighted intra prediction (ALWIP) or matrix weighted intra prediction (MWIP). To predict samples of a rectangular block having width (W) and height (H), MIP uses one H line of left boundary samples of the reconstructed periphery of the block and one W line of top boundary samples of the reconstructed periphery of the block as input values. If reconstructed samples are not available, reference samples can be generated using an interpolation method applied in normal intra prediction.

[0144] FIG. 9 is a diagram illustrating a procedure for generating MIP-based predicted samples according to an example. The MIP procedure will be described below with reference to FIG.

[0145] 1. Averaging process

[0146] Of the boundary samples, 4 samples are extracted by the averaging procedure if W=H=4, and 8 samples in all other cases.

[0147] 2. Matrix vector multiplication process

[0148] The averaged samples are input and subjected to matrix-vector multiplication followed by an offset, resulting in a scaled down prediction sample for the subsampled sample set within the original block.

[0149] 3. Linear Interpolation process

[0150] The predicted samples at the remaining positions are generated from the predicted samples of the subsampled sample set by linear interpolation, which is a single step linear interpolation in each direction.

[0151] The matrices and offset vectors required to generate a prediction block or sample can be selected from three sets of matrices S0, S1, S2.

[0152] Set S0 is made up of 16 matrices A0 i , i ∈ {0,…,15}, each matrix has 16 rows, 4 columns, and 16 offset vectors b0 i , i∈{0,...,15}. The matrices and offset vectors of set S0 can be used for blocks of size 4x4. According to another example, set S0 can include 18 matrices.

[0153] Set S1 is made up of 8 matrices A1 i , i ∈ {0,…,7}, each matrix has 16 rows, 8 columns and 8 offset vectors b1 i , i∈{0,...,7}. According to yet another example, set S1 may include six matrices. The matrices and offset vectors of set S1 may be used for blocks of size 4x8, 8x4, and 8x8. Alternatively, the matrices and offset vectors of set S1 may be used for blocks of size 4xH or Wx4.

[0154] Finally, set S2 is made up of six matrices A2 i , i ∈ {0,…,5}, each matrix has 64 rows, 8 columns and 6 offset vectors b2 i, i∈{0,...,5}. The matrices and offset vectors in set S2, or parts thereof, may be used for all other block sizes for which sets S0 and S1 do not apply. For example, the matrices and offset vectors in set S2 may be used for operations on blocks whose height and width are 8 or greater.

[0155] The total number of multiplications required for matrix-vector multiplication is always less than or equal to 4 x W x H, i.e., a maximum of 4 multiplications per sample are required for MIP mode.

[0156] Below, the overall MIP procedure is outlined. The remaining blocks not described below can be processed in one of the four cases described.

[0157] 10 to 13 are diagrams showing MIP procedures depending on the block size, where FIG. 10 is a diagram showing the MIP procedure for a 4×4 block, FIG. 11 is a diagram showing the MIP procedure for an 8×8 block, FIG. 12 is a diagram showing the MIP procedure for an 8×4 block, and FIG. 13 is a diagram showing the MIP procedure for a 16×16 block.

[0158] As shown in Figure 10, given a 4x4 block, MIP takes an average of two samples along each axis of the boundary. As a result, four input samples become inputs to a matrix vector multiplication, where the matrix comes from set S0. After the offset is added, 16 final predicted samples are generated. For a 4x4 block, no linear interpolation is needed to generate the predicted samples. Therefore, we can perform any number of (4x16) / (4x4)=4 multiplications per sample.

[0159] Given an 8x8 block, MIP averages 4 samples along each axis of the boundary, as shown in Figure 11. The resulting 8 input samples are input to a matrix-vector multiplication, where the matrix comes from set S1. The matrix-vector multiplication produces 16 samples in odd positions.

[0160] For an 8x8 block, (8x16) / (8x8)=2 multiplications are performed per sample to generate the predicted samples. After adding the offset, the samples are vertically interpolated using the scaled-down top boundary sample and horizontally interpolated using the original left boundary sample. In this case, a total of 2 multiplications are required per sample for MIP since no multiplications are required in the interpolation procedure.

[0161] Given an 8x4 block, as shown in Figure 12, MIP averages four samples along the horizontal axis of the boundary, and for the vertical axis it uses the four sample values ​​of the left boundary. As a result, eight input samples become inputs to the matrix-vector multiplication, where the matrix is ​​taken from set S1. The matrix-vector multiplication produces 16 samples at odd horizontal positions and at the corresponding vertical positions.

[0162] For an 8x4 block, (8x16) / (8x4)=4 multiplications are performed per sample to generate the predicted sample. After adding the offset, we use the original left boundary sample to interpolate horizontally. In this case, a total of 4 multiplications are required per sample for MIP, since no multiplications are required in the interpolation procedure.

[0163] As shown in Figure 13, given a 16x16 block, MIP takes the average of 4 samples along each axis, resulting in 8 input samples as inputs for matrix vector multiplication, where the matrix comes from set S2. The matrix vector multiplication produces 64 samples at odd positions. For a 16x16 block, (8x64) / (16x16)=2 multiplications are performed per sample to produce a predicted sample. After adding the offset, the sample is vertically interpolated using the 8 scaled upper boundary samples, and horizontally interpolated using the original left boundary sample. In this case, a total of 2 multiplications per sample are required for MIP, since no multiplications are required in the interpolation procedure.

[0164] For larger blocks, the MIP procedure is essentially identical to the one detailed, and it can be easily verified that the number of multiplications per sample is less than four.

[0165] For W×8 blocks with widths greater than 8 (W>8), only horizontal interpolation is required since samples are generated at odd horizontal and vertical positions. In this case, (8×64) / (W×8)=64 / W multiplications are performed per sample for the prediction calculation of the downscaled samples. For W=16, no additional multiplications are required for linear interpolation, and for W>16, the number of additional multiplications per sample required for linear interpolation is less than 2, i.e., the total number of multiplications per sample is less than or equal to 4.

[0166] For W × 4 blocks with width greater than 4 (W>4), we denote the matrix A by omitting all rows corresponding to odd entries along the horizontal axis of the downsampled block. kTherefore, the output size is 32 and only horizontal interpolation is performed. For the prediction calculation of the downscaled samples, (8 x 32) / (W x 4) = 64 / W multiplications are performed per sample. If W = 16, no additional multiplications are required, and if W > 16, the number of additional multiplications per sample required for linear interpolation is less than 2, i.e. the total number of multiplications per sample is less than or equal to 4.

[0167] If a matrix is ​​prepended, it can be processed accordingly.

[0168] 14 is a diagram for explaining the boundary averaging procedure among the MIP procedures. The averaging procedure will be specifically explained with reference to FIG.

[0169] According to the averaging procedure, averaging is applied to each boundary, i.e., the left boundary or the top boundary, where the boundary indicates the surrounding reference samples adjacent to the boundary of the current block as shown in FIG. 16. For example, the left boundary (bdry left ) indicates the left neighboring reference sample adjacent to the left boundary of the current block, and the upper boundary (bdry top ) denotes the upper neighboring reference sample on the upper side.

[0170] If the current block is a 4x4 block, the size of each boundary can be reduced to 2 samples through an averaging procedure. If the current block is not a 4x4 block, the size of each boundary can be reduced to 4 samples through an averaging procedure.

[0171] The first step of the averaging procedure is to determine the input boundary (bdry left and bdry top ) to a smaller bound. JPEG0007670908000001.jpg10127. JPEG0007670908000002.jpg11125 consists of 2 samples for the 4x4 block case, and 4 samples for all remaining different cases.

[0172] For 4x4 blocks, for 0≦i<2 JPEG0007670908000003.jpg13150 can be expressed as the following formula: JPEG0007670908000004.jpg13143 can also be defined similarly.

[0173]

number

[0174] On the other hand, for 0≦i<4, the block width is W=4×2 k Given that, JPEG0007670908000006.jpg14156 can be expressed by the following formula: JPEG0007670908000007.jpg17151 can also be defined similarly.

[0175]

number

[0176] 2 reduced boundaries JPEG0007670908000009.jpg12121 is the reduced border vector bdry red Since it is connected to bdry red has size 4 for blocks of 4x4 shape and size 8 for all other blocks.

[0177] If 'mode' is referred to as the MIP mode, the reduced boundary vector bdry red The range of the MIP mode value (mode) can be defined based on the block size and the intra_mip_transposed_flag value as shown in the following formula.

[0178]

number

[0179] In the above formula, intra_mip_transposed_flag may be referred to as MIP transpose, and such flag information may indicate whether the downscaled prediction samples are transposed. The semantics of such a syntax element may be expressed as "intra_mip_transposed_flag[x0][y0] specifies whether the input vector for matrix-based intra prediction mode for luma samples is transposed or not."

[0180] Finally, for the interpolation of the subsampled prediction samples, a second version of the averaged boundary is needed for large blocks: if the smaller of the width and height is greater than 8, JPEG0007670908000011.jpg14148 If the width is equal to or greater than the height (W≧H), then W=8*2 l For 0≦i<8, JPEG0007670908000012.jpg14154 can be defined as follows. In addition, if the smaller value of the width and height is greater than 8, JPEG0007670908000013.jpg12142, height is greater than width (H>W) JPEG0007670908000014.jpg14145 can also be defined similarly.

[0181]

number

[0182] Next, we will look at the procedure for generating downsized prediction samples by matrix-vector multiplication.

[0183] The reduced input vector bdry red One of the prediction samples is reduced Generate JPEG0007670908000016.jpg12156. The predicted samples are of width W red and height H red where W red and H red is defined as follows:

[0184]

number

[0185] Reduced prediction sample JPEG0007670908000018.jpg15163 can be calculated by adding an offset after matrix vector multiplication, and can be derived through the following formula:

[0186]

number

[0187] Here, A is W red ×h red is a matrix with 1 row and 4 columns when W and H are 4 (W=H=4), and 8 columns in all other cases, and b is a matrix with 1 row and 4 columns when W and H are 4 (W=H=4), and 8 columns in all other cases, red ×h red is a vector of magnitude.

[0188] The matrix A and vector b are selected from the sets S0, S1, and S2 as follows, and the index idx=idx(W,H) can be defined as in Equation 7 or Equation 8.

[0189]

number

[0190]

number

[0191] If idx is 1 or less (idx≦1), or idx is 2, and the smaller of W and H is greater than 4, JPEG0007670908000022.jpg14144, A is JPEG0007670908000023.jpg13137, b is JPEG0007670908000024.jpg12132. idx is 2, and the smaller value of W and H is 4. JPEG0007670908000025.jpg11140, if W is 4, then A corresponds to odd x coordinates within the downsampled block JPEG0007670908000026.jpg12139 is the matrix with each row removed. Or, if H is 4, then A corresponds to odd y coordinates within the downsampled block. This results in a matrix with each column of JPEG0007670908000027.jpg12141 removed.

[0192] Finally, the downsized prediction samples can be replaced by their transpose in Equation 9.

[0193]

number

[0194] The number of multiplications required to compute JPEG0007670908000029.jpg11137 is 4 when W=H=4 because A consists of 4 columns and 16 rows. In all other cases, A consists of 8 columns and W red ×h red It consists of lines, It can be seen that to compute JPEG0007670908000030.jpg10127, a maximum of 4 multiplications per sample are required.

[0195] FIG. 15 is a diagram for explaining linear interpolation in the MIP procedure. Referring to FIG. 15, the linear interpolation procedure will be specifically described as follows.

[0196] The interpolation procedure may be referred to as a linear interpolation or a bilinear interpolation procedure. The interpolation procedure can include two steps: 1) vertical interpolation and 2) horizontal interpolation, as shown.

[0197] If W >= H, vertical linear interpolation can be applied first, followed by horizontal linear interpolation. If W < H, horizontal linear interpolation can be applied first, followed by vertical linear interpolation. In the case of a 4×4 block, the interpolation procedure may be omitted.

[0198] For a W×H block that is JPEG0007670908000031.jpg11133, the predicted samples are W red ×H red downsampled predicted samples above derived from JPEG0007670908000032.jpg13149. Depending on the block form, linear interpolation is performed vertically, horizontally, or in both directions. When linear interpolation is applied in both directions, if W < H, it is applied first in the horizontal direction; otherwise, it is applied first in the vertical direction.

[0199] For a W×H block that is JPEG0007670908000033.jpg13143 and where W >= H, it can be considered that there is no loss of generality. Then, 1D linear interpolation is performed as follows. If there is no loss of generality, the linear interpolation for the vertical direction is fully explained.

[0200] First, the downsampled predicted samples are extended upward by the boundary signal. The coefficient of vertical upsampling is defined as JPEG0007670908000034.jpg13134, If you set JPEG0007670908000035.jpg14130, you can set the predicted sample for the extended reduction as shown in the formula below.

[0201]

number

[0202] Then, from such expanded downscaled predicted samples, vertical linearly interpolated predicted samples can be generated by the following formula:

[0203]

number

[0204] Here, x is 0≦x <W red , y, 0≦y <H red , k, 0≦k ver It could be.

[0205] In the following, we will look at how to maximize performance while reducing complexity for MIP techniques. The embodiments described below may be implemented independently or in combination.

[0206] Meanwhile, when MIP is applied to the current block, an MPM list for the current block to which the MIP is applied can be configured separately. The MPM list can be called various names such as an MIP MPM list (or an LWIP MPM list, candLwipModeList) to distinguish it from an MPM list when ALWIP is not applied to the current block. Hereinafter, it will be referred to as an MIP MPM list for distinction, but it can also be called an MPM list.

[0207] ​The MIP MPM list may include n candidates, where n may be 3, for example. The MIP MPM list may be constructed based on a left peripheral block and an upper peripheral block of the current block. Here, the left peripheral block may indicate the uppermost block among the peripheral blocks adjacent to the left boundary of the current block. Also, the upper peripheral block may indicate the leftmost block among the peripheral blocks adjacent to the upper boundary of the current block.

[0208] For example, if MIP is applied to the left peripheral block, a first candidate intra prediction mode (or candLwipModeA) may be set to be the same as the MIP mode of the left peripheral block, and for example, if MIP is applied to the upper peripheral block, a second candidate intra prediction mode (or candLwipModeB) may be set to be the same as the prediction mode of the MIP mode of the upper peripheral block.

[0209] Meanwhile, the left peripheral block or the upper peripheral block may be coded based on intra prediction other than MIP. That is, when coding the left peripheral block or the upper peripheral block, other intra prediction types other than MIP may be applied. In this case, it is not suitable to use the general intra prediction mode number of the peripheral block (left peripheral block / upper peripheral block) to which MIP is not applied as a candidate intra mode for the current block to which MIP is applied. Therefore, in this case, as an example, the MIP mode of the peripheral block (left peripheral block / upper peripheral block) to which MIP is not applied may be considered to be a prediction mode of a MIP mode of a specific value (e.g., 0, 1, or 2, etc.). Alternatively, as another example, the general intra prediction mode of the peripheral block (left peripheral block / upper peripheral block) to which MIP is not applied may be mapped to the MIP mode based on a predetermined mapping table and used to construct the MIP MPM list. In this case, the mapping may be performed based on the block size type of the current block.

[0210] In addition, if the neighboring block (e.g., left neighboring block / upper neighboring block) is not available (e.g., located outside the current picture, located outside the current tile / tile group, etc.), or even if MIP is applied, a MIP mode that is not available for the current block may be used according to the block size type. In this case, a specific MIP mode predefined for the first candidate and / or the second candidate may be used as the first candidate intra prediction mode or the second candidate intra prediction mode. In addition, a specific MIP prediction mode predefined for the third candidate may be used as the third candidate intra prediction mode.

[0211] Meanwhile, the existing MIP mode is divided into non-MPM mode and MPM mode, similar to the existing method of deriving intra prediction mode, and the MPM flag is sent, and the MIP mode of the current block is coded based on the MPM mode or non-MPM mode.

[0212] As an example, a structure may be proposed for coding MIP mode directly for blocks to which the MIP technique is applied, without distinguishing between MPM mode and non-MPM mode. In such an image coding structure, a complex syntax structure may be simplified. In addition, since the actual occurrence frequency of MIP mode is relatively uniformly distributed for each mode and is significantly different from the occurrence frequency shown in the existing intra mode, the proposed coding structure may maximize the efficiency of encoding and decoding MIP mode information.

[0213] The image information transmitted and received for the MIP according to this embodiment is as follows: The syntax described below may be included in the video / image information transmitted from the encoding device to the decoding device, and may be configured / encoded by the encoding device and signaled to the decoding device in the form of a bitstream, and the decoding device may parse / decode the included information (syntax elements) according to the conditions / orders disclosed in the syntax.

[0214] [Table 1]

[0215] As shown in Table 1, the syntax elements intra_mip_flag and intra_mip_mode_idx for the MIP mode of the current block can be signaled by being included in the syntax information for the coding unit.

[0216] When intra_mip_flag is 1, it indicates that the intra prediction type for the luma sample is matrix-based intra prediction, and when its value is 0, it indicates that the intra prediction type for the luma sample is not matrix-based intra prediction.

[0217] When intra_mip_mode_idx is signaled when intra_mip_flag is 1, it indicates a matrix-based intra prediction mode for luma samples. Such a matrix-based intra prediction mode may indicate a matrix and offset or a matrix for MIP, as described above.

[0218] Also, according to one example, flag information indicating whether an input vector for matrix-based intra prediction is transposed, for example, intra_mip_transposed_flag, may be further signaled via the syntax of the coding unit. If intra_mip_transposed_flag is 1, an input vector for matrix-based intra prediction is transposed, and the number of matrices for matrix-based intra prediction may be reduced by such flag information.

[0219] Meanwhile, intra_mip_mode_idx can be encoded and decoded using a truncated binarization scheme as shown in the table below.

[0220] [Table 2]

[0221] As shown in Table 2, intra_mip_flag is binarized to a fixed length code, while intra_mip_mode_idx is binarized in a truncated binarization manner, and the maximum length of binarization (cMax) can be set according to the size of the coding block. If the width and height of the coding block are 4 (cbWidth==4 && cbHeight==4), the maximum length of binarization is set to 34, otherwise, it can be set to 18 or 10 depending on whether the width and height of the coding block are 8 or less ((cbWidth<=8 && cbHeight<=8)?).

[0222] Meanwhile, intra_mip_mode_idx can be coded in a bypass manner, not based on a context model, which can increase coding speed and efficiency.

[0223] As another example, when intra_mip_mode_idx is binarized in the truncated binarization mode, the maximum length of the binarization is as shown in the following table.

[0224] [Table 3]

[0225] As shown in Table 3, the maximum binarization length for intra_mip_mode_idx is set to 15 if the width and height of the coding block are 4 ((cbWidth==4 && cbHeight==4)), otherwise it is set to 7 if the width or height of the coding block is 4 ((cbWith==4||cbHeight==4)) or the width and height of the coding block is 8 (cbWith==8 && cbHeight==8), and it can be set to 5 if the width or height of the coding block is 4 ((cbWith==4||cbHeight==4)) or the width and height of the coding block is not 8 (cbWith==8 && cbHeight==8).

[0226] As another example, intra_mip_mode_idx can be coded with a fixed length code. In this case, the number of available MIP modes is limited to an exponent of 2 for each block size in order to improve coding efficiency (e.g., A=2 K1 -1, B=2 K2 -1, 2 K3 -1, where K1, K2, and K3 are positive constants).

[0227] This is shown in the table below.

[0228] [Table 4]

[0229] In Table 4, if K1=5, K2=4, and K3=3, intra_mip_mode can be binarized as follows:

[0230] [Table 5]

[0231] Alternatively, according to one example, when K1 is set to 4 and the width and height of the coding block are 4, the maximum binarization length for the intra_mip_mode of the block may be set to 15. When K2 is set to 3 and the width or height of the coding block is 4, or the width and height of the coding block are 8, the maximum binarization length may be set to 7.

[0232] Meanwhile, according to one example, a method of using MIP only for a specific block where the MIP technique can be efficiently applied can be proposed. By applying the method according to this embodiment, the number of matrix vectors required for MIP can be reduced, and the memory required to store the matrix vectors can be significantly reduced (50%). Even with this effect, the coding efficiency remains almost constant (less than 0.1%).

[0233] According to this embodiment, the syntax including the specific conditions under which the MIP technique is applied is as follows:

[0234] [Table 6]

[0235] As shown in Table 6, a condition (cbWidth>K1||cbHeight>K2) is added so that MIP is applied only to large blocks, and the size of the block can be determined by preset values ​​(K1 and K2). The reason that MIP is applied only to large blocks is that the coding efficiency of MIP is demonstrated for relatively large blocks.

[0236] The table below shows an example where K1 and K2 are predefined as 8 in Table 6.

[0237] [Table 7]

[0238] The semantics for intra_mip_flag and intra_mip_mode_idx in Tables 6 and 7 are the same as in Table 1.

[0239] On the other hand, if intra_mip_mode_idx has 11 possible modes, it can be coded in a truncated binary coding (cMax=10) manner as follows.

[0240] [Table 8]

[0241] Alternatively, if the available MIP modes are limited to eight, intra_mip_mode_idx[x0][y0] can be encoded with a fixed length code as follows:

[0242] [Table 9]

[0243] In both Tables 8 and 9, intra_mip_mode_idx can be coded in a bypass manner.

[0244] Meanwhile, in one example, the weight matrix (A) used for a large block is used so that the MIP technique can be efficiently applied in terms of memory saving. k ) and offset vector (b k A MIP technique that can apply the MIP technique to small blocks can be proposed. By applying the method according to the present embodiment, the number of matrix vectors required for MIP can be reduced, and the memory required to store the matrix vectors can be significantly reduced (50%). With these effects, the coding efficiency remains almost constant (less than 0.05%).

[0245] FIG. 16 is a diagram for explaining the MIP technique according to an example of this document.

[0246] As shown, FIG. 16(a) shows the computation of the matrix and offset vector for index i of a large block, and FIG. 16(b) shows the computation of the sampled matrix and offset vector applied to a small block.

[0247] As shown in FIG. 16, the weight matrix used for the large block is subsampled to obtain a subsampled weight matrix (Sub(A k )) and the offset vector obtained by subsampling the offset vector used for the larger block (Sub(b k )) can be regarded as a weight matrix and an offset vector for each small block, and the existing MIP procedure can be applied.

[0248] Here, sub-sampling may be applied to either the horizontal or vertical direction, or to both directions. In particular, the sub-sampling factor (e.g., 1 out of 2 or 1 out of 4) and the sampling direction for the vertical or horizontal direction may be set based on the width and height of the corresponding block.

[0249] In addition, the number of intra prediction modes for MIP to which this embodiment is applied may be set differently depending on the size of the current block. For example, i) if the height and width of the current block (coding block or transform block) are each 4, 35 intra prediction modes (i.e., intra prediction modes 0 to 34) may be available, ii) if the height and width of the current block are both 8 or less, 19 intra prediction modes (i.e., intra prediction modes 0 to 18) may be available, and iii) in other cases, 11 intra prediction modes (i.e., intra prediction modes 0 to 10) may be available.

[0250] For example, if the height and width of the current block are each 4, it is called block size type 0, if the height and width of the current block are both 8 or less, it is called block size type 1, and the other cases are called block size type 2. The number of intra prediction modes for MIP can be organized as shown in the following table.

[0251] [Table 10]

[0252] To apply the weighting matrix and offset vector used for a large block (e.g., block size type=2) to a small block (e.g., block size=0 or block size=1), the number of intra prediction modes available for each block size can be applied in the same way, as shown in the following table.

[0253] [Table 11]

[0254] Alternatively, as shown in Table 12 below, MIP can be applied only to block size types 1 and 2, and in block size type 1, the weight matrix and offset vector defined in block size type 2 can be subsampled and used, which can effectively save memory (50%).

[0255] [Table 12]

[0256] The following drawings are created to explain a specific example of the present specification. The names of specific devices and names of specific signals / messages / fields described in the drawings are presented for illustrative purposes only, and the technical features of the present specification are not limited to the specific names used in the following drawings.

[0257] The following table shows experimental results when, as in the above-described embodiment, derivation of MPM is omitted when applying MIP to the current block, and signals related to MPM are also not signaled.

[0258] The experiments were conducted based on the VTM 5.0 reference software under normal test conditions defined in JVET-N1010.

[0259] [Table 13]

[0260] [Table 14]

[0261] [Table 15]

[0262] FIG. 17 is a flow chart that illustrates a schematic diagram of a decoding method that can be performed by a decoding device according to an embodiment of the present document.

[0263] The method disclosed in FIG. 17 may be performed by the decoding apparatus 200 disclosed in FIG. 2. Specifically, steps S1700 to S1750 in FIG. 17 may be performed by the entropy decoding unit 210 and / or the prediction unit 230 (specifically, the intra prediction unit 231) disclosed in FIG. 2, and step S1760 in FIG. 17 may be performed by the addition unit 240 disclosed in FIG. 2. In addition, the method disclosed in FIG. 17 may include the embodiments described above in this document. Therefore, in FIG. 17, detailed descriptions of contents overlapping with the embodiments described above will be omitted or simplified.

[0264] Referring to FIG. 17, a decoding device may receive, i.e., obtain from the bitstream, flag information indicating whether matrix-based intra prediction (MIP) is used for a current block (S1700).

[0265] Such flag information can be signaled by being included in syntax information of a coding unit using syntax such as intra_mip_flag.

[0266] The decoding apparatus may receive matrix-based intra-prediction (MIP) mode information based on the received flag information (S1710).

[0267] The MIP mode information may be represented by intra_mip_mode_idx, and may be signaled when intra_mip_flag is 1. The intra_mip_mode_idx may be index information indicating the MIP mode applied to the current block, and such index information may be used to derive a matrix when generating a predicted sample.

[0268] Also, according to one example, flag information, for example, intra_mip_transposed_flag, indicating whether an input vector for matrix-based intra prediction is transposed may be further signaled via the syntax of the coding unit.

[0269] The decoding apparatus may generate an intra-prediction sample for the current block based on the MIP information. To generate the intra-prediction sample, the decoding apparatus may derive at least one surrounding reference sample from the surrounding reference samples of the current block, and may generate a prediction sample based on the surrounding reference sample.

[0270] The decoding apparatus may binarize the bin string of the syntax element for the MIP mode information by a truncated binarization method and decode it by a bypass method (S1720).

[0271] As described above, the maximum length of the bin string of the syntax element for MIP mode information can be set to different values ​​according to the size of the current block. The maximum length can be set to three values ​​according to the size of the current block as shown in Table 2 or Table 3, and the maximum length can be the largest when the width and height of the current block are 4.

[0272] For example, in Table 2, if the width and height of the coding block are 4, the maximum length of binarization is set to 34, and in Table 3, it can be set to 15.

[0273] In addition, such MIP mode information can be decoded in a bypass manner rather than in a context modeling manner.

[0274] Meanwhile, intra_mip_flag can be binarized with a fixed length code.

[0275] When MIP is applied, the decoding apparatus can downsample reference samples adjacent to the current block to derive reduced boundary samples (S1730).

[0276] The reduced boundary samples can be derived by downsampling through averaging of the reference samples.

[0277] If the width and height of the current block are 4, then 4 reduced boundary samples are derived, and in the remaining other cases, 8 samples can be derived.

[0278] The averaging procedure for downsampling may be applied to each boundary, left boundary or top boundary, of the current block, which may be applied to the surrounding reference samples adjacent to the boundary of the current block.

[0279] As an example, if the current block is a 4x4 block, the size of each boundary may be reduced to two samples through an averaging procedure, and if the current block is not a 4x4 block, the size of each boundary may be reduced to four samples through an averaging procedure.

[0280] Thereafter, the decoding apparatus can derive a scaled prediction sample based on a multiplication operation between the MIP matrix derived based on the size and index information of the current block and the scaled boundary sample (S1740).

[0281] The MIP matrix can be derived based on the size of the current block and the received index information.

[0282] The MIP matrix may be selected from one of three matrix sets classified according to the size of the current block, and each of the three matrix sets may include a plurality of MIP matrices.

[0283] That is, three matrix sets for MIP can be set, and each matrix set can be composed of a plurality of matrices and offset vectors. Such matrix sets can be applied according to the size of the current block.

[0284] For example, a matrix set including 18 or 16 matrices each consisting of 16 rows and 4 columns, and 18 or 16 offset vectors can be applied to a 4×4 block. The index information can be information indicating any one of a plurality of matrices included in one matrix set.

[0285] For 4×8, 8×4, and 8×8 blocks, or 4×H or W×4 blocks, a matrix set including 10 or 8 matrices composed of 16 rows and 8 columns, and 10 or 8 offset vectors can be applied.

[0286] Alternatively, for blocks other than the aforementioned blocks or blocks with a height and width of 8 or more, a matrix set including 6 matrices composed of 64 rows and 8 columns, and 6 offset vectors can be applied.

[0287] After the operation of multiplying the MIP matrix by the reduced boundary samples, a reduced predicted sample, that is, a predicted sample to which the MIP matrix is applied, is derived based on the operation of adding an offset.

[0288] The decoding device can upsample the reduced predicted sample to generate an intra prediction sample for the current block (S1750).

[0289] The intra prediction sample can be upsampled by linear interpolation of the reduced predicted sample.

[0290] The interpolation procedure can be referred to as a linear interpolation or a bilinear interpolation procedure and can include two steps: 1) vertical interpolation, and 2) horizontal interpolation.

[0291] If W>=H, vertical linear interpolation can be applied first, followed by horizontal linear interpolation. If W<H, horizontal linear interpolation can be applied first, followed by vertical linear interpolation. In the case of a 4×4 block, the interpolation procedure can be omitted.

[0292] The decoding device can generate a restored sample for the current block based on the predicted sample (S1760).

[0293] In one embodiment, the decoding apparatus may directly use the predicted samples as reconstructed samples depending on the prediction mode, or may generate reconstructed samples by adding residual samples to the predicted samples.

[0294] The decoding apparatus may receive information about a residual for the current block if a residual sample for the current block exists. The information about the residual may include a transform coefficient for the residual sample. The decoding apparatus may derive a residual sample (or a residual sample array) for the current block based on the residual information. The decoding apparatus may generate a reconstructed sample based on the prediction sample and the residual sample, and may derive a reconstructed block or a reconstructed picture based on the reconstructed sample. As described above, the decoding apparatus may then apply an in-loop filtering procedure, such as a deblocking filtering and / or an SAO procedure, to the reconstructed picture to improve subjective / objective image quality as necessary.

[0295] FIG. 18 is a flow chart that illustrates a schematic representation of an encoding method that can be performed by an encoding device according to an embodiment of the present document.

[0296] The method disclosed in FIG. 18 may be performed by the encoding device 100 disclosed in FIG. 1. Specifically, steps S1800 to S1830 of FIG. 18 may be performed by the prediction unit 120 (specifically, the intra prediction unit 122) disclosed in FIG. 1, step S1840 of FIG. 18 may be performed by the subtraction unit 131 disclosed in FIG. 1, and steps S1850 and S1860 of FIG. 18 may be performed by the entropy encoding unit 140 disclosed in FIG. 1. In addition, the method disclosed in FIG. 18 may include the embodiments described above in this document. Therefore, in FIG. 18, detailed descriptions of contents that overlap with the embodiments described above will be omitted or simplified.

[0297] Referring to FIG. 18, an encoding apparatus may derive whether matrix-based intra prediction (MIP) is applied to a current block (S1800).

[0298] The encoding apparatus may apply various prediction techniques to find an optimal prediction mode for the current block, and may determine the optimal intra-prediction mode based on rate-distortion optimization (RDO).

[0299] If it is determined that MIP is to be applied to the current block, the encoding apparatus may derive reduced boundary samples by downsampling reference samples adjacent to the current block (S1810).

[0300] The reduced boundary samples can be derived by downsampling through averaging of the reference samples.

[0301] If the width and height of the current block are 4, then 4 reduced boundary samples are derived, and in the remaining other cases, 8 samples can be derived.

[0302] The averaging procedure for downsampling may be applied to each boundary, left boundary or top boundary, of the current block, which may be applied to the surrounding reference samples adjacent to the boundary of the current block.

[0303] As an example, if the current block is a 4x4 block, the size of each boundary can be reduced to two samples through an averaging procedure, and if the current block is not a 4x4 block, the size of each boundary can be reduced to four samples through an averaging procedure.

[0304] Once the reduced boundary samples are derived, the encoding device can derive reduced prediction samples based on a multiplication operation of the reduced boundary samples by an MIP matrix selected based on the size of the current block (S1820).

[0305] The MIP matrix may be selected from one of three matrix sets classified according to the size of the current block, and each of the three matrix sets may include a plurality of MIP matrices.

[0306] That is, three matrix sets for MIP can be set, and each matrix set can be composed of a plurality of matrices and an offset vector. The matrix sets can be divided and applied according to the size of the current block.

[0307] For example, a matrix set including 18 or 16 matrices each consisting of 16 rows and 4 columns, and 18 or 16 offset vectors can be applied to a 4×4 block. The index information can be information indicating any one of a plurality of matrices included in one matrix set.

[0308] For 4x8, 8x4 and 8x8 blocks, or 4xH or Wx4 blocks, a matrix set containing 10 or 8 matrices with 16 rows and 8 columns, and 10 or 8 offset vectors can be applied.

[0309] Alternatively, for blocks other than those mentioned above or blocks whose height and width are 8 or more, a matrix set including 6 matrices each consisting of 64 rows and 8 columns, and 6 offset vectors can be applied.

[0310] After the multiplication operation of the MIP matrix and the reduced boundary samples, a reduced prediction sample, that is, a prediction sample to which the MIP matrix is applied, can be derived based on the operation of adding an offset.

[0311] Thereafter, the encoding device can upsample the reduced prediction sample to generate an intra prediction sample for the current block (S1830).

[0312] The intra prediction sample can be upsampled by linear interpolation of the reduced prediction sample.

[0313] The interpolation procedure can be referred to as a linear interpolation or a bilinear interpolation procedure and can include two steps: 1) vertical interpolation, and 2) horizontal interpolation.

[0314] If W >= H, vertical linear interpolation can be applied first, followed by horizontal linear interpolation. If W < H, horizontal linear interpolation can be applied first, followed by vertical linear interpolation. In the case of a 4×4 block, the interpolation procedure can be omitted.

[0315] Also, the encoding device can derive a residual sample for the current block based on the prediction sample of the current block and the original sample of the current block (S1840).

[0316] Then, the encoding device can evolve the bit string of the syntax element for the MIP mode information in a truncated binary evolution manner and encode it in a bypass mode (S1850).

[0317] As described above, the maximum length of the bit string of the syntax element for the MIP mode information can be set to different values according to the size of the current block. Such a maximum length can be set to three values according to the size of the current block as in Table 2 or Table 3, and the maximum length may be the largest when the width and height of the current block are 4.

[0318] For example, in Table 2, if the width and height of the coding block are 4, the maximum length of binarization is set to 34, and in Table 3, it can be set to 15.

[0319] In addition, such MIP mode information can be encoded in a bypass manner rather than in a context modeling manner.

[0320] Meanwhile, intra_mip_flag can be binarized with a fixed length code.

[0321] The encoding apparatus can generate residual information for the current block based on the residual sample, and output image information including the generated residual information, flag information indicating whether MIP is applied, and MIP mode information in the form of a bitstream (S1860).

[0322] Here, the residual information may include information such as value information of the quantized transform coefficients derived by transforming and quantizing the residual samples, position information, transform technique, transform kernel, quantization parameter, etc.

[0323] Flag information indicating whether MIP is applied can be encoded by being included in syntax information of a coding unit using syntax such as intra_mip_flag.

[0324] Also, the MIP mode information may be represented by intra_mip_mode_idx, and may be encoded when intra_mip_flag is 1. intra_mip_mode_idx may be index information indicating a MIP mode applied to a current block, and such index information may be used to derive a matrix when generating a predicted sample. The index information may indicate any one of the MIP matrices included in one matrix set.

[0325] Also, according to one example, flag information indicating whether an input vector for matrix-based intra prediction is transposed, for example, intra_mip_transposed_flag, may be further signaled via the syntax of the coding unit.

[0326] That is, the encoding apparatus may encode image information including the MIP mode information and / or residual information of the current block and output the encoded image information as a bitstream.

[0327] The bitstream can be transmitted to the decoding device via a network or a (digital) storage medium, where the network can include a broadcast network and / or a communication network, and the digital storage medium can include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc.

[0328] The process of generating a prediction sample for the current block described above can be performed by the intra prediction unit 122 of the encoding apparatus 100 disclosed in FIG. 1, the process of deriving a residual sample can be performed by the subtraction unit 131 of the encoding apparatus 100 disclosed in FIG. 1, and the process of generating and encoding residual information can be performed by the residual processing unit 130 and the entropy encoding unit 140 of the encoding apparatus 100 disclosed in FIG. 1.

[0329] In the above embodiments, the method is described based on a flowchart as a series of steps or blocks, but the embodiments of this document are not limited to the order of steps, and some steps may occur in a different order or simultaneously with other steps than those described above. Also, those skilled in the art can understand that the steps shown in the flowcharts are not exclusive, and different steps may be included, or one or more steps of the flowcharts may be deleted without affecting the scope of this document.

[0330] The methods described herein may be embodied in the form of software, and the encoding device and / or decoding device described herein may be included in devices that perform video processing, such as, for example, TVs, computers, smartphones, set-top boxes, display devices, etc.

[0331] When the embodiments in this document are implemented in software, the methods described above may be implemented in modules (processes, functions, etc.) performing the functions described above. The modules may be stored in a memory and executed by a processor. The memory may be internal or external to the processor and may be coupled to the processor in various well-known ways. The processor may include an application-specific integrated circuit (ASIC), other chipsets, logic circuits, and / or data processing devices. The memory may include read-only memory (ROM), random access memory (RAM), flash memory, memory cards, storage media, and / or other storage devices. That is, the embodiments described in this document may be implemented and executed on a processor, microprocessor, controller, or chip. For example, the functional units shown in each drawing may be implemented and executed on a computer, processor, microprocessor, controller, or chip. In this case, information on instructions or algorithms for implementation may be stored in a digital storage medium.

[0332] In addition, the decoding device and encoding device to which this document is applied may be included in a multimedia broadcast transmitting / receiving device, a mobile communication terminal, a home cinema video device, a digital cinema video device, a surveillance camera, a video interactive device, a real-time communication device such as video communication, a mobile streaming device, a storage medium, a camcorder, a customized video (VoD) service providing device, an over-the-top video (OTT) device, an internet streaming service providing device, a three-dimensional (3D) video device, a virtual reality (VR) device, an argument reality (AR) device, an image telephone video device, a transportation means terminal (e.g., a vehicle (including an autonomous vehicle) terminal, an airplane terminal, a ship terminal, etc.), and a medical video device, etc., and may be used to process a video signal or a data signal. For example, an over-the-top video (OTT) device may include a game console, a Blu-ray player, an internet access TV, a home theater system, a smartphone, a tablet PC, a digital video recorder (DVR), etc.

[0333] In addition, the processing method to which this document is applied may be produced in the form of a program executed by a computer and may be stored in a computer-readable recording medium. Multimedia data having a data structure according to this document may also be stored in a computer-readable recording medium. The computer-readable recording medium includes all kinds of storage devices and distributed storage devices in which computer-readable data is stored. The computer-readable recording medium may include, for example, a Blu-ray Disc (BD), a Universal Serial Bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device. In addition, the computer-readable recording medium may include a medium embodied in the form of a carrier wave (e.g., transmission via the Internet). In addition, a bitstream generated by the encoding method may be stored in a computer-readable recording medium or transmitted via a wired or wireless communication network.

[0334] Furthermore, the embodiments of the present document may be embodied in a computer program product having program code, the program code being executable by a computer in accordance with the embodiments of the present document, and the program code may be stored on a carrier readable by a computer.

[0335] FIG. 19 illustrates a schematic diagram of an example of a video / image coding system to which embodiments of the present document can be applied.

[0336] 19, the video / image coding system may include a first device (source device) and a second device (receiving device). The source device may transmit encoded video / image information or data to the receiving device via a digital storage medium or a network in the form of a file or streaming.

[0337] The source device may include a video source, an encoding device, and a sending unit. The receiving device may include a receiving unit, a decoding device, and a renderer. The encoding device may be referred to as a video / video encoding device, and the decoding device may be referred to as a video / video decoding device. The transmitter may be included in the encoding device. The receiver may be included in the decoding device. The renderer may also include a display unit, which may be a separate device or an external component.

[0338] A video source may acquire video / images through a video / image capture, synthesis, or generation process, etc. A video source may include a video / image capture device and / or a video / image generation device. A video / image capture device may include, for example, one or more cameras, a video / image archive containing previously captured video / images, etc. A video / image generation device may include, for example, a computer, a tablet, a smartphone, etc., and may (electronically) generate video / images. For example, a virtual video / image may be generated via a computer, etc., in which case the video / image capture process may be replaced by a process in which related data is generated.

[0339] An encoding device may encode an input video / image. The encoding device may perform a series of steps such as prediction, transformation, quantization, etc. for compression and coding efficiency. The encoded data (encoded video / image information) may be output in the form of a bitstream.

[0340] The transmitting unit may transmit the encoded video / image information or data output in the form of a bitstream to a receiving unit of a receiving device via a digital storage medium or a network in the form of a file or streaming. The digital storage medium may include various storage media such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, etc. The transmitting unit may include an element for generating a media file through a predetermined file format and may include an element for transmission via a broadcasting / communication network. The receiving unit may receive / extract the bitstream and transmit it to a decoding device.

[0341] The decoding device can decode the video / image by performing a series of steps such as inverse quantization, inverse transformation, and prediction, which correspond to the operations of the encoding device.

[0342] The renderer may render the decoded video / image, and the rendered video / image may be displayed via a display unit.

[0343] FIG. 20 illustrates an example of a content streaming system in which the embodiments disclosed herein may be applied.

[0344] Referring to FIG. 20, the content streaming system applied to the embodiments of this document may broadly include an encoding server, a streaming server, a web server, a media storage, a user device, and a multimedia input device.

[0345] The encoding server compresses content input from a multimedia input device such as a smartphone, camera, camcorder, etc. into digital data to generate a bitstream and transmits the bitstream to the streaming server. As another example, if a multimedia input device such as a smartphone, camera, camcorder, etc. directly generates a bitstream, the encoding server may be omitted.

[0346] The bitstream may be generated by an encoding method or a bitstream generation method applied to an embodiment of this document, and the streaming server may temporarily store the bitstream during the process of transmitting or receiving the bitstream.

[0347] The streaming server transmits multimedia data to a user device based on a user request via a web server, and the web server serves as a medium to inform the user of available services. When a user requests a desired service from the web server, the web server transmits the request to the streaming server, and the streaming server transmits multimedia data to the user. In this case, the content streaming system may include a separate control server, and in this case, the control server serves to control commands / responses between devices in the content streaming system.

[0348] The streaming server may receive the content from a media storage and / or an encoding server. For example, when the content is received from the encoding server, the content may be received in real time. In this case, the streaming server may store the bitstream for a certain period of time in order to provide a smooth streaming service.

[0349] Examples of the user devices include mobile phones, smart phones, laptop computers, digital broadcasting terminals, personal digital assistants (PDAs), portable multimedia players (PMPs), navigation systems, slate PCs, tablet PCs, ultrabooks, wearable devices (e.g., smartwatches, smart glass, head mounted displays (HMDs)), digital TVs, desktop computers, digital signage, and the like.

[0350] Each server in the content streaming system can be operated as a distributed server, in which case data received at each server can be processed in a distributed manner.

[0351] The claims described in this document can be combined in various ways. For example, the technical features of the method claims of this document can be combined and embodied as an apparatus, and the technical features of the apparatus claims of this document can be combined and embodied as a method. Also, the technical features of the method claims of this document and the technical features of the apparatus claims can be combined and embodied as an apparatus, and the technical features of the method claims of this specification and the technical features of the apparatus claims can be combined and embodied as a method. (Claims in the present description can be combined in a various way. For instance,technical features in method claims of the present description can be combined to be implemented or performed in an apparatus,and technical features in apparatus claims can be combined to be implemented or performed in a method.Further,technical features in method claim(s) and apparatus claim(s) can be combined to be implemented or performed in an apparatus.Further,technical features in method claim(s) and apparatus claim(s) can be combined to be implemented or performed in a method.)

Claims

1. 1. A video decoding method performed by a decoding device, comprising: obtaining flag information from the bitstream relating to whether matrix-based intra prediction (MIP) is used for the current block; obtaining MIP mode information based on the value of the flag information being equal to 1, the value of the flag information being equal to 1 being associated with indicating that the MIP is used for the current block; deriving a MIP matrix based on the MIP mode information and a size of the current block; generating intra-prediction samples for the current block based on the MIP matrix; generating reconstructed samples for the current block based on the intra-predicted samples; the MIP mode information is index information related to the MIP matrix to be applied to the current block; The bin string of the syntax element for the MIP mode information is binarized by a truncated binarization (TB) method, The maximum length of the bin string of the syntax element is set to three different values ​​based on the size of the current block; The maximum length has the largest value based on the width and height of the current block being 4.

2. A video encoding method performed by an encoding device, comprising: deriving whether matrix-based intra prediction (MIP) is applied to a current block; deriving a MIP matrix based on the application of the MIP to the current block; generating intra-prediction samples for the current block based on the MIP matrix; generating flag information relating to whether the MIP is applied to the current block; encoding video information including the flag information; According to the value of the flag information being equal to 1, the image information includes MIP mode information, and the value of the flag information being equal to 1 indicates that the MIP is applied to the current block; the MIP mode information is index information related to the MIP matrix to be applied to the current block; The bin string of the syntax element for the MIP mode information is binarized by a truncated binarization (TB) method, The maximum length of the bin string of the syntax element is set to three different values ​​based on the size of the current block; The maximum length has the largest value based on the width and height of the current block being 4, A MIP matrix is ​​derived based on the MIP mode information and a size of the current block.

3. A method for transmitting data for video, comprising: obtaining a bitstream for the video, the bitstream being generated based on: deriving whether matrix-based intra prediction (MIP) is applied to a current block; deriving an MIP matrix based on the application of the MIP to the current block; generating intra-predicted samples for the current block based on the MIP matrix; generating flag information related to whether the MIP is applied to the current block; and encoding video information including the flag information; transmitting the data including the bitstream; According to the value of the flag information being equal to 1, the image information includes MIP mode information, and the value of the flag information being equal to 1 indicates that the MIP is applied to the current block; the MIP mode information is index information related to the MIP matrix to be applied to the current block; The bin string of the syntax element for the MIP mode information is binarized by a truncated binarization (TB) method, The maximum length of the bin string of the syntax element is set to three different values ​​based on the size of the current block; The maximum length has the largest value based on the width and height of the current block being 4, A method of transmission, wherein a MIP matrix is ​​derived based on the MIP mode information and the size of the current block.