Image encoding / decoding method and apparatus, and recording medium storing bit stream
Through the intra prediction method, the location and values of representative sample points and reference sample points are used to solve the compression efficiency of high-resolution and high-quality image data, and more efficient image encoding and decoding are achieved.
Patent Information
- Application Number
- CN202210861388.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-09-13
- Filing Date
- 2018-10-18
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2038-10-18
AI Technical Summary
High resolution and high-quality image data increase transmission and storage costs, and existing image encoding/decoding technologies are difficult to effectively compress efficiency.
The intra prediction method is adopted to determine the location and value of representative sample points, and use representative sample points and reference sample points to predict the current block, improving the compression efficiency of encoding and decoding.
Improve the compression efficiency of image encoding and decoding, and reduce the cost of transmission and storage.
Smart Images

Figure CN115037932B_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with the application date of October 18, 2018, application number "201880067363.3", and title "Image encoding / decoding method and device and recording medium storing bit stream". Technical Field
[0002] The present invention relates to a method and apparatus for encoding / decoding an image, and a recording medium storing a bitstream. More specifically, the present invention relates to a method and apparatus for encoding / decoding an image using intra-frame prediction, and a recording medium storing a bitstream generated by the image encoding method / apparatus of the present invention. Background Art
[0003] Recently, in various application fields, the demand for high-resolution and high-quality images such as high-definition (HD) images and ultra-high-definition (UHD) images has increased. However, compared with conventional image data, higher-resolution and higher-quality image data has an increased data volume. Therefore, when image data is transmitted by using a medium such as conventional wired and wireless broadband networks, or when image data is stored by using conventional storage media, the cost of transmission and storage increases. In order to solve these problems that arise as the resolution and quality of image data increase, efficient image encoding / decoding technology is required for higher-resolution and higher-quality images.
[0004] Image compression technology includes various technologies, including: inter-frame prediction technology, which predicts pixel values included in the current picture from previous or subsequent pictures of the current picture; intra-frame prediction technology, which predicts pixel values included in the current picture by using pixel information in the current picture; transform and quantization technology for compressing the energy of a residual signal; entropy coding technology, which assigns short codes to values with high frequency of occurrence and long codes to values with low frequency of occurrence; etc. Image data can be effectively compressed by using such image compression technology and can be transmitted or stored. Summary of the Invention
[0005] Technical issues
[0006] An object of the present invention is to provide a method and apparatus for encoding and decoding an image to improve compression efficiency.
[0007] Another object of the present invention is to provide a method and apparatus for encoding and decoding an image using intra-frame prediction to improve compression efficiency.
[0008] Another object of the present invention is to provide a recording medium storing a bit stream generated by the image encoding method / device of the present invention.
[0009] Technical Solution
[0010] An image decoding method according to an embodiment of the present invention may include: deriving an intra-frame prediction mode of a current block, configuring reference samples of the current block, and performing intra-frame prediction on the current block based on the intra-frame prediction mode and the reference samples, wherein the intra-frame prediction may be a prediction based on representative samples.
[0011] In the image decoding method according to the present invention, the prediction based on representative samples may include: determining the position of the representative samples, determining the value of the representative samples, and predicting the samples in the current block using the representative samples and the reference samples.
[0012] In the image decoding method according to the present invention, the position of the representative sample point may be determined as a predetermined fixed position or determined by information signaled through a bitstream.
[0013] In the image decoding method according to the present invention, the predetermined fixed position may be a right bottom position of the current block.
[0014] In the image decoding method according to the present invention, the value of the representative sample may be determined as a statistical value using the representative sample specified by a position of the representative sample and neighboring samples of the representative sample.
[0015] In the image decoding method according to the present invention, the position of the representative sample point may be the right bottom position of the current block, and the value of the representative sample point may be the average value of the representative sample point, the left sample point of the representative sample point, the upper left sample point of the representative sample point, and the upper sample point of the representative sample point.
[0016] In the image decoding method according to the present invention, the step of determining the value of the representative sample may include: deriving a prediction value for the representative sample, reconstructing a residual value for the representative sample, and determining the value of the representative sample using the prediction value and the residual value.
[0017] In the image decoding method according to the present invention, the prediction value for the representative sample may be derived using a left reference sample of the current block and an upper reference sample of the current block.
[0018] In the image decoding method according to the present invention, a prediction value for a right boundary sample point in the current block adjacent to the right boundary of the current block may be derived using interpolation of the representative sample points and the upper reference sample points, and a prediction value for a bottom boundary sample point in the current block adjacent to the bottom boundary of the current block may be derived using interpolation of the representative sample points and the left reference sample points.
[0019] In the image decoding method according to the present invention, the prediction value for the sample in the current block can be derived using the right boundary sample, the bottom boundary sample, the upper reference sample, and the left reference sample.
[0020] An image encoding method according to another embodiment of the present invention may include: determining an intra-frame prediction mode of a current block, configuring reference samples of the current block, and performing intra-frame prediction on the current block based on the intra-frame prediction mode and the reference samples, wherein the intra-frame prediction is based on prediction of representative samples.
[0021] In the image encoding method according to the present invention, the prediction based on representative samples may include: determining positions of the representative samples, determining values of the representative samples, and predicting samples in the current block using the representative samples and the reference samples.
[0022] In the image encoding method according to the present invention, the position of the representative sample point may be determined as a predetermined fixed position or encoded by information signaled through a bit stream.
[0023] In the image encoding method according to the present invention, the value of the representative sample may be determined as a statistical value using the representative sample specified by a position of the representative sample and neighboring samples of the representative sample.
[0024] In the image encoding method according to the present invention, the position of the representative sample may be the right bottom position of the current block, and the value of the representative sample is the average value of the representative sample, the sample to the left of the representative sample, the sample to the upper left of the representative sample, and the sample above the representative sample.
[0025] In the image encoding method according to the present invention, the step of determining the value of the representative sample may include: deriving a prediction value for the representative sample, deriving a residual value for the representative sample, and determining the value of the representative sample using the prediction value and the residual value.
[0026] In the image encoding method according to the present invention, the prediction value for the representative sample may be derived using a left reference sample of the current block and an upper reference sample of the current block.
[0027] In the image encoding method according to the present invention, a prediction value for a right boundary sample point in the current block adjacent to the right boundary of the current block may be derived using interpolation of the representative sample points and the upper reference sample points, and a prediction value for a bottom boundary sample point in the current block adjacent to the bottom boundary of the current block may be derived using interpolation of the representative sample points and the left reference sample points.
[0028] In the image encoding method according to the present invention, the prediction value for the sample in the current block can be derived using the right boundary sample, the bottom boundary sample, the upper reference sample, and the left reference sample.
[0029] A computer-readable recording medium according to another embodiment of the present invention may store a bitstream generated by the image encoding method or apparatus according to the present invention.
[0030] Beneficial effects
[0031] According to the present invention, a method and apparatus for encoding and decoding an image to improve compression efficiency are provided.
[0032] According to the present invention, a method and apparatus for encoding and decoding an image using intra-frame prediction to improve compression efficiency are provided.
[0033] According to the present invention, there is provided a recording medium storing a bit stream generated by the image encoding method / apparatus of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a block diagram showing the configuration of an encoding device according to an embodiment of the present invention.
[0035] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment of the present invention.
[0036] Figure 3 is a diagram schematically showing a partition structure of an image when encoding and decoding the image.
[0037] Figure 4 is a diagram for explaining an embodiment of a process of inter-frame prediction.
[0038] Figure 5 FIG. 1 is a diagram for explaining intra prediction according to the present invention.
[0039] Figure 6 is an exemplary diagram showing the relationship between luminance blocks and chrominance blocks.
[0040] Figure 7 It is a diagram used to describe multiple reconstructed sample point lines.
[0041] Figure 8 is a diagram for describing a process of replacing unusable samples with available samples.
[0042] Figure 9 Various filter shapes are shown.
[0043] Figure 10 is a diagram for describing intra prediction according to the shape of a current block.
[0044] Figure 11 is a diagram for describing neighboring samples of a current block for deriving parameters of a linear model for predicting chrominance components from luma components.
[0045] Figure 12 is an exemplary diagram illustrating a process of reconstructing a color component block.
[0046] Figure 13 is a diagram illustrating an embodiment in which reconstruction is performed by using a plurality of upper reference sample lines and / or a plurality of left reference sample lines.
[0047] Figure 14 is an exemplary diagram illustrating reference samples used for reconstruction according to an intra prediction mode or encoding parameters of a corresponding block.
[0048] Figure 15 is a diagram illustrating an exemplary reconstructed first color component corresponding block when the second color component prediction target block is a 4×4 block.
[0049] Figure 16 is a diagram showing samples of a first color component and samples of a second color component.
[0050] Figure 17 is a diagram illustrating an exemplary method of determining representative sample points.
[0051] Figure 18 is a diagram illustrating an exemplary method of performing prediction on representative samples.
[0052] Figure 19 is a diagram illustrating another exemplary method of performing prediction on representative samples.
[0053] Figure 20 is a diagram illustrating an exemplary method of generating right column prediction samples and bottom row prediction samples of a current block by using reconstructed representative samples and reference samples.
[0054] Figure 21 is a diagram illustrating an exemplary method of performing prediction by using reference samples and right column prediction samples or bottom row prediction samples.
[0055] Figure 22is a diagram illustrating an exemplary prediction method for a case where a current block is divided into subblocks. DETAILED DESCRIPTION
[0056] Various modifications may be made to the present invention, and there are various embodiments of the present invention, of which examples of various embodiments will now be provided and described in detail with reference to the accompanying drawings. However, although the exemplary embodiments may be interpreted as including all modifications, equivalents, or alternative forms within the technical concept and technical scope of the present invention, the present invention is not limited thereto. Similar reference numerals refer to the same or similar functions in various aspects. In the accompanying drawings, the shapes and sizes of elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the accompanying drawings that illustrate specific embodiments in which the present invention may be implemented. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that the various embodiments of the present disclosure, although different, are not necessarily mutually exclusive. For example, specific features, structures, and characteristics described herein in conjunction with one embodiment may be implemented in other embodiments without departing from the spirit and scope of the present disclosure. In addition, it should be understood that the position or arrangement of the various elements within each disclosed embodiment may be modified without departing from the spirit and scope of the present disclosure. Therefore, the following detailed description should not be understood in a limiting sense, and the scope of the present disclosure is limited solely by the appended claims (and, where appropriately interpreted, together with the full scope of equivalents claimed by the claims).
[0057] The terms "first," "second," and the like used in the specification may be used to describe various components, but these components are not to be construed as being limited to these terms. These terms are merely used to distinguish one component from another. For example, without departing from the scope of the present invention, a "first" component may be referred to as a "second" component, and a "second" component may similarly be referred to as a "first" component. The term "and / or" includes a combination of a plurality of items or any one of a plurality of terms.
[0058] It will be understood that, in this specification, when an element is merely referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element, the element may be “directly connected to” or “directly coupled to” the other element, or connected to or coupled to the other element with other elements between the element and the other element. Conversely, it will be understood that when an element is referred to as being “directly coupled to” or “directly coupled” to another element, there are no intervening elements.
[0059] In addition, the components shown in the embodiments of the present invention are shown independently to present characteristic functions that are different from each other. Therefore, this does not mean that each component is composed of a component unit of independent hardware or software. In other words, for convenience, each component includes each of the enumerated components. Therefore, at least two components in each component can be combined to form a component, or a component can be divided into multiple components for performing each function. Without departing from the essence of the present invention, the embodiment in which each component is combined and the embodiment in which a component is divided are also included in the scope of the present invention.
[0060] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Expressions used in the singular include plural expressions, unless it has a significantly different meaning in the context. In this specification, it will be understood that terms such as "including ... ", "having ... " etc. are intended to indicate that there are features, quantities, steps, actions, elements, parts or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, quantities, steps, actions, elements, parts or combinations thereof may be present or may be added. In other words, when a particular element is referred to as "comprising ", elements other than the corresponding element are not excluded, but additional elements may be included in embodiments of the present invention or are within the scope of the present invention.
[0061] Furthermore, some components may not be indispensable components for performing the necessary functions of the present invention, but may be optional components that only enhance their performance. The present invention may be implemented by including only the components that are indispensable for implementing the essence of the present invention and excluding components that are used to enhance performance. Structures that include only the indispensable components and exclude optional components that are used only to enhance performance are also included in the scope of the present invention.
[0062] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings. When describing exemplary embodiments of the present invention, well-known functions or structures will not be described in detail because they would unnecessarily obscure the understanding of the present invention. The same components in the drawings are represented by the same reference numerals, and repeated descriptions of the same components will be omitted.
[0063] Hereinafter, an image may refer to a frame constituting a video, or may refer to the video itself. For example, "encoding or decoding an image, or both encoding and decoding the image" may refer to "encoding or decoding a moving picture, or both encoding and decoding the image," and may refer to "encoding or decoding one of the images in the moving picture, or both encoding and decoding the image."
[0064] Hereinafter, the terms "moving picture" and "video" may be used as the same meaning and may be replaced with each other.
[0065] Hereinafter, a target image may be an encoding target image and / or a decoding target image. Furthermore, a target image may be an input image to an encoding device or an input image to a decoding device. Here, the target image may have the same meaning as the current image.
[0066] Hereinafter, the terms "image," "picture," "frame," and "screen" may be used as the same meaning and replaced with each other.
[0067] Hereinafter, a target block may be an encoding target block as an encoding target and / or a decoding target block as a decoding target. In addition, a target block may be a current block as a target of current encoding and / or decoding. For example, the terms "target block" and "current block" may be used as synonyms and may be substituted for each other.
[0068] Hereinafter, the terms "block" and "unit" may be used as the same meaning and may be replaced with each other. Alternatively, "block" may refer to a specific unit.
[0069] Hereinafter, the terms "region" and "segment" may be used interchangeably.
[0070] Hereinafter, a specific signal may be a signal representing a specific block. For example, an original signal may be a signal representing a target block. A prediction signal may be a signal representing a prediction block. A residual signal may be a signal representing a residual block.
[0071] In an embodiment, each of the specific information, data, flags, indexes, elements, and attributes may have a value. A value of "0" for the information, data, flags, indexes, elements, and attributes may represent a logical false value or a first predefined value. In other words, the values "0," false, logical false, and the first predefined value may be interchangeable. A value of "1" for the information, data, flags, indexes, elements, and attributes may represent a logical true value or a second predefined value. In other words, the values "1," true, logical true, and the second predefined value may be interchangeable.
[0072] When the variable i or j is used to represent a column, row, or index, the value of i can be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, the columns, rows, indexes, etc. can be counted starting from 0 or 1.
[0073] Terminology Description
[0074] Encoder: This refers to the device that performs encoding. In other words, it refers to the encoding device.
[0075] Decoder: This refers to a device that performs decoding. In other words, it refers to a decoding device.
[0076] Block: An M×N array of samples. Here, M and N may represent positive integers, and a block may represent a two-dimensional array of samples. A block may refer to a unit. The current block may refer to an encoding target block that is targeted during encoding, or a decoding target block that is targeted during decoding. Furthermore, the current block may be at least one of a coding block, a prediction block, a residual block, and a transform block.
[0077] Sample: It is the basic unit of a block. According to the bit depth (Bd), the sample can be represented from 0 to 2 Bd In the present invention, the term "sample point" may be used to mean a pixel. That is, the terms "sample point", "pel", and "pixel" may have the same meaning as each other.
[0078] Unit: This may refer to an encoding and decoding unit. When encoding and decoding an image, a unit may be a region generated by partitioning a single image. Furthermore, when a single image is partitioned into sub-divisions during encoding or decoding, a unit may represent a sub-division. In other words, an image may be partitioned into multiple units. When encoding and decoding an image, predetermined processing may be performed on each unit. A single unit may be partitioned into sub-units smaller than the unit. Depending on its function, a unit may refer to a block, macroblock, coding tree unit, coding tree block, coding unit, coding block, prediction unit, prediction block, residual unit, residual block, transform unit, transform block, and so on. Furthermore, to distinguish a unit from a block, a unit may include a luma component block, chroma component blocks associated with the luma component block, and syntax elements for each color component block. A unit may have various sizes and shapes. Specifically, the shape of a unit may be a two-dimensional geometric figure such as a square, rectangle, trapezoid, triangle, pentagon, and so on. Also, the unit information may include at least one of a unit type indicating a coding unit, a prediction unit, a transformation unit, etc., and a unit size, a unit depth, an order of encoding and decoding of the unit, and the like.
[0079] Coding tree unit: A single coding tree block configured with the luma component Y and two coding tree blocks associated with the chroma components Cb and Cr. In addition, the coding tree unit may represent a syntax element including a block and each block. Each coding tree unit may be partitioned by using at least one method of a quadtree partitioning method, a binary tree partitioning method, a ternary tree partitioning method, and the like to configure lower layer units such as coding units, prediction units, and transform units. The coding tree unit may be used as a term for specifying a sample block that becomes a processing unit when encoding / decoding an image as an input image. Here, the quadtree may represent a quadtree.
[0080] When the size of a coding block falls within a first predetermined range, only quadtree partitioning is allowed for that coding block. Here, the first predetermined range may be defined by at least one of a maximum size and a minimum size of a coding block that can be partitioned only via quadtree partitioning. Information indicating the maximum / minimum size of a coding block that allows quadtree partitioning may be signaled as data included in the bitstream, and this information may be signaled in units of at least one of sequence, picture parameter, and slice (segment). Alternatively, the maximum / minimum size of a coding block may be a fixed size preset in the encoder / decoder. For example, when the size of a coding block is within the range of 64×64 to 256×256, the coding block may be partitioned only via quadtree partitioning. Alternatively, when the size of a coding block is larger than the maximum size of a transform block (TB), the coding block may be partitioned only via quadtree partitioning. In this case, the block to be partitioned into multiple quadrants may be a coding block or a transform block. In this case, information indicating the quadtree partitioning of the coding block (e.g., split_flag) may be a flag indicating whether the coding unit is partitioned via quadtree partitioning. When the size of the coding block falls within the second predetermined range, the coding block can be partitioned only by binary tree partitioning or ternary tree partitioning. In this case, the above description of quadtree partitioning can also be applied to binary tree partitioning or ternary tree partitioning.
[0081] Coding tree block: may be used as a term for designating any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.
[0082] Neighboring blocks: These may represent blocks adjacent to the current block. These blocks may be blocks that touch the boundary of the current block or are located within a predetermined distance from the current block. These blocks may be blocks adjacent to vertices of the current block. Here, blocks adjacent to vertices of the current block may be blocks that are vertically adjacent to a neighboring block horizontally adjacent to the current block, or blocks that are horizontally adjacent to a neighboring block vertically adjacent to the current block.
[0083] Reconstructed neighboring blocks: These may refer to neighboring blocks that are spatially / temporally adjacent to the current block and have already been encoded or decoded. Here, reconstructed neighboring blocks may refer to reconstructed neighboring units. Reconstructed spatial neighboring blocks may be blocks within the current picture that have already been reconstructed through encoding or decoding, or both encoding and decoding. Reconstructed temporal neighboring blocks are blocks within the reference picture that are located at a position corresponding to the current block in the current picture, or blocks adjacent to the current block.
[0084] Unit depth: may represent the degree of partitioning of a unit. In a tree structure, the highest node (root node) may correspond to the first unit that has not been partitioned. In addition, the highest node may have the minimum depth value. In this case, the depth of the highest node may be level 0. A node with a depth of level 1 may represent a unit generated by partitioning the first unit once. A node with a depth of level 2 may represent a unit generated by partitioning the first unit twice. A node with a depth of level n may represent a unit generated by partitioning the first unit n times. A leaf node may be the lowest node and a node that cannot be partitioned further. The depth of a leaf node may be the maximum level. For example, the predefined value of the maximum level may be 3. The depth of the root node may be the lowest, and the depth of the leaf node may be the deepest. In addition, when a unit is represented as a tree structure, the level at which the unit exists may represent the unit depth.
[0085] Bitstream: can represent a bit stream containing coded image information.
[0086] Parameter Set: This corresponds to header information within the bitstream configuration. A parameter set may include at least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set. Furthermore, a parameter set may include slice header and tile header information.
[0087] Parsing: may refer to determining the value of a syntax element by performing entropy decoding, or may refer to the entropy decoding itself.
[0088] Symbol: can represent at least one of the syntax elements, coding parameters, and transform coefficient values of the encoding / decoding target unit. In addition, the symbol can represent the entropy encoding target or the entropy decoding result.
[0089] Prediction mode: may be information indicating a mode of encoding / decoding using intra prediction or a mode of encoding / decoding using inter prediction.
[0090] Prediction unit: This refers to the basic unit used when performing predictions such as inter-frame prediction, intra-frame prediction, inter-frame compensation, intra-frame compensation, and motion compensation. A single prediction unit can be partitioned into multiple partitions of smaller sizes, or into multiple lower-layer prediction units. Multiple partitions can be the basic unit used when performing prediction or compensation. Partitions generated by splitting a prediction unit can also be prediction units.
[0091] Prediction unit partition: may represent a shape obtained by partitioning a prediction unit.
[0092] Transform unit: This refers to a basic unit used when encoding / decoding a residual signal (such as transform, inverse transform, quantization, inverse quantization, and transform coefficient encoding / decoding). A single transform unit can be partitioned into multiple transform units of smaller sizes at lower levels. The transform / inverse transform may include at least one of a first transform / first inverse transform and a second transform / second inverse transform.
[0093] Scaling: This refers to the process of multiplying the quantization level by a factor. Transform coefficients can be generated by scaling the quantization level. Scaling can also be called inverse quantization.
[0094] Quantization parameter: This may indicate the value used when generating the quantization level using the transform coefficient during quantization. It may also indicate the value used when generating the transform coefficient by scaling the quantization level during inverse quantization. The quantization parameter may be a value mapped to the quantization step size.
[0095] Delta quantization parameter: may represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.
[0096] Scan: This may refer to a method of sorting coefficients within a cell, block, or matrix. For example, changing a two-dimensional matrix of coefficients to a one-dimensional matrix may be called scanning, and changing a one-dimensional matrix of coefficients to a two-dimensional matrix may be called scanning or inverse scanning.
[0097] Transform coefficient: This term may refer to a coefficient value generated after a transform is performed in an encoder. A transform coefficient may refer to a coefficient value generated after at least one of entropy decoding and inverse quantization is performed in a decoder. A transform coefficient also includes a quantization level obtained by quantizing a transform coefficient or a residual signal, or a quantized transform coefficient level.
[0098] Quantization level: This refers to the value generated by quantizing transform coefficients or residual signals in an encoder. Alternatively, the quantization level may refer to a value that serves as a target for inverse quantization to be performed in a decoder. Similarly, the level of quantized transform coefficients, which are the result of transformation and quantization, also falls within the meaning of the quantization level.
[0099] Non-zero transform coefficient: may refer to a transform coefficient having a value other than zero, or a transform coefficient level or quantization level having a value other than zero.
[0100] Quantization matrix: may refer to a matrix used in a quantization process or an inverse quantization process performed to improve subjective image quality or objective image quality. The quantization matrix may also be referred to as a scaling list.
[0101] Quantization matrix coefficients: These represent each element in the quantization matrix. Quantization matrix coefficients are also called matrix coefficients.
[0102] Default matrix: may represent a predetermined quantization matrix predefined in an encoder or decoder.
[0103] Non-default matrix: may represent a quantization matrix that is not pre-defined in the encoder or decoder but is signaled by the user.
[0104] Statistical value: The statistical value for at least one of a variable, coding parameter, constant value, etc. having a calculable specific value can be one or more of the average value, weighted average value, weighted sum value, minimum value, maximum value, most frequently occurring value, median value, and interpolation value of the corresponding specific value.
[0105] Figure 1 is a block diagram showing a configuration of an encoding device according to an embodiment to which the present invention is applied.
[0106] The encoding device 100 may be an encoder, a video encoding device, or an image encoding device. A video may include at least one image. The encoding device 100 may sequentially encode at least one image.
[0107] Reference Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.
[0108] The encoding device 100 can perform encoding on an input image by using intra mode or inter mode, or both intra mode and inter mode. In addition, the encoding device 100 can generate a bit stream including encoding information by encoding the input image, and output the generated bit stream. The generated bit stream can be stored in a computer-readable recording medium, or can be streamed via a wired / wireless transmission medium. When intra mode is used as the prediction mode, the switch 115 can be switched to intra mode. Alternatively, when inter mode is used as the prediction mode, the switch 115 can be switched to inter mode. Here, intra mode may refer to intra prediction mode, and inter mode may refer to inter prediction mode. The encoding device 100 can generate a prediction block for an input block of the input image. In addition, after generating the prediction block, the encoding device 100 can encode a residual block using the residual of the input block and the prediction block. The input image can be referred to as the current image that is the current encoding target. The input block can be referred to as the current block that is the current encoding target, or as the encoding target block.
[0109] When the prediction mode is intra mode, the intra prediction unit 120 may use samples of a block that has been encoded / decoded and is adjacent to the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block using the reference samples, or may generate prediction samples of the input block by performing spatial prediction. Here, intra prediction may refer to prediction within a frame.
[0110] When the prediction mode is inter mode, the motion prediction unit 111 may retrieve the area that best matches the input block from the reference image when performing motion prediction, and derive a motion vector by using the retrieved area. In this case, the search area may be used as the area. The reference image may be stored in the reference picture buffer 190. Here, when encoding / decoding of the reference image is performed, the reference image may be stored in the reference picture buffer 190.
[0111] The motion compensation unit 112 may generate a prediction block by performing motion compensation on the current block using the motion vector. Here, inter prediction may refer to inter prediction or motion compensation.
[0112] When the value of the motion vector is not an integer, the motion prediction unit 111 and the motion compensation unit 112 may generate a prediction block by applying an interpolation filter to a partial area of a reference picture. To perform inter-frame prediction or motion compensation on a coding unit, it may be determined which mode among skip mode, merge mode, advanced motion vector prediction (AMVP) mode, and current picture reference mode is used for motion prediction and motion compensation of the prediction unit included in the corresponding coding unit. Then, inter-frame prediction or motion compensation may be performed differently depending on the determined mode.
[0113] The subtractor 125 may generate a residual block using the residual between the input block and the prediction block. The residual block may be referred to as a residual signal. The residual signal may represent the difference between the original signal and the prediction signal. In addition, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the prediction signal, or by transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be a residual signal of a block unit.
[0114] The transform unit 130 may generate a transform coefficient by performing a transform on the residual block and output the generated transform coefficient. Here, the transform coefficient may be a coefficient value generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip transforming the residual block.
[0115] The quantization level may be generated by applying quantization to a transform coefficient or to a residual signal. Hereinafter, the quantization level may also be referred to as a transform coefficient in embodiments.
[0116] The quantization unit 140 may generate a quantization level by quantizing the transform coefficient or the residual signal according to the parameter and output the generated quantization level. Here, the quantization unit 140 may quantize the transform coefficient by using a quantization matrix.
[0117] The entropy coding unit 150 may generate a bitstream by performing entropy coding on the value calculated by the quantization unit 140 or the coding parameter value calculated when performing coding according to the probability distribution, and output the generated bitstream. The entropy coding unit 150 may perform entropy coding on sample information of an image and information for decoding the image. For example, the information for decoding the image may include syntax elements.
[0118] When entropy coding is applied, symbols are represented so that a smaller number of bits are allocated to symbols with a high probability of generation, and a larger number of bits are allocated to symbols with a low probability of generation, thereby reducing the size of the bit stream for the symbols to be encoded. The entropy coding unit 150 may use a coding method for entropy coding such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. For example, the entropy coding unit 150 may perform entropy coding by using a variable length coding / code (VLC) table. In addition, the entropy coding unit 150 may derive a binarization method of the target symbol and a probability model of the target symbol / binary bit, and perform arithmetic coding by using the derived binarization method and context model.
[0119] In order to encode transform coefficient levels (quantized levels), the entropy encoding unit 150 may change coefficients in a two-dimensional block form into a one-dimensional vector form by using a transform coefficient scanning method.
[0120] The coding parameters may include information such as syntax elements (flags, indexes, etc.) that are encoded in the encoder and transmitted to the decoder using signals, as well as information derived when performing encoding or decoding. The coding parameters may represent information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: unit / block size, unit / block depth, unit / block partition information, unit / block shape, unit / block partition structure, whether to perform quadtree partitioning, whether to perform binary tree partitioning, binary tree partitioning direction (horizontal or vertical), binary tree partitioning form (symmetric partitioning or asymmetric partitioning), whether to perform ternary tree partitioning, ternary tree partitioning direction (horizontal or vertical), ternary tree partitioning form (symmetric partitioning or asymmetric partitioning), whether to perform multi-type tree partitioning, multi-type tree partitioning direction (horizontal or vertical) vertical direction), multi-type tree-based partitioning (symmetric partitioning or asymmetric partitioning), multi-type tree-based partitioning tree, prediction mode (intra-frame prediction or inter-frame prediction), luminance intra-frame prediction mode / direction, chrominance intra-frame prediction mode / direction, intra-frame partition information, inter-frame partition information, coding block partition flag, prediction block partition flag, transform block partition flag, reference sample filtering method, reference sample filter taps, reference sample filter coefficients, prediction block filtering method, prediction block filter taps, prediction block filter coefficients, prediction block boundary filtering method, prediction block boundary filter taps, prediction block boundary filter coefficients, intra-frame prediction mode, inter-frame prediction mode, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information, motion information Motion vector, motion vector difference, reference picture index, inter-frame prediction angle, inter-frame prediction indicator, prediction list utilization flag, reference picture list, reference picture, motion vector predictor index, motion vector predictor candidate, motion vector candidate list, whether to use merge mode, merge index, merge candidate, merge candidate list, whether to use skip mode, interpolation filter type, interpolation filter tap, interpolation filter coefficient, motion vector size, motion vector representation accuracy, transform type, transform size, information on whether the first (first) transform is used, information on whether the second transform is used, first transform index, second transform index, information on whether the residual signal exists , coding block pattern, coding block flag (CBF), quantization parameter, quantization parameter residual, quantization matrix, whether to apply intra-loop filter, intra-loop filter coefficient, intra-loop filter tap, intra-loop filter shape / form, whether to apply deblocking filter, deblocking filter coefficient, deblocking filter tap, deblocking filter strength, deblocking filter shape / form, whether to apply adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply adaptive loop filter, adaptive loop filter coefficient, adaptive loop filter tap, adaptive loop filter shape / form, binarization / debinarization method,Context model determination method, context model update method, whether to execute normal mode, whether to execute bypass mode, context binary bit, bypass binary bit, valid coefficient flag, last valid coefficient flag, encoding flag for unit of coefficient group, position of last valid coefficient, flag on whether the value of coefficient is greater than 1, flag on whether the value of coefficient is greater than 2, flag on whether the value of coefficient is greater than 3, information on remaining coefficient value, sign information, reconstructed luminance sample, reconstructed chrominance sample, residual luminance sample, residual chrominance sample, luminance transform coefficient, chrominance transform coefficient, quantized luminance level, quantized chrominance level, transform coefficient level scanning method, on decoder side the size of a motion vector search area, the shape of a motion vector search area on the decoder side, the number of motion vector searches on the decoder side, information on a CTU size, information on a minimum block size, information on a maximum block size, information on a maximum block depth, information on a minimum block depth, an image display / output order, slice identification information, a slice type, slice partition information, tile identification information, a tile type, tile partition information, a picture type, a bit depth of input samples, a bit depth of reconstructed samples, a bit depth of residual samples, a bit depth of transform coefficients, a bit depth of a quantization level, and information on a luminance signal or information on a chrominance signal.
[0121] Here, signaling a flag or an index may mean entropy encoding the corresponding flag or index by an encoder and including it in a bitstream, and may mean entropy decoding the corresponding flag or index from the bitstream by a decoder.
[0122] When the encoding apparatus 100 performs encoding by inter-frame prediction, the current image being encoded can be used as a reference image for another image to be processed subsequently. Therefore, the encoding apparatus 100 can reconstruct or decode the current image being encoded, or store the reconstructed or decoded image as a reference image in the reference picture buffer 190.
[0123] The quantization level may be inversely quantized in the inverse quantization unit 160 or inversely transformed in the inverse transform unit 170. The inversely quantized or inversely transformed coefficient or the inversely quantized and inversely transformed coefficient may be added to the prediction block by the adder 175. By adding the inversely quantized or inversely transformed coefficient or the inversely quantized and inversely transformed coefficient to the prediction block, a reconstructed block may be generated. Here, the inversely quantized or inversely transformed coefficient or the inversely quantized and inversely transformed coefficient may mean a coefficient on which at least one of inverse quantization and inverse transformation has been performed, and may mean a reconstructed residual block.
[0124] The reconstructed block may pass through the filter unit 180. The filter unit 180 may apply at least one of a deblocking filter, a sample adaptive offset (SAO), and an adaptive loop filter (ALF) to the reconstructed samples, the reconstructed block, or the reconstructed image. The filter unit 180 may be referred to as an in-loop filter.
[0125] A deblocking filter can remove block distortion generated at the boundaries between blocks. To determine whether to apply the deblocking filter, the determination of whether to apply the deblocking filter to the current block can be made based on the samples included in a number of rows or columns included in the block. When the deblocking filter is applied to the block, another filter can be applied according to the desired deblocking filter strength.
[0126] To compensate for coding errors, sample adaptive offset can be used to add an appropriate offset value to the sample value. Sample adaptive offset can correct the offset between the deblocked image and the original image on a sample-by-sample basis. A method for applying the offset can be used that considers edge information about each sample, or a method can be used that partitions the sample points of the image into a predetermined number of regions, determines the regions to which the offset is applied, and applies the offset to the determined regions.
[0127] The adaptive loop filter can perform filtering based on the comparison result of the filtered reconstructed image and the original image. The samples included in the image can be partitioned into predetermined groups, the filter to be applied to each group can be determined, and differential filtering can be performed on each group. Information on whether to apply ALF can be signaled by the coding unit (CU), and the form and coefficients of the ALF to be applied to each block can be varied.
[0128] The reconstructed block or reconstructed image that has passed through the filter unit 180 may be stored in the reference picture buffer 190. The reconstructed block processed by the filter unit 180 may be part of a reference image. That is, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 180. The stored reference image may be used later in inter-frame prediction or motion compensation.
[0129] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment and to which the present invention is applied.
[0130] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.
[0131] Reference Figure 2 , the decoding apparatus 200 may include an entropy decoding unit 210 , an inverse quantization unit 220 , an inverse transform unit 230 , an intra prediction unit 240 , a motion compensation unit 250 , an adder 225 , a filter unit 260 , and a reference picture buffer 270 .
[0132] The decoding device 200 may receive the bitstream output from the encoding device 100. The decoding device 200 may receive the bitstream stored in a computer-readable recording medium, or may receive the bitstream streamed via a wired / wireless transmission medium. The decoding device 200 may decode the bitstream using an intra-frame mode or an inter-frame mode. In addition, the decoding device 200 may generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.
[0133] When the prediction mode used in decoding is intra mode, the switch may be switched to intra mode. Alternatively, when the prediction mode used in decoding is inter mode, the switch may be switched to inter mode.
[0134] The decoding device 200 can obtain a reconstructed residual block by decoding the input bit stream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block that becomes the decoding target by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as the current block.
[0135] The entropy decoding unit 210 may generate symbols by entropy decoding the bit stream according to the probability distribution. The generated symbols may include symbols in the form of quantized levels. Here, the entropy decoding method may be an inverse process of the above-mentioned entropy encoding method.
[0136] In order to decode transform coefficient levels (quantized levels), the entropy decoding unit 210 may change coefficients in a unidirectional vector form into a two-dimensional block form by using a transform coefficient scanning method.
[0137] The quantized levels may be inversely quantized in the inverse quantization unit 220, or inversely transformed in the inverse transform unit 230. The quantized levels may be the result of inverse quantization or inverse transformation, or both, and may be generated as a reconstructed residual block. Here, the inverse quantization unit 220 may apply a quantization matrix to the quantized levels.
[0138] When the intra mode is used, the intra prediction unit 240 may generate a predicted block by performing spatial prediction on the current block, wherein the spatial prediction uses sample values of blocks that are adjacent to the decoding target block and have already been decoded.
[0139] When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation on the current block, wherein the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270 .
[0140] The adder 225 can generate a reconstructed block by adding the reconstructed residual block to the prediction block. The filter unit 260 can apply at least one of a deblocking filter, a sample adaptive offset, and an adaptive loop filter to the reconstructed block or reconstructed image. The filter unit 260 can output the reconstructed image. The reconstructed block or reconstructed image can be stored in the reference picture buffer 270 and used when performing inter-frame prediction. The reconstructed block processed by the filter unit 260 can be part of a reference image. In other words, the reference image is a reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference image can be used later in inter-frame prediction or motion compensation.
[0141] Figure 3 is a diagram schematically illustrating a partition structure of an image when encoding and decoding the image. Figure 3 An example of partitioning a single cell into multiple lower-level cells is schematically shown.
[0142] In order to efficiently partition an image, a coding unit (CU) may be used when encoding and decoding. A coding unit may be used as a basic unit when encoding / decoding an image. In addition, a coding unit may be used as a unit for distinguishing between an intra-frame prediction mode and an inter-frame prediction mode when encoding / decoding an image. A coding unit may be a basic unit for prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding processing of a transform coefficient.
[0143] Reference Figure 3 , the image 300 is sequentially partitioned according to the largest coding unit (LCU), and the LCU unit is determined as a partition structure. Here, LCU can be used with the same meaning as coding tree unit (CTU). Unit partitioning may mean partitioning the block associated with the unit. In the block partition information, information about the unit depth may be included. The depth information may indicate the number or degree of partitioning of the unit or both the number and degree of partitioning of the unit. A single unit may be partitioned into multiple lower-level units hierarchically associated with the depth information based on a tree structure. In other words, the unit and the lower-level units generated by partitioning the unit may correspond to a node and a child node of the node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information indicating the size of a CU and may be stored in each CU. The unit depth indicates the number and / or degree associated with partitioning the unit. Therefore, the partition information of the lower-level unit may include information about the size of the lower-level unit.
[0144] The partition structure may indicate the distribution of coding units (CUs) within a CTU 310. This distribution may be determined by whether a single CU is partitioned into multiple CUs (a positive integer equal to or greater than 2, including 2, 4, 8, 16, etc.). The horizontal and vertical sizes of the CU generated by partitioning may be half the horizontal and vertical sizes of the CU before partitioning, or may be smaller than the horizontal and vertical sizes before partitioning, depending on the number of partitioning operations. A CU may be recursively partitioned into multiple CUs. Recursive partitioning may reduce at least one of the height and width of the CU after partitioning compared to at least one of the height and width of the CU before partitioning. CU partitioning may be recursively performed until a predefined depth or predefined size is reached. For example, the depth of a CTU may be 0, and the depth of a smallest coding unit (SCU) may be a predefined maximum depth. As described above, a CTU may be a coding unit with the largest coding unit size, and an SCU may be a coding unit with the smallest coding unit size. Partitioning starts with CTU 310. When the horizontal or vertical size, or both the horizontal and vertical sizes of a CU are reduced by partitioning, the CU depth increases by 1. For example, for each depth, the size of a non-partitioned CU may be 2N×2N. In addition, in the case of a partitioned CU, a CU of size 2N×2N may be partitioned into four CUs of size N×N. When the depth increases by 1, the size of N may be halved.
[0145] In addition, information about whether a CU is partitioned can be indicated by using its partition information. The partition information can be 1-bit information. All CUs except the SCU can include partition information. For example, when the partition information value is a first value, the CU may not be partitioned, and when the partition information value is a second value, the CU may be partitioned.
[0146] Reference Figure 3 , a CTU with a depth of 0 may be a 64×64 block. 0 may be the minimum depth. An SCU with a depth of 3 may be an 8×8 block. 3 may be the maximum depth. CUs with a 32×32 block and a 16×16 block may be denoted as depth 1 and depth 2, respectively.
[0147] For example, when a single coding unit is partitioned into four coding units, the horizontal and vertical sizes of the four partitioned coding units may be half the horizontal and vertical sizes of the CU before partitioning. In one embodiment, when a coding unit of size 32×32 is partitioned into four coding units, the size of each of the four partitioned coding units may be 16×16. When a single coding unit is partitioned into four coding units, it can be said that the coding unit can be partitioned (quadtree partitioning) into a quadtree form.
[0148] For example, when a single coding unit is partitioned into two coding units, the horizontal size or vertical size of the two coding units may be half the horizontal size or vertical size of the coding unit before being partitioned. For example, when a coding unit of size 32×32 is partitioned in the vertical direction, each of the two partitioned coding units may have a size of 16×32. For example, when a coding unit of size 8×32 is partitioned horizontally into two sub-coding units, each of the two sub-coding units may have a size of 8×16. When a single coding unit is partitioned into two coding units, the coding unit may be said to be partitioned (binary tree partitioning) in a binary tree form.
[0149] For example, when a coding unit is partitioned into three sub-coding units, the horizontal size or vertical size of the coding unit may be partitioned in a ratio of 1:2:1, thereby generating three sub-coding units having a ratio of 1:2:1 in terms of the horizontal size or vertical size. For example, when a coding unit having a size of 16×32 is partitioned horizontally into three sub-coding units, the three sub-coding units may have sizes of 16×8, 16×16, and 16×8, respectively, in order from the uppermost sub-coding unit to the lowermost sub-coding unit. For example, when a coding unit having a size of 32×32 is partitioned vertically into three sub-coding units, the three sub-coding units may have sizes of 8×32, 16×32, and 8×32, respectively, in order from the left sub-coding unit to the right sub-coding unit. When a coding unit is partitioned into three sub-coding units, the coding unit may be said to be partitioned by a ternary tree or partitioned according to a ternary tree partition structure.
[0150] exist Figure 3 , a coding tree unit (CTU) 320 is an example of a CTU to which a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure are all applied.
[0151] As described above, to partition a CTU, at least one of a quadtree partition structure, a binary tree partition structure, and a ternary tree partition structure may be applied. The various tree partition structures may be sequentially applied to the CTU according to a predetermined priority order. For example, the quadtree partition structure may be preferentially applied to the CTU. Coding units that can no longer be partitioned using the quadtree partition structure may correspond to leaf nodes of the quadtree. Coding units corresponding to leaf nodes of the quadtree may serve as root nodes of the binary and / or ternary tree partition structures. In other words, coding units corresponding to leaf nodes of the quadtree may be further partitioned using the binary or ternary tree partition structure, or may not be further partitioned. Therefore, by preventing coding blocks generated by binary or ternary tree partitioning of coding units corresponding to leaf nodes of the quadtree from being further quadtree partitioned, block partitioning and / or partition information may be efficiently performed and / or signaled.
[0152] The fact that the coding unit corresponding to the node of the quadtree is partitioned can be signaled using the four partition information. The four partition information having a first value (e.g., "1") can indicate that the current coding unit is partitioned according to the quadtree partition structure. The four partition information having a second value (e.g., "0") can indicate that the current coding unit is not partitioned according to the quadtree partition structure. The four partition information can be a flag with a predetermined length (e.g., one bit).
[0153] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, the coding unit corresponding to the leaf node of the quadtree may be further partitioned by either binary tree partitioning or ternary tree partitioning. In addition, the coding unit generated by binary tree partitioning or ternary tree partitioning may be further partitioned by binary tree partitioning or ternary tree partitioning, or may not be further partitioned.
[0154] A tree structure in which no priority exists in binary tree partitioning and ternary tree partitioning is referred to as a multi-type tree structure. Coding units corresponding to leaf nodes of a quadtree can be used as root nodes of the multi-type tree. Whether to partition coding units corresponding to nodes of the multi-type tree can be signaled using at least one of multi-type tree partition indication information, partition direction information, and partition tree information. To partition coding units corresponding to nodes of the multi-type tree, the multi-type tree partition indication information, partition direction, and partition tree information can be sequentially signaled.
[0155] The multi-type tree partition indication information having a first value (e.g., '1') may indicate that the current coding unit will be multi-type tree partitioned. The multi-type tree partition indication information having a second value (e.g., '0') may indicate that the current coding unit will not be multi-type tree partitioned.
[0156] When a coding unit corresponding to a node of a multi-type tree is partitioned according to a multi-type tree partition structure, the coding unit may further include partition direction information. The partition direction information may indicate in which direction the current coding unit will be partitioned according to the multi-type tree partition structure. Partition direction information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned vertically. Partition direction information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned horizontally.
[0157] When the coding unit corresponding to the node of the multi-type tree is partitioned according to the multi-type tree partition structure, the current coding unit may further include partition tree information. The partition tree information may indicate the tree partition structure to be used to partition the node of the multi-type tree. The partition tree information having a first value (e.g., "1") may indicate that the current coding unit will be partitioned according to the binary tree partition structure. The partition tree information having a second value (e.g., "0") may indicate that the current coding unit will be partitioned according to the ternary tree partition structure.
[0158] The partition indication information, the partition tree information, and the partition direction information may all be flags having a predetermined length (eg, one bit).
[0159] At least any one of quadtree partition indication information, multi-type tree partition indication information, partition direction information, and partition tree information may be entropy coded / decoded. In order to entropy code / decode those types of information, information about neighboring coding units adjacent to the current coding unit may be used. For example, there is a high probability that the partition type (partitioned or not partitioned, partition tree, and / or partition direction) of the left neighboring coding unit and / or the upper neighboring coding unit of the current coding unit is similar to the partition type of the current coding unit. Therefore, context information for entropy coding / decoding the information about the current coding unit may be derived from the information about the neighboring coding units. The information about the neighboring coding units may include at least any one of quadtree partition information, multi-type tree partition indication information, partition direction information, and partition tree information.
[0160] As another example, between binary tree partitioning and ternary tree partitioning, binary tree partitioning may be prioritized. That is, the current coding unit may first be binary tree partitioned, and then the coding unit corresponding to the leaf node of the binary tree may be set as the root node for the ternary tree partitioning. In this case, for the coding unit corresponding to the node of the ternary tree, neither quadtree partitioning nor binary tree partitioning may be performed.
[0161] A coding unit that cannot be partitioned according to a quadtree partition structure, a binary tree partition structure, and / or a ternary tree partition structure becomes a basic unit for encoding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Therefore, partition structure information and partition information for partitioning a coding unit into prediction units and / or transformation units may not be present in the bitstream.
[0162] However, when the size of a coding unit (i.e., the basic unit for partitioning) is larger than the size of the maximum transform block, the coding unit may be recursively partitioned until the size of the coding unit is reduced to be equal to or smaller than the size of the maximum transform block. For example, when the size of the coding unit is 64×64 and the size of the maximum transform block is 32×32, the coding unit may be partitioned into four 32×32 blocks for transforming. For example, when the size of the coding unit is 32×64 and the size of the maximum transform block is 32×32, the coding unit may be partitioned into two 32×32 blocks for transforming. In this case, the partitioning of the coding unit for transforming is not separately signaled, and the partitioning of the coding unit for transforming may be determined by comparing the horizontal or vertical size of the coding unit with the horizontal or vertical size of the maximum transform block. For example, when the horizontal size (width) of the coding unit is larger than the horizontal size (width) of the maximum transform block, the coding unit may be vertically divided into two equal parts. For example, when the vertical size (length) of the coding unit is larger than the vertical size (length) of the maximum transform block, the coding unit may be horizontally divided into two equal parts.
[0163] Information about the maximum and / or minimum size of a coding unit and information about the maximum and / or minimum size of a transform block may be signaled or determined at a higher level of the coding unit. The higher level may be, for example, a sequence level, a picture level, a slice level, etc. For example, the minimum size of a coding unit may be determined to be 4×4. For example, the maximum size of a transform block may be determined to be 64×64. For example, the minimum size of a transform block may be determined to be 4×4.
[0164] Information on the minimum size of the coding unit corresponding to a leaf node of the quadtree (quadtree minimum size) and / or information on the maximum depth from the root node to the leaf node of the multi-type tree (maximum tree depth of the multi-type tree) may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, etc. Information on the minimum size of the quadtree and / or information on the maximum depth of the multi-type tree may be signaled or determined for each of an intra slice and an inter slice.
[0165] The difference information between the size of the CTU and the maximum size of the transform block may be signaled or determined at a higher level of the coding unit. For example, the higher level may be a sequence level, a picture level, a slice level, or the like. Information regarding the maximum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the maximum size of the binary tree) may be determined based on the size of the coding tree unit and the difference information. The maximum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the maximum size of the ternary tree) may vary depending on the type of slice. For example, for intra slices, the maximum size of the ternary tree may be 32×32. For example, for inter slices, the maximum size of the ternary tree may be 128×128. For example, the minimum size of the coding unit corresponding to each node of the binary tree (hereinafter referred to as the minimum size of the binary tree) and / or the minimum size of the coding unit corresponding to each node of the ternary tree (hereinafter referred to as the minimum size of the ternary tree) may be set as the minimum size of the coding block.
[0166] As another example, the maximum size of the binary tree and / or the maximum size of the ternary tree may be signaled or determined at the slice level. Alternatively, the minimum size of the binary tree and / or the minimum size of the ternary tree may be signaled or determined at the slice level.
[0167] Depending on the size information and depth information of the various blocks described above, quad partition information, multi-type tree partition indication information, partition tree information, and / or partition direction information may or may not be included in the bitstream.
[0168] For example, when the size of the coding unit is not greater than the minimum size of the quadtree, the coding unit does not include the quad partition information. Therefore, the quad partition information can be derived from the second value.
[0169] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to the node of the multi-type tree is larger than the maximum size (horizontal size and vertical size) of the binary tree and / or the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be partitioned by the binary tree or the ternary tree. Therefore, the multi-type tree partition indication information may not be signaled, but may be derived from the second value.
[0170] Optionally, when the size (horizontal and vertical) of the coding unit corresponding to the node of the multi-type tree is the same as the maximum size (horizontal and vertical) of the binary tree and / or is twice the maximum size (horizontal and vertical) of the ternary tree, the coding unit may not be further partitioned by the binary tree or the ternary tree. Therefore, the multi-type tree partition indication information may not be signaled, but may be derived from the second value. This is because when the coding unit is partitioned according to the binary tree partition structure and / or the ternary tree partition structure, a coding unit smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree is generated.
[0171] Alternatively, when the depth of a coding unit corresponding to a node of a multi-type tree is equal to the maximum depth of the multi-type tree, the coding unit may not be further partitioned into a binary tree and / or a ternary tree. Therefore, the multi-type tree partition indication information may not be signaled, but may be derived from the second value.
[0172] Optionally, multi-type tree partition indication information may be signaled only when at least one of vertical binary tree partitioning, horizontal binary tree partitioning, vertical ternary tree partitioning, and horizontal ternary tree partitioning is feasible for the coding unit corresponding to the node of the multi-type tree. Otherwise, binary tree partitioning and / or ternary tree partitioning may not be performed on the coding unit. Therefore, multi-type tree partition indication information may not be signaled, but may be derived from the second value.
[0173] Optionally, partition direction information may be signaled only when both vertical binary tree partitioning and horizontal binary tree partitioning, or both vertical ternary tree partitioning and horizontal ternary tree partitioning, are feasible for the coding unit corresponding to the node of the multi-type tree. Otherwise, partition direction information may not be signaled but may be derived from a value indicating a possible partition direction.
[0174] Optionally, partition tree information may be signaled only when both vertical binary tree partitioning and vertical ternary tree partitioning, or both horizontal binary tree partitioning and horizontal ternary tree partitioning, are feasible for the coding tree corresponding to the node of the multi-type tree. Otherwise, partition tree information may not be signaled but may be derived from a value indicating a possible partition tree structure.
[0175] Figure 4 is a diagram illustrating an intra prediction process.
[0176] Figure 4 The arrows from the center to the outside in may represent the prediction direction of the intra prediction mode.
[0177] Intra-frame encoding and / or decoding may be performed using reference samples of a neighboring block of the current block. The neighboring block may be a reconstructed neighboring block. For example, intra-frame encoding and / or decoding may be performed using values of reference samples or encoding parameters included in the reconstructed neighboring block.
[0178] A prediction block may refer to a block generated by performing intra prediction. A prediction block may correspond to at least one of a CU, a PU, and a TU. A unit of a prediction block may have the size of one of a CU, a PU, and a TU. A prediction block may be a square block of a size of 2×2, 4×4, 16×16, 32×32, or 64×64, or a rectangular block of a size of 2×8, 4×8, 2×16, 4×16, or 8×16, etc.
[0179] Intra-frame prediction may be performed based on an intra-frame prediction mode for the current block. The number of intra-frame prediction modes that the current block may have may be a fixed value or may be a value determined differently depending on the properties of the prediction block. For example, the properties of the prediction block may include the size and shape of the prediction block.
[0180] Regardless of the block size, the number of intra-frame prediction modes can be fixed to N. Alternatively, the number of intra-frame prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65, or 67, etc. Alternatively, the number of intra-frame prediction modes can vary depending on the block size or the color component type, or both. For example, the number of intra-frame prediction modes can vary depending on whether the color component is a luminance signal or a chrominance signal. For example, as the block size increases, the number of intra-frame prediction modes can increase. Alternatively, the number of intra-frame prediction modes for a luminance component block can be greater than the number of intra-frame prediction modes for a chrominance component block.
[0181] The intra-frame prediction mode may be a non-angle mode or an angular mode. The non-angle mode may be a DC mode or a planar mode, and the angular mode may be a prediction mode with a specific direction or angle. The intra-frame prediction mode may be represented by at least one of a mode number, a mode value, a mode number, a mode angle, and a mode direction. The number of intra-frame prediction modes may be M, which is equal to or greater than 1, including non-angle and angular modes.
[0182] In order to perform intra prediction on the current block, a step of determining whether samples included in a reconstructed neighboring block can be used as reference samples of the current block may be performed. When there are samples that cannot be used as reference samples of the current block, a value obtained by copying or interpolating at least one sample value among the samples included in the reconstructed neighboring block, or performing both copying and interpolation, may be used to replace the unavailable sample value of the sample, and thus the replaced sample value is used as the reference sample of the current block.
[0183] When intra prediction is performed, a filter may be applied to at least one of reference samples and prediction samples based on the intra prediction mode and the current block size / shape.
[0184] In planar mode, when generating a prediction block for the current block, the sample value of the prediction target sample may be generated by using a weighted sum of the upper and left reference samples of the current sample, as well as the upper right and lower left reference samples of the current block, depending on the position of the prediction target sample within the prediction block. Furthermore, in DC mode, when generating a prediction block for the current block, the average of the upper and left reference samples of the current block may be used. Furthermore, in angular mode, the prediction block may be generated using the upper, left, upper right, and / or lower left reference samples of the current block. To generate the prediction sample values, real-number interpolation may be performed.
[0185] The intra-frame prediction mode of the current block can be entropy encoded / decoded by predicting the intra-frame prediction mode of a block adjacent to the current block. When the intra-frame prediction mode of the current block is the same as that of the neighboring block, information that the intra-frame prediction mode of the current block and the neighboring block is the same can be signaled using predetermined flag information. In addition, indicator information of the intra-frame prediction mode that is the same as the intra-frame prediction mode of the current block among the intra-frame prediction modes of multiple neighboring blocks can be signaled. When the intra-frame prediction mode of the current block is different from that of the neighboring block, the intra-frame prediction mode information of the current block can be entropy encoded / decoded by performing entropy encoding / decoding based on the intra-frame prediction mode of the neighboring block.
[0186] Figure 5 is a diagram illustrating intra prediction according to the present invention.
[0187] The intra prediction of the current block may include: step S510 of deriving an intra prediction mode, step S520 of configuring reference samples, and / or step S530 of performing intra prediction.
[0188] In step S510, an intra-frame prediction mode of the current block may be derived. The intra-frame prediction mode of the current block may be derived using the following methods: a method using the intra-frame prediction mode of a neighboring block, a method entropy encoding / decoding the intra-frame prediction mode of the current block from a bitstream, a method using encoding parameters of a neighboring block, and / or a method using the intra-frame prediction mode of a color component. According to the method using the intra-frame prediction mode of a neighboring block, the intra-frame prediction mode of the current block may be derived using at least one of an intra-frame prediction mode derived using the intra-frame prediction mode of a neighboring block, a combination of at least one intra-frame prediction mode of a neighboring block, and at least one MPM.
[0189] In step S520 , reference samples may be configured by performing at least one of reference sample selection, reference sample padding, and reference sample filtering.
[0190] In step S530, intra-frame prediction may be performed by performing at least one of non-angular prediction, angular prediction, prediction based on position information, inter-color component prediction, and intra-frame prediction based on representative samples. When performing intra-frame prediction based on representative samples, intra-frame prediction may be performed based on at least one representative sample within a block. Prediction based on representative samples may perform at least one of partitioning the block, determining representative samples, predicting / transforming / quantizing the representative samples, and intra-frame prediction based on representative samples. In step S530, filtering of the predicted samples may also be performed.
[0191] In order to derive the intra prediction mode of the current block, at least one reconstructed neighboring block may be used. The position of the reconstructed neighboring block may be a predetermined fixed position, or may be a position derived by encoding / decoding. In the following, encoding / decoding may refer to entropy encoding and entropy decoding. For example, when the coordinates of the upper left corner sample point of the current block of size W×H are (0, 0), the neighboring block may be at least one of the blocks adjacent to the coordinates (-1, H-1), (W-1, -1), (W, -1), (-1, H) and (-1, -1) and the neighboring blocks of the above blocks. Here, W and H may represent the length or number of samples of the width (W) and height (H) of the current block.
[0192] The intra-frame prediction mode of an unavailable neighboring block may be replaced with a predetermined intra-frame prediction mode. The predetermined intra-frame prediction mode may be, for example, a DC mode, a plane mode, a vertical mode, a horizontal mode and / or a diagonal mode. For example, when a neighboring block is outside the boundary of at least one predetermined unit of a picture, a slice, a parallel block and a coding tree unit, the neighboring block is inter-predicted, or when the neighboring block is encoded in PCM mode, the corresponding block may be determined to be unavailable. Optionally, when a neighboring block is unavailable, the intra-frame prediction mode of the corresponding block is not replaced and is not used.
[0193] The intra prediction mode of the current block may be derived as a statistical value of the intra prediction modes of neighboring blocks at a predetermined position or the intra prediction modes of at least two neighboring blocks. In this specification, the statistical value may represent at least one of an average value, a maximum value, a minimum value, a mode, a median value, a weighted average value, and an interpolated value.
[0194] Optionally, the intra-frame prediction mode of the current block may be derived based on the size of the neighboring blocks. For example, the intra-frame prediction mode of a neighboring block with a relatively large size may be derived as the intra-frame prediction mode of the current block. Optionally, the statistical value may be calculated by assigning a large weight to the intra-frame prediction mode of the block with a relatively large size. Optionally, the modes assigned with relatively large weights may be predefined or signaled. For example, a relatively large weight may be assigned to at least one of a vertical mode, a horizontal mode, a diagonal mode, and a non-directional mode. The above modes may be assigned the same weight.
[0195] Alternatively, whether the intra prediction mode of the neighboring block is an angular mode may be considered. For example, when the intra prediction mode of the neighboring block is a non-angular mode, the non-angular mode may be derived as the intra prediction mode of the current block. Alternatively, the intra prediction modes of neighboring blocks other than the non-angular mode may be derived as the intra prediction mode of the current block.
[0196] To derive the intra prediction mode for the current block, one or more most probable mode (MPM) lists may be configured using the intra prediction modes of neighboring blocks. The number N of candidate modes included in the MPM list may be fixed or may be determined based on the size, shape, or both of the current block. The MPM list may be configured to exclude overlapping modes. When the number of available candidate modes is less than N, predetermined candidate modes from the available candidate modes (e.g., modes obtained by adding or subtracting a predetermined offset from an angle mode) may be added to the one or more MPM lists. Optionally, at least one of a horizontal mode, a vertical mode, a 45° angle mode, a 135° angle mode, a 225° angle mode, and a non-angle mode may be added to the MPM list. The predetermined offset may be 1, 2, 3, 4, or a positive integer. An MPM flag may be signaled to indicate whether a mode matching the intra prediction mode of the current block exists in the MPM list. When the value of the MPM flag is 1, MPM index information mpm_idx indicating the matching mode within the MPM list may be signaled. On the other hand, when the value of the MPM flag is 0, the remaining mode information rem_intra_luma_pred_mode for notifying the intra prediction mode of the current block may be signaled. When prediction based on multiple reference sample lines is performed, or when a weighted sum operation is performed to calculate a weighted sum of intra prediction values and inter prediction values, one or both of the MPM index information and the remaining mode information may not be signaled. For example, when multiple sample lines are used (i.e., mrl_index is a value other than 0), the MPM flag or the remaining mode information may not be signaled. For example, when a weighted sum operation is performed on intra prediction values and inter prediction values, the remaining mode information may not be signaled.
[0197] The MPM list can be arranged in a predetermined order based on the positions of neighboring blocks. For example, the predetermined order may be the order of blocks adjacent to the left, top, bottom left, top right, and top left of the current block. Non-angle modes can be included at any position in the MPM list. For example, non-angle modes can be added next to intra-frame prediction modes for blocks adjacent to the left and top.
[0198] The MPM list generated based on the current block can be used as the MPM list for at least one subblock included in the current block. The order between the candidate modes configuring the MPM list, the number of candidate modes included in the MPM list, etc. can be determined based on the size, shape and / or components of the current block.
[0199] Alternatively, a pattern group may be configured by selecting a portion of patterns not included in the MPM list. The configured pattern group may be used as another list. For example, a pattern group may be configured using patterns obtained by sampling at predetermined intervals after arranging patterns that are not MPM candidates, or using patterns obtained by adding n (n is an integer equal to or greater than 1) to or subtracting n from an MPM candidate pattern.
[0200] When constructing an MPM list, the MPM list can be constructed differently depending on at least one element selected from the slice type, the coding mode, and the plurality of reference sample lines. That is, the MPM list can be constructed while changing at least one element selected from the number of MPMs, the order in which the MPMs are derived, the MPM candidate mode, and the default mode. For example, the MPM list for an I slice and the MPM list for a P slice or a B slice are constructed differently. For example, the MPM list for an I slice is constructed by deriving six MPM candidate modes, and the MPM list for a P slice or a B slice is constructed by deriving three MPM candidate modes. For example, the MPM list for the case where the coding mode of the current block is an intra mode and the MPM list for the case where the coding mode of the current block is an inter mode are constructed differently. The inter mode may include a mode for performing prediction using a weighted sum of an inter prediction value and an intra prediction value. The intra prediction mode for performing intra prediction performed in the process of performing prediction using the inter mode may be derived, and the derived mode may be used to construct the MPM list. In this case, the MPM candidate modes are limited to a small number of candidate modes. The MPM candidate modes include, for example, at least one of a DC mode, a planar mode, a horizontal mode, and a vertical mode. For example, in the case of utilizing multiple reference sample lines (i.e., mrl_index has a non-zero value), the MPM list may be constructed differently. That is, the MPM candidate modes include intra-frame prediction modes that allow prediction based on multiple reference sample lines. When non-directional modes (such as DC mode and planar mode) do not allow prediction based on multiple reference sample lines, the non-directional modes are not considered as MPM candidates. In other words, the MPM list may be constructed by using only one or more directional modes.
[0201] According to another embodiment of the present invention related to a method for deriving an intra-frame prediction mode, the intra-frame prediction mode of the current block can be derived by using the intra-frame prediction modes of different color components. For example, when the current block is a chroma block, the intra-frame prediction mode of the luminance block corresponding to the chroma block can be used to derive the intra-frame prediction mode of the chroma block. As the luminance blocks corresponding to the chroma blocks, there may be one or more luminance blocks. The corresponding luminance block can be determined based on at least any one of the size, shape, and encoding parameters of the chroma block. Alternatively, the corresponding luminance block can be determined based on at least any one of the size, shape, and encoding parameters of the luminance block.
[0202] The luminance block corresponding to the chrominance block may be composed of multiple partitions. All or part of the multiple partitions may have different intra-frame prediction modes. The intra-frame prediction mode of the chrominance block may be derived based on all or part of the multiple partitions included in the corresponding luminance block. In this case, some partitions may be selectively used, wherein the partitions used are selected based on comparing the block size, shape, depth information, etc. of the chrominance block with the block size, shape, depth information, etc. of the luminance block (all or part of the multiple partitions). A partition at a position in the luminance block corresponding to a predetermined position in the chrominance block may be selectively used. The predetermined position may refer to a corner sample position (e.g., an upper left sample position) in the chrominance block or a center sample position in the chrominance block.
[0203] The method of deriving the intra prediction mode of a color component block using the intra prediction modes of different color component blocks (i.e., the inter-color component intra prediction mode) according to the present invention is not limited to the example of using the intra prediction mode of the luminance block corresponding to the chrominance block. For example, the intra prediction mode of the chrominance block can be derived by using or sharing at least any one of the MPM list and the MPM index mpm_idx of the luminance block corresponding to the chrominance block.
[0204] Figure 6 is an exemplary diagram showing the relationship between luminance blocks and chrominance blocks.
[0205] exist Figure 6 In the illustrated example, the sampling ratio of the color components is 4:2:0, and at least one of the luminance blocks A, B, C, and D corresponds to one chrominance block.
[0206] Reference Figure 6 , the intra prediction mode of one chroma block can be derived by using the intra prediction mode of the luminance block A corresponding to the sample at the upper left position (0, 0) in the chroma block or the intra prediction mode of the luminance block D corresponding to the sample at the center position (ns / 2, ns / 2) in the chroma block. The predetermined position in the chroma block is not limited to the upper left position (0, 0) or the center position (nS / 2, nS / 2). For example, the predetermined position may be the upper right position, the lower left position, and / or the lower right position. The center position of the chroma block may be (W / 2, H / 2), where W is the block width and H is the block height.
[0207] The predetermined position may be selected based on the shape of the chroma block. For example, for a square chroma block, the predetermined position may be the center sample position. For a rectangular chroma block, the predetermined position may be the top-left sample position. Alternatively, the predetermined position may be the top-left sample position in a square chroma block or the center sample position in a rectangular chroma block.
[0208] According to another embodiment, the intra prediction mode of the chroma block may be derived by using statistics of one or more intra prediction modes of a luma block having the same size as the chroma block.
[0209] exist Figure 6 In the example shown, a mode corresponding to the average value of the intra-frame prediction modes of the luminance blocks A and D or a mode corresponding to the average value of the intra-frame prediction modes of blocks A, B, C, and D within the luminance block corresponding to the size of the chrominance block is derived as the intra-frame prediction mode of the chrominance block.
[0210] When multiple intra-prediction modes for a luma block are available, all or a portion of the multiple intra-prediction modes may be selected. The selection may be performed based on a predetermined position in the chroma block or based on the size, shape, and / or depth of the chroma block, the luma block, or both. The intra-prediction mode for the chroma block may be derived using the selected intra-prediction mode for the luma block.
[0211] For example, the size of the luminance block A corresponding to the upper left sample position (0, 0) in the chrominance block and the size of the luminance block D corresponding to the center sample position (nS / 2, nS / 2) in the chrominance block are compared, and the intra-frame prediction mode of the luminance block D having the larger size can be used to derive the intra-frame prediction mode of the chrominance block.
[0212] Optionally, when the size of the luminance block corresponding to the predetermined position in the chrominance block is equal to or larger than the size of the chrominance block, the intra prediction mode of the chrominance block is derived by using the intra prediction module of the luminance block.
[0213] Optionally, when the size of the chroma block is within a predetermined range, the intra prediction mode of the chroma block is derived by using the intra prediction mode of the luminance block corresponding to the upper left sample position (0, 0) in the chroma block.
[0214] Optionally, when the size of the chroma block is within a predetermined range, the size of the luminance block corresponding to a predetermined position (0, 0) of the chroma block and the size of the luminance block arranged at another predetermined position (nS / 2, nS / 2) of the chroma block are compared, and the intra-frame prediction mode of the chroma block is derived by using the intra-frame prediction mode of the luminance block with the larger size.
[0215] The predetermined range may be derived from at least any one of information signaled via the bitstream, information on the size (and / or depth) of a block (chroma block, luminance block, or both chroma block and luminance block), and information predefined in an encoder or decoder.
[0216] Alternatively, when the chroma block has a rectangular shape, the intra prediction mode of the chroma block may be derived by using the intra prediction mode of the luma block corresponding to the center sample position (ns / 2, ns / 2) in the chroma block.
[0217] Among the multiple partitions of the luma block, a partition having the same shape as the chroma block may be used. For example, when the chroma block is square or non-square, a partition having a square or non-square shape selected from the multiple partitions of the luma block may be used.
[0218] In reference Figure 6 In the example described above, the method of deriving the intra prediction mode of the chroma block using the intra prediction mode of the luma block is also applicable to the case where the intra prediction mode of the luma block is used as the intra prediction mode of the chroma block as it is. The method of deriving the intra prediction mode of the chroma block is not limited to the method using the intra prediction mode of the corresponding luma block. For example, the intra prediction mode of the chroma block can be derived from information for deriving the intra prediction mode of the luma block, including the MPM list and the MPM index mpm_idx.
[0219] Alternatively, the MPM list for a chroma block may be constructed using the intra prediction mode of the luma block corresponding to a sample at a predetermined position in the chroma block. In this case, the mpm_idx information of the chroma block may be encoded and transmitted using a signal. The MPM list for a chroma block may be constructed in a manner similar to that for a luma block. The MPM candidates for a chroma block may include the intra prediction mode of a neighboring chroma block and / or the intra prediction mode of the luma block corresponding to the chroma block.
[0220] When the MPM flag is 0, a second MPM list including at least one intra prediction mode can be configured, and the intra prediction mode of the current block can be derived by using the second MPM index (2nd_mpm_idx). Here, a second indicator (e.g., a second MPM flag) indicating whether the intra prediction mode of the current block is included in the second MPM list can be encoded / decoded. Similar to the first MPM list, the second MPM list can be configured by using the intra prediction mode of the neighboring block. Here, the intra prediction mode included in the first MPM list may not be included in the second MPM list. The number of MPM lists is not limited to 1 or 2, and N MPM lists can be used.
[0221] When the intra prediction mode of the current block is not included in one of the multiple MPM lists, the luma component intra prediction mode of the current block can be encoded / decoded. In addition, the chroma component intra prediction mode can be derived and encoded / decoded based on the associated luma component intra prediction mode.
[0222] When the current block is partitioned into a plurality of subblocks, in order to derive the intra prediction mode of each subblock, at least one of the described methods may be applied.
[0223] The size or shape or both of the sub-block may be a predetermined size or shape or both (e.g., 4×4), or may be determined according to the size or shape or both of the current block. Alternatively, the size of the sub-block may be determined based on whether a neighboring block of the current block is partitioned, or the size of the sub-block may be determined based on an intra-prediction mode of a neighboring block of the current block. For example, the current block may be partitioned based on a boundary where the intra-prediction modes of neighboring blocks are different. Alternatively, the current block may be partitioned based on whether the neighboring block is an intra-coded block or an inter-coded block.
[0224] An indicator (e.g., NDIP_flag) indicating that the intra prediction mode of the current block is derived using the intra prediction mode of a neighboring block may be encoded / decoded. The indicator may be encoded / decoded per at least one unit of the current block and subblock. Here, the indicator may be encoded / decoded when the size of the current block or subblock corresponds to a predetermined size or a predetermined size range.
[0225] The operation of determining whether the size of the current block corresponds to the predetermined size may be performed based on the horizontal length or vertical length of the current block. For example, when the horizontal length or vertical length is a length that can be partitioned, the size of the current block is determined to correspond to the predetermined size.
[0226] Intra-frame prediction information may be signaled via at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), an adaptation parameter set (APS), a slice header, and a tile header. In the case of a predetermined block size or smaller, at least one piece of intra-frame prediction information may not be signaled. In this case, intra-frame prediction information of a previously encoded / decoded block (e.g., a higher layer block) may be used.
[0227] Reference samples for intra prediction may be configured based on the derived intra prediction mode. In the following description, the current block may refer to a prediction block or a subblock having a size / shape smaller than that of the prediction block. Reference samples may be configured using at least one reconstructed sample adjacent to the current block or using a combination of samples. Furthermore, filtering may be applied to the configured reference samples.
[0228] The number or position, or both, of the reconstruction sample lines used to configure the reference samples may vary depending on the position of the current block within the coding tree block. Each reconstruction sample on the plurality of reconstruction sample lines may be used as a reference sample as is. Alternatively, a predetermined filter may be applied to the reconstruction samples, and the reference samples may be generated by using the filtered reconstruction samples. The reconstruction samples to which the filter is applied may be included in the same reconstruction sample line or in different reconstruction sample lines.
[0229] An indicator indicating whether multiple reference sample lines are used for prediction may be signaled. For example, an indicator such as mrl_enabled_flag may be included in at least one of the SPS, PPS, and slice header for signaling. The flag may be an indicator indicating whether a single reference sample line or multiple reference sample lines are used.
[0230] When the indicator indicates that multiple reference sample lines are used, the reference sample line index is also signaled, for example, mrl_index is signaled. Thus, it can be determined which reference sample lines are used.
[0231] When the value of the indicator mrl_index is 0, the first reference sample line closest to the current block is used. On the other hand, when the value of the indicator mrl_index is 1, the second reference sample line second closest to the current block is used. When the value of the indicator mrl_index is 2, the third reference sample line third closest to the current block is used. The first to fourth reference sample lines are respectively Figure 7 The reconstructed sample point line 1 to the reconstructed sample point line 4 shown respectively correspond to each other.
[0232] The indicator mrl_index is signaled according to at least one of the intra prediction mode, MPM information, size (width and height), presence or absence of the upper boundary of the CTU, and color component of the current block. When the indicator mrl_index is not signaled, the first reference sample line adjacent to the current block is used.
[0233] For example, when the intra-frame prediction mode is a predetermined mode, the indicator mrl_index may be signaled. The intra-frame prediction mode may be at least one of the intra-frame prediction modes of each neighboring block or the intra-frame prediction mode of the current block. The predetermined mode is at least one of a non-directional prediction mode, a directional prediction mode, a vertical or horizontal mode, an even mode, and an odd mode. For example, when the intra-frame prediction mode of a neighboring block adjacent to the left boundary or the top boundary of the current block is one of the directional modes, the indicator mrl_index may be signaled. Alternatively, when the intra-frame prediction mode of the neighboring block is one of the even modes or one of the odd modes, the indicator mrl_index may be signaled.
[0234] For example, the indicator mrl_index may be signaled based on the MPM information of the current block. The MPM information includes at least one of an MPM flag, an MPM index, an MPM list, and an MPM candidate. For example, when the MPM flag indicates a match for the intra prediction mode of the current block, the indicator mrl_index may be signaled. Alternatively, when any directional prediction mode exists in the MPM candidate list or only a directional prediction mode exists in the MPM candidate list, the indicator mrl_index may be signaled. Alternatively, when any non-directional prediction mode exists in the MPM candidate list, the indicator mrl_index may be signaled. Optionally, the MPM information of the current block may be signaled differently depending on the indicator mrl_index. For example, when the indicator mrl_index has a non-zero value, at least one piece of MPM information may not be signaled. For example, when the indicator mrl_index has a non-zero value, the MPM flag or the remaining mode information may not be signaled. On the other hand, when the indicator mrl_index has a non-0 value, the MPM index may be signaled and the intra prediction mode of the current block may be derived using the MPM index. For example, when the indicator mrl_index has a non-0 value, the MPM mode may be determined without parsing the MPM flag.
[0235] For example, when the size (width or height) of the current block is within a predetermined size range, the indicator mrl_index may be signaled. For example, when the size (width or height) is greater than a predetermined size (eg, 4), the indicator mrl_index may be signaled.
[0236] For example, the indicator mrl_index may be signaled depending on whether the current block is located at the upper boundary of the CTU. For example, when the current block is located at the upper boundary of the CTU, the indicator mrl_index may not be signaled.
[0237] For example, when the color component of the current block is a luma signal, the indicator mrl_index may be signaled, and when the color component is a chroma signal, the indicator mrl_index may not be signaled.
[0238] Optionally, the indicator mrl_index indicates a reference sample line to be optionally used. For example, the first reference sample line adjacent to the current block may always be used, and the reference sample line indicated by the indicator mrl_index may be optionally used.
[0239] When multiple reference sample lines are used, whether to apply filtering is determined for each reference sample line. For example, based on the intra prediction mode and block size / shape, filtering may be applied to the first reference sample line adjacent to the current block, while filtering may not be applied to the second and subsequent reference sample lines surrounding the current block. Alternatively, filtering may be applied to only one reference sample line. For example, filtering may be applied only to the left reference sample line or the upper reference sample line. The determination of which reference sample line to filter may be based on at least one of the shape, size, and intra prediction mode of the current block. The shape of the current block may be determined based on a size comparison between the width and height of the current block or a ratio of the width and height.
[0240] The configured reference sample may be represented as ref[m, n], and the sample obtained by applying the filter to the configured reference sample may be represented as rec[m, n]. Here, m or n may be a predetermined integer value representing the position of the sample. When the position of the upper left sample in the current block is (0, 0), the position of the upper left reference sample of the current block may be set to (-1, -1).
[0241] Figure 7 It is a diagram used to describe multiple reconstructed sample point lines.
[0242] Reference samples can be constructed by selecting one or more reconstruction sample lines adjacent to the current block. Figure 7 In the , you can select one of the multiple reconstruction sample point lines to construct the reference sample point.
[0243] A specific reconstruction sample point line from among the multiple reconstruction sample point lines may be fixedly or adaptively selected, or any reconstruction sample point line may be adaptively selected to construct the reconstruction sample points.
[0244] In another embodiment, to construct a reference sample, one can Figure 7 One or more reconstruction sample point lines are selected from the multiple reconstruction sample point lines shown, and the selected reconstruction sample point lines can be combined.
[0245] For example, as shown in Equation 1, a weighted average of the reconstructed samples may be used to construct the reference samples, where the weights of the reconstructed samples vary according to the distance between the reconstructed samples and the current block.
[0246] [Equation 1]
[0247] ref[-1,-1]=(rec[-2,-1]+2×rec[-1,-1]+rec[-1,-2]+2)>>2
[0248] ref[x,-1]=(rec[x,-2]+3×rec[x,-1]+2)>>2,(x=0 to W+H-1)
[0249] ref[-1,y]=(rec[-2,y]+3×rec[-1,y]+2)>>2,(y=0 to W+H-1)
[0250] Optionally, the reference sample may be constructed using at least one of an average value, a maximum value, a minimum value, a median value and a mode value of multiple reconstructed sample points based on at least one of the distance between the current block and the corresponding reconstructed sample point and the intra prediction mode of the current block.
[0251] Alternatively, a reference sample may be constructed based on a change (amount of change) between each of the sample values of consecutive reconstructed samples. For example, the reference sample may be constructed based on at least one of determining whether the value difference between two consecutive reconstructed samples is greater than a threshold value and determining whether the values of consecutive reconstructed samples change continuously or discontinuously. For example, when the value difference between rec[-1, -1] and rec[-2, -1] is greater than a threshold value, the value of ref[-1, -1] may be determined to have the value of rec[-1, -1] or a value corresponding to a weighted average obtained by applying a predetermined weight to the value of rec[-1, -1]. For example, as the distance between the reconstructed sample and the current block decreases, each of the values of the consecutive reconstructed samples changes by n, and therefore the value of ref[-1, -1] may be expressed as "ref[-1, -1] = rec[-1, -1] - n."
[0252] In various embodiments, reference Figure 7 , two or more reconstruction sample point lines may be selected to construct reference sample points. For example, two lines including reconstruction sample point line 1 and reconstruction sample point line 2 may be fixedly selected, or four lines from reconstruction sample point line 1 to reconstruction sample point line 4 may be selected to construct reference sample points.
[0253] Optionally, two or more reconstruction sample point lines may be adaptively selected to construct reference sample points. For example, one reconstruction sample point line may be fixedly selected, and one or more reconstruction sample point lines may be adaptively selected from other reconstruction sample point lines to construct reference sample points.
[0254] The fixedly selected reconstruction sample lines may be predefined in the encoder / decoder. In the case where the fixedly selected reconstruction sample lines are predefined, information about the fixedly selected reconstruction sample lines may not be transmitted by signaling.
[0255] Information about the adaptively selected reconstruction sample line may be signaled in the form of an indicator or an index. The adaptively selected reconstruction sample line may be determined based on at least one of coding parameters of the current block or a block adjacent to the current block. For example, the adaptively selected reconstruction sample line may be determined based on at least one of the size / shape and intra-prediction mode of the current block or a block adjacent to the current block. In this case, the information required for selection may not be signaled.
[0256] The reference sample line may include one or more samples. For example, the reference sample line may include samples corresponding to a length equal to the width (i.e., horizontal dimension) or height (i.e., vertical dimension) of the current block. As another example, the reference sample line may include samples corresponding to a length twice the width or height of the current block. As another example, the reference sample line may include samples corresponding to a length equal to the sum of N samples (N is 1, 2, 3, ...) and twice the sum of the width and height of the current block. That is, the reference sample line may include reference samples corresponding to 2×(W+H)+N (where W and H are the width and height of the current block, and N is an integer of 1 or greater).
[0257] The method for constructing reference samples adjacent to the top of the current block may differ from the method for constructing reference samples adjacent to the left of the current block. For example, the number of reference sample lines located above the current block may differ from the number of reference sample lines located to the left of the current block. For example, depending on at least one of the intra prediction mode of the current block and the width or height of the current block, the number of reference sample lines adjacent to the top of the current block may be one, and the number of reference sample lines adjacent to the left of the current block may be two. For example, the length of the reference sample line located above the current block may differ from the length of the reference sample line located to the left of the current block. For example, the length of the reference sample line may vary depending on at least one of the intra prediction mode of the current block and the width or height of the current block.
[0258] Each reference point line can have a different length. Figure 7 , the lengths of the reconstructed sample point lines 2 to 4 may be longer than the length of the reconstructed sample point line 1 by the length corresponding to one or more sample points.
[0259] For each reconstructed sample line, the length of the reference sample line may be different. For example, the reconstructed sample line n may be longer or shorter than the reconstructed sample line n-1 by the length corresponding to m sample points. Figure 7 In the example shown, the reconstructed sample point line n is longer than the reconstructed sample point line n-1 by a length corresponding to one sample point.
[0260] As described above, decision information regarding whether to use only the nearest reference sample line or to use multiple reference sample lines to construct reference samples may be encoded / decoded. For example, the decision information may be encoded / decoded at at least one of the levels of a sequence, a picture, a slice, a tile, a CTU, a CU, a PU, and a TU. In addition, information regarding the availability of each of the multiple reference sample lines may be signaled at a higher level.
[0261] When the top or left boundary of the current block corresponds to a boundary of at least one of a picture, a slice, a tile, and a coding tree block (CTB), at least one of the number, position, and configuration of reconstruction sample lines used in reference sample construction may be set differently. For example, when constructing two or more reference sample lines, when the top boundary of the current block corresponds to a boundary of at least one of a picture, a tile, a slice, and a coding tree block (CTB), one reference sample line adjacent to the upper portion of the current block may be constructed. For example, when the top boundary of the current block corresponds to the top boundary of a CTU, one reference sample line may be configured; otherwise, two or more reference sample lines may be configured. In this case, since only one reference sample line at the top boundary of the CTU is used, the size of the line buffer used to store data of reference samples for the reference sample lines may be reduced.
[0262] When selecting reference samples, availability determination and reference sample filling may be performed on the block containing the reference samples to be used. For example, when the block containing the reference samples is available, the corresponding reference samples may be used. On the other hand, when the block containing the reference samples is unavailable, one or more available neighboring reference samples may be used to fill in the unavailable reference samples in the block.
[0263] When a reference sample is located outside the boundary of at least one of a picture, a tile, a slice, or a coding tree block (CTB), the reference sample may be determined to be unavailable. When the current block is encoded using constrained intra prediction (CIP), if the block including the reference sample has been encoded / decoded in inter prediction mode, the reference sample is determined to be unavailable.
[0264] Figure 8 is a diagram for describing a process of replacing unusable samples with available samples.
[0265] When it is determined that the reconstructed neighboring sample points are unavailable, the reconstructed neighboring sample points that are available can be used to replace the unavailable sample points. Figure 8 As shown in , when there are both available samples and unavailable samples, one or more unavailable samples may be replaced with one or more available samples.
[0266] The sample values of unavailable samples may be replaced with the values of available samples in a predetermined order. The available samples used to replace the unavailable samples may be available samples located adjacent to the unavailable samples. When no available samples are adjacent to the unavailable samples, the earliest or closest available sample may be used to replace the unavailable samples. The order of replacing the unavailable samples may be, for example, from the lower left to the upper right. Alternatively, the order of replacement may be from the upper right to the lower left. In particular, the order of replacement may be from the upper left corner to the upper right and / or to the lower left. Alternatively, the order of replacement may be from the upper right and / or from the lower left to the upper left corner.
[0267] For example, filling unavailable samples with the values of available samples may start from position 0, which is the lower left sample position. That is, the first four unavailable samples may be filled with the value "a", and the subsequent 13 unavailable samples may be filled with the value "b".
[0268] For example, unavailable samples may be filled with a combination of available sample values. For example, unavailable samples may be filled with the average or interpolated values of available sample points adjacent to both ends of a line of unavailable samples. That is, the first four unavailable samples may be filled with the value "a," and the next 13 unavailable samples may be filled with the average of the values "b" and "c," or the next 13 unavailable samples may be filled by interpolating the values "b" and "c."
[0269] Alternatively, the 13 unavailable samples can be padded with any intermediate value between the sample values "b" and "c" of the available samples. In this case, the unavailable samples can be padded with different corresponding values. For example, as the distance of the unavailable sample from the available sample with the value "a" decreases, the unavailable sample will be padded with a value closer to the value "a." For example, the closer the unavailable sample is to the available sample with the value "b," the closer the value used to padded the unavailable sample will be to the value "b." In other words, the value of the unavailable sample can be determined based on the distance between the unavailable sample and the available sample with the value "a" or the value "b." To replace the unavailable samples with available samples, one or more replacement methods, including the methods described above, can be adaptively used. The method for replacing the unavailable samples with available samples can be signaled as information included in the bitstream or pre-determined in the encoder / decoder. Alternatively, the replacement method can be derived based on a predetermined determination method. For example, the replacement method can be determined based on the difference between the values "a" and "b" or based on the number of unavailable samples. More specifically, the replacement method can be determined by comparing the difference between the values of two available samples with a threshold and / or by comparing the number of unavailable samples with a threshold. For example, when the difference between the values of two available samples is greater than a threshold and / or when the number of unavailable samples is greater than a threshold, the unavailable samples can be replaced with values different from each other. The selection of the method for replacing unavailable samples with available samples can be performed on a per-predetermined unit basis. For example, the replacement can be selected on a per-video, per-sequence, per-picture, per-slice, per-tile, per-coding tree unit (CTU), per-coding unit (CU), per-prediction unit (PU), per-transform unit (TU), or per-block basis. In this case, the selection of the method for replacing unavailable samples with available samples can be determined based on information signaled on a per-predetermined unit basis, or the selection of the method for replacing unavailable samples with available samples can be derived on a per-predetermined unit basis. Alternatively, the selection method for the replacement method can be predetermined in the encoder / decoder.
[0270] When the reference sample point is located at a predetermined position, filling can be performed automatically without determining whether a block including the reference sample point is available. Figure 7 , when the position (x, y) of the upper left corner sample of the current block is (0, 0), for a sample located at (x, y) (where the x coordinate or the y coordinate is equal to or greater than W+H (x=W+H or greater, or y=W+H or greater)), sample availability may not be determined, and the sample may be filled with a neighboring reference sample.
[0271] For example, the sample ref [W+H, -2] may be padded with the value of the sample ref [W+H-1, -2] without performing an availability determination on the sample ref [W+H, -2]. As another example, the sample ref [W+H, -3] may be padded with the value of the sample ref [W+H-1, -3] without performing an availability determination on the sample ref [W+H, -3]. That is, the sample located at the position (x, y: x is equal to or greater than W+H or y is equal to or greater than W+H) may be padded using the closest sample on the same sample line without performing an availability determination on the sample located at the position (x, y: x is equal to or greater than W+H or y is equal to or greater than W+H).
[0272] When the position of the upper left corner sample of the current block is (0, 0), for the sample located at the position (x, y: x is equal to or greater than W and less than W+H) among the samples located above the current block, availability determination will be performed, and then padding will be performed according to the result of the availability determination. For the sample located at the position (x, y: y is equal to or greater than H and less than W+H) among the samples located on the left side of the current block, availability determination will be performed, and padding will be performed according to the availability determination.
[0273] For example, when the position of the upper left corner sample of the current block is (0, 0), availability determination and padding may be performed for samples corresponding to rec[x, -1] (x ranges from -1 to W+H-1) and / or samples corresponding to rec[-1, y] (y ranges from 0 to H+W-1).
[0274] For padding, multiple reference sample lines may be used. For example, when padding is performed on a first reference sample line that is adjacent to (i.e., closest to) the current block, a second reference sample line that is second closest to the current block may be used. For example, padding may be performed according to Equation 2. That is, the sample values of the first reference sample line may be derived by using a weighted average of sample points selected from the first reconstructed sample line and sample points selected from the second reconstructed sample line. In this case, the selected reconstructed sample point may be a sample point located at the current sample point position or at a position adjacent to the current sample point position.
[0275] [Equation 2]
[0276] ref[x,-1]=(rec[x,-2]+3×rec[x,-1]+2)>>2, (x=0~H+W-1)
[0277] Filtering may be performed on one or more reference samples among the samples constructed as described above. Filtering may be adaptively performed based on at least one of an intra prediction mode of a current block, a size of the current block, and a shape of the current block. For example, at least one of whether filtering is to be applied, a filter type, a filter strength, and a filter coefficient may be adaptively determined.
[0278] For example, whether to apply filtering may be determined for each of a plurality of reference sample lines. For example, filtering may be applied to a first reference sample line adjacent to a current block, and may not be applied to a second reference sample line. For example, both filtered and unfiltered values may be used for the same reference sample.
[0279] For example, at least one of a 3-tap filter, a 5-tap filter, a 7-tap filter, and an N-tap filter may be selectively applied according to at least one of the intra prediction mode of the current block, the size of the current block, and the shape of the current block. In this case, N is a positive integer.
[0280] For example, filters having different shapes may be selectively used according to at least one of the intra prediction mode, size, and shape of the current block. Figure 9 Various filter shapes are shown.
[0281] The shape of the current block may be determined by comparing the width (horizontal size) of the current block with the height (vertical size) of the current block. For example, at least one of the determination of whether to apply a filter, the filter type, the filter strength, and the filter coefficients may be adaptively determined based on whether the current block is a horizontally rectangular block or a vertically rectangular block. Alternatively, at least one of the determination of whether to apply a filter, the filter type, the filter strength, and the filter coefficients may be adaptively determined based on whether the current block is a rectangular block or a square block.
[0282] Intra prediction for the current block may be performed based on the derived intra prediction mode and the constructed reference samples.
[0283] For example, non-directional intra prediction may be performed on the current block. The mode of the non-directional intra prediction may be at least one of a DC mode, a planar mode, and a LM mode.
[0284] For DC mode, prediction may be performed using the average of one or more constructed reference samples. In this case, filtering may be applied to one or more prediction samples (also referred to as predicted samples) located at the boundary of the current block. DC prediction may be adaptively performed based on at least one of the size of the current block and the shape of the current block. Furthermore, the range of reference samples used in DC mode may be determined based on at least one of the size and shape of the current block.
[0285] Figure 10 is a diagram for describing intra prediction according to the shape of a current block.
[0286] For example, when the current block is a square block, Figure 10As shown in (a) of FIG. 5 , DC prediction may be performed by using an average value of reference samples located above the current block and reference samples located on the left side of the current block.
[0287] For example, when the current block is a non-square block, the adjacent samples adjacent to the left and top of the current block may be selectively used. Figure 10 As shown in (b) of FIG. 5 , prediction may be performed using an average value of reference samples adjacent to the longer side of the left side and the upper side of the current block.
[0288] For example, when the size of the current block corresponds to a predetermined size or falls within a predetermined range, a predetermined number of reference samples are selected from reference samples located above or to the left of the current block, and prediction is performed using the average value of the selected reference samples. The predetermined size may be a fixed size N×M preset in the encoder / decoder. In this case, N and M are integers greater than 0, and N and M may be the same as or different from each other. The predetermined range may represent a threshold for selecting reference samples for predicting the current block. The threshold may be set using at least one of a minimum value and a maximum value. The minimum value and / or the maximum value may be a fixed value or values preset in the encoder / decoder, or a variable value or values encoded by the encoder and signaled.
[0289] For example, one or more average values may be used to perform prediction. When the current block is a square block or a non-square block, at least one of a first average value or a second average value may be used, wherein the first average value is the average value of reference samples located above the current block, and the second average value is the average value of reference samples located to the left of the current block. The DC prediction value of the current block may be the first average value or the second average value. Alternatively, the DC prediction value of the current block may be a weighted sum obtained by weighting the first average value and the second average value. For example, the weights of the first average value and the second average value may be the same (i.e., 1:1).
[0290] According to the above method, all DC values can be calculated using a shift operation. For example, the method can be used even when the sample length representing the width, height, or sum of the width and height of the current block is not a power of 2. The method can be applied to both luma DC prediction and chroma DC prediction. Alternatively, the method can be applied to either luma DC prediction or chroma DC prediction.
[0291] For example, when the current block is a non-square block, prediction may be performed based on the width or height of the current block. For example, the predicted value may be obtained by dividing the sum of the values of the upper reference sample and the values of the left reference sample by the length of the longer side of the current block (i.e., the width or height). In this case, the division operation using the value corresponding to the longer of the width and height may be performed by a shift operation.
[0292] For example, multiple reference sample lines can be used to perform DC prediction. Figure 10 As shown in (c), two reference sample lines can be used to perform prediction.
[0293] For example, an average value of reference samples included in two reference sample lines may be determined as a DC prediction value of the current block.
[0294] Alternatively, different weights may be applied to the reference samples of the first and second neighboring lines of the current block. For example, a weighted average of each sample in the first and second reference sample lines may be calculated by applying a weight of 3:1 to each sample in the first and second reference sample lines (i.e., (3 × first-line reference sample + second-line reference sample + 2) >> 2), and the average of these weighted averages may be determined as the DC prediction value for the current block. Alternatively, a resulting value of ((3 × first-line reference sample - second-line reference sample) >> 1) may be obtained, and the average of these values may be determined as the DC prediction value for the current block. The weights are not limited to the above example, and any weights may be used. In this case, the closer a reference sample line is to the current block, the greater the weight applied to that reference sample line. The number of reference sample lines that can be used is not limited to two, and three or more reference sample lines may be used for prediction.
[0295] For the planar mode, prediction may be performed according to a weighted sum as a function of a distance from at least one reference sample to an intra prediction target sample located in the current block.
[0296] Filtering may be performed on reference samples of the current block or predicted samples of the current block (i.e., predicted samples). For example, after filtering is applied to the reference samples, planar prediction may be performed, and then filtering may be performed on one or more predicted samples. Among the predicted samples, filtering may be performed on samples located in one, two, or N sample lines at the top or left boundary of the current block.
[0297] To perform planar prediction, a weighted sum of one or more reference samples may be used. Figure 10 As shown in (d) of FIG, 5 reference samples can be used. For example, to generate a prediction sample for the target position [x, y], reference samples r[-1, -1], r[x, -1], r[-1, y], r[W, -1], and r[-1, H] can be used. In this case, W and H are the width and height of the current block, respectively. For example, the prediction sample pred[x, y] can be generated using Equation 3. In Equation 3, a, b, c, d, and e represent weights. N can be log2(a+b+c+d+e).
[0298] [Equation 3]
[0299] pred[x, y]=(a×r[-1,-1]+b×r[x,-1]+c×r[-1, y]+d×r[W,-1]+e×r[-1, H])>>N
[0300] As another example, planar prediction can be performed using multiple reference sample lines. For example, planar prediction can be performed using a weighted sum of two reference sample lines. As another example, planar prediction can be performed using a weighted sum of reference samples in the two reference sample lines. In this case, the reference sample selected from the second reference sample line can be a sample adjacent to the reference sample selected from the first reference sample line. That is, when a reference sample at position (-1, -1) is selected, a reference sample at position (-2, -2) can be selected. Planar prediction can be performed by calculating a weighted sum of the selected reference samples, and in this case, the same weight as that used for DC prediction can be used.
[0301] The directional prediction mode refers to at least one of a horizontal mode, a vertical mode, and an angular mode having a predetermined angle.
[0302] In horizontal mode or vertical mode, prediction is performed using one or more reference samples arranged along a straight line (i.e., horizontally or vertically). Multiple reference sample lines may be used. For example, when two reference sample lines are used, prediction may be performed using two reference samples arranged in a horizontal line or a vertical line. Similarly, when N reference sample lines are used, N reference samples in a horizontal line or a vertical line may be used.
[0303] For vertical mode, statistics of a first reference sample (e.g., r[x, -1]) on a first reference sample line and a second reference sample (e.g., r[x, -2]) on a second reference sample line may be used to perform directional prediction.
[0304] For example, the prediction value for the vertical mode may be determined by calculating a value resulting from (3×r[x, -1] + r[x, -2] + 2) >> 2. Alternatively, the prediction value for the vertical mode may be determined by calculating a value resulting from (3×r[x, -1] - r[x, -2] + 1) >> 1. In another alternative, the prediction value for the vertical mode may be determined by calculating a value resulting from (r[x, -1] + r[x, -2] + 1) >> 1.
[0305] For example, the variation between the values of each sample point on a vertical line may be considered. For example, the predicted value for the vertical mode may be determined by calculating the result value of (r[x, -1] + (r[x, -1] - r[x, -2]) >> 1). In this case, N may be an integer equal to or greater than 1. A fixed value may be used as N. Alternatively, N may increase as the y coordinate of the prediction target sample point increases. For example, N = y + 1.
[0306] Even for the horizontal mode, one or more methods used for the vertical mode may be used.
[0307] For angle modes at specific angles, prediction can be performed using one or more reference samples arranged in an oblique direction from the intra-frame prediction target sample of the current block, or one or more samples adjacent to the reference sample located in the oblique direction. In this case, a total of N reference samples can be used, where N can be 2, 3, 4, 5, or 6. Prediction can also be performed by applying at least one of N-tap filters to the N reference samples. Examples of N-tap filters include 2-tap filters, 3-tap filters, 4-tap filters, 5-tap filters, and 6-tap filters. In this case, at least one of the reference samples can be located above the current block, while the remaining reference samples can be located to the left of the current block. The reference samples located above the current block (or the reference samples located to the left of the current block) can be located on the same line or on different lines.
[0308] According to another embodiment, intra-frame prediction can be performed based on position information. In this case, the position information can be encoded / decoded, and the reconstructed sample block located at the above position can be derived as the intra-frame prediction block of the current block. Optionally, the decoder can search for a block similar to the current block, and the found block can be derived as the intra-frame prediction block of the current block. The search for similar blocks can be performed in the encoder or decoder. The range in which the search is performed (search range) can be limited to a predetermined range. For example, the search range can be limited to the reconstructed sample blocks within the picture including the current block. Optionally, the search range can be limited to the CTU including the current block or to a predetermined CU. That is, intra-frame prediction based on position information can be performed by searching for blocks similar to the current block among the reconstructed samples within the CTU. The search can be performed using a template. For example, one or more reconstructed samples adjacent to the current block are used as a template, and samples similar to the template are searched in the CTU.
[0309] When a CTU consists only of intra coding modes or when the luminance block and the chrominance block have different partition structures, intra prediction based on position information can be performed. For example, for an inter prediction available slice (e.g., a P or B slice), information indicating that the current CTU consists only of intra coding modes can be transmitted by a signal. In this case, when the information indicates that the current CTU consists only of intra coding modes, intra prediction based on position information can be performed. Alternatively, when the luminance block and the chrominance block in the current CTU have different partition structures (e.g., when the value of dual_tree or separate_tree is 1), intra prediction based on position information may be available. On the other hand, when a CTU includes intra-coded blocks and inter-coded blocks or when the luminance block and the chrominance block have the same partition structure, intra prediction based on position information may not be available.
[0310] According to another embodiment, intra prediction is performed between color components. For example, a chrominance component may be intra predicted from the corresponding reconstructed luma component of the current block. Alternatively, a chrominance component Cr may be intra predicted from the corresponding reconstructed chrominance component Cb of the current block.
[0311] Inter-color component intra-frame prediction includes a color component block reconstruction step, a prediction parameter derivation step, and / or an inter-color component prediction execution step. The term "color component" may refer to at least any one of a luminance signal, a chrominance signal, red, green, blue, Y, Cb, and Cr. Prediction of a first color component may be performed using at least any one of a second color component, a third color component, and a fourth color component. The signal of the color component used for prediction may include at least any one of an original signal, a reconstructed signal, a residual signal, and a prediction signal.
[0312] When intra prediction is performed on the second color component target block, samples of the first color component corresponding block corresponding to the second color component target block, samples of neighboring blocks of the first color component corresponding block, or both samples of the first color component corresponding block corresponding to the second color component target block and samples of neighboring blocks of the first color component corresponding block may be used. For example, when intra prediction is performed on the chrominance component block Cb or Cr, the reconstructed luminance component block Y corresponding to the chrominance component block Cb or Cr may be used.
[0313] When the chroma component is predicted based on the luma component, the prediction may be performed according to Equation 4.
[0314] [Equation 4]
[0315] Pred C (i, j) = α·rec L '(i, j)+β
[0316] In Equation 4, Pred C(i, j) represents the predicted chroma sample of the current block, and rec L (i, j) represents the reconstructed luminance sample of the current block. L '(i, j) may be the downsampled reconstructed luma sample. Parameters α and β may be derived by minimizing the regression error between the reconstructed neighboring luma samples and the reconstructed neighboring chroma samples around the current block.
[0317] There are two modes for predicting chrominance components using luma components. These two modes may include a single model mode and a multi-model mode. When predicting chrominance components from the luma component for the current block, the single model mode may use one linear model. The multi-model mode may use two linear models.
[0318] In multi-model mode, samples adjacent to the current block (i.e., adjacent luma samples and adjacent chroma samples) may be classified into two groups. That is, parameters α and β may be derived for each of the two groups. Furthermore, luma samples of the current block may be classified according to the same rules used to classify luma samples adjacent to the current block.
[0319] For example, a threshold value for classifying adjacent samples into two groups may be calculated. The threshold value may be calculated using the average value of the reconstructed adjacent luma samples. However, calculation of the threshold value is not limited thereto. In addition to the average value, at least one of various statistical values recognized in this specification may be used. When the value of an adjacent sample is greater than the threshold value, the adjacent sample may be classified into the first group. Otherwise, the adjacent sample may be classified into the second group.
[0320] Although the above embodiment describes the multi-model mode using two linear models, the present invention is not limited thereto and can cover other cases using two or more linear models. When N linear models are used, the samples can be classified into N groups. To this end, N-1 thresholds can be calculated.
[0321] As described above, when predicting chrominance components from luma components, a linear model may be used. In this case, the linear model may include a simple linear model (hereinafter referred to as "LM1"), a complex linear model (hereinafter referred to as "LM2"), and a complex filter linear model (hereinafter referred to as "LM3"). The parameters of the above models may be derived by minimizing the regression error between the reconstructed luma samples around the current block and the corresponding reconstructed chrominance samples around the current block.
[0322] Figure 11 It is a diagram for describing “neighboring samples of the current block” (hereinafter referred to as “neighboring data set”) used to derive parameters of the model.
[0323] The adjacent data set used to derive the parameters of LM1 can be composed of a pair of sample points, which are included in Figure 11 The adjacent data set used to derive the parameters of LM2 and LM3 can be composed of a pair of samples, which are included in Figure 11 The luminance samples and the chrominance samples in each of the line area B, the line area C, the line area E, and the line area F shown in FIG.
[0324] However, the neighboring data sets are not limited to the above examples. For example, to cover various linear relationships between luma samples and chroma samples in the current block, N neighboring data sets may be used for each mode. For example, N may be an integer of 2 or greater, particularly 3.
[0325] The parameters of the linear model can be calculated using both the upper template and the left template. Optionally, there are two LM modes (LM_A mode and LM_L mode), and the upper template and the left template can be used in LM_A mode and LM_L mode, respectively. That is, in LM_A mode, only the upper template can be used to obtain the linear model parameters. When the position of the upper left corner sample point of the current block is (0, 0), the upper template can be extended to a range from (0, -n) to (W+H-1, -n). In this case, n is an integer equal to or greater than 1. That is, in LM_L mode, only the left template can be used to obtain the linear model parameters. The left template can be extended to a range from (-n, 0) to (-n, H+W-1). In this case, n is an integer equal to or greater than 1.
[0326] The parameters of the linear model can be derived using powers of two. When the current chroma block is a non-square block, the samples used to derive the parameters of the linear model can be determined based on the number of samples on the shorter of the horizontal and vertical sides of the current block. According to one embodiment, when the size of the current block is n×m (where n>m), for example, m of the n adjacent samples adjacent to the top boundary of the current block can be selected by uniformly performing subsampling. In this case, the number of samples used to derive the parameters of the linear model can be 2m. As another example, when the size of the current block is n×m (where n>m), m of the n adjacent samples adjacent to the top boundary of the current block can be omitted. For example, among the n samples, the m samples farthest from the shorter of the horizontal and vertical sides of the current block can be omitted. In this case, the number of samples used to derive the parameters of the linear model can be n (nm samples adjacent to the top boundary of the current block + m samples adjacent to the left boundary of the current block).
[0327] Alternatively, when intra prediction is performed on the chrominance component block Cr, the chrominance component block Cb may be used. Alternatively, when intra prediction is performed on the fourth color component block, at least one of the first color component block, the second color component block, and the third color component block, all of which correspond to the fourth color component block, may be used.
[0328] Whether to perform inter-color component intra-frame prediction can be determined based on at least any one of the size and shape of the current target block. For example, when the size of the target block is equal to the size of the coding tree unit (CTU), is larger than a predetermined size, or is within a predetermined size range, inter-color component intra-frame prediction of the target block can be performed. Alternatively, when the shape of the target block is a predetermined shape, inter-color component intra-frame prediction of the target block can be performed. The predetermined shape can be a square. In this case, when the target block has a rectangular shape, inter-color component intra-frame prediction of the target block may not be performed. In addition, when the predetermined shape is a rectangular shape, the above embodiment operates inversely.
[0329] Alternatively, whether to perform inter-color component intra prediction on the prediction target block may be determined based on coding parameters of at least one block selected from a corresponding block corresponding to the prediction target block and a neighboring block of the corresponding block. For example, when the corresponding block has been predicted using an intra prediction method in a constrained intra prediction (CIP) environment, inter-color component intra prediction on the prediction target block may not be performed. Alternatively, when the intra prediction mode of the corresponding block is a predetermined mode, inter-color component intra prediction on the prediction target block may be performed. Further, whether to perform inter-color component intra prediction may be determined based on at least one of CBF information of the corresponding block and CBF information of neighboring blocks of the corresponding block. Coding parameters are not limited to the prediction mode of the block, but various parameters that can be used for encoding / decoding may be used.
[0330] The color component block reconstruction steps will be described below.
[0331] When predicting a second color component block by using a first color component block, the first color component block can be reconstructed. For example, when an image has a YCbCr color space and the sampling rate of the color components is one of 4:4:4, 4:2:2, and 4:2:0, the block sizes of the color components may be different from each other. Therefore, when predicting a second color component block using a first color component block having a size different from that of the second color component block, the first color component block can be reconstructed so that the block size of the first color component and the block size of the second color component are equal. The reconstructed block may include at least any one of the samples in the first color component block as the corresponding block and the samples in the adjacent blocks of the first color component block. Figure 12 is an exemplary diagram illustrating a process of reconstructing a color component block.
[0332] exist Figure 12In (a), p1[x, y] represents the sample point at position (x, y) in the first color component block. Figure 12 In (b), p1'[x, y] represents a sample at a position (x, y) in a reconstructed block generated by reconstructing the first color component block.
[0333] When the size of the first color component block is larger than the size of the second color component block, the first color component block is downsampled to have a size equal to the size of the second color component block. Downsampling can be performed by applying an N (N is an integer equal to or greater than 1) tap filter to one or more samples. For downsampling, at least any one of Equations 5 to 9 can be used. In the case where any of the various downsampling methods is selectively used, the encoder can select a downsampling method as the predetermined downsampling method. For example, the encoder can select the downsampling method with the best effect. The selected downsampling method is encoded and transmitted to the decoder using a signal. The information transmitted using the signal can be index information indicating the downsampling method.
[0334] [Equation 5]
[0335] p1'[x, y]=(p1[2x, 2y]+p1[2x, 2y+1]+1)>>1
[0336] [Equation 6]
[0337] p1'[x, y]=(p1[2x+1, 2y]+p1[2x+1, 2y+1]+1)>>1
[0338] [Equation 7]
[0339] p1'[x, y]=(p1[2x-1, 2y]+2×p1[2x, 2y]+p1[2x+1, 2y]+2)>>2
[0340] [Equation 8]
[0341] p1'[x, y]=(p1[2x-1, 2y+1]+2×p1[2x, 2y+1]+p1[2x+1, 2y+1]+2)>>2
[0342] [Equation 9]
[0343] p1'[x, y]=(p1[2x-1, 2y]+2×p1[2x, 2y]+p1[2x+1, 2y]+p1[2x-1, 2y+1]+2×p1[2x, 2y+1]+p1[2x+1, 2y+1]+4)>>3
[0344] The downsampling method performed on two or more samples is not limited to any of the examples in Equations 5 to 9. For example, two or more samples used to calculate the downsampled value p1'[x, y] may be selected from a sample group consisting of a sample p1[2x, 2y] and its neighboring samples. The neighboring samples may be selected from p1[2x-1, 2y-1], p[2x-1, 2y], p1[2x-1, 2y+1], p1[2x, 2y-1], p1[2x, 2y+1], p1[2x+1, 2y-1], p1[2x+1, 2y], and p1[2x+1, 2y+1]. Downsampling may be performed by calculating an average or weighted average of two or more samples.
[0345] Alternatively, downsampling may be performed in a manner of selecting a specific sample point from among one or more sample points. In this case, at least any one of the following equations (Equation 10 to Equation 13) may be used for downsampling.
[0346] [Equation 10]
[0347] p1'[x, y] = p1[2x, 2y]
[0348] [Equation 11]
[0349] p1'[x,y]=p1[2x,2y+1]
[0350] [Equation 12]
[0351] p1'[x, y]=p1[2x+1, 2y]
[0352] [Equation 13]
[0353] p1'[x, y] = p1[2x+1, 2y+1]
[0354] When the size of the first color component block is smaller than the size of the second color component block, the first color component block is upsampled for reconstruction so that the sizes of the first color component block and the second color component block are equal. In this case, upsampling is performed according to Formula 14.
[0355] [Equation 14]
[0356] p1'[2x, 2y]=p1[x, y],
[0357] p1'[2x+1, 2y]=(p1[x, y]+p1[x+1, y]+1)>>1,
[0358] p1'[2x, 2y+1]=(p1[x, y]+p1[x, y+1]+1)>>1,
[0359] p1'[2x+1, 2y+1]=(p1[x+1, y]+p1[x, y+1]+1)>>1
[0360] During the reconstruction process, a filter may be applied to one or more samples. For example, a filter may be applied to one or more samples included in at least any one of a first color component block (i.e., a corresponding block), a neighboring block of the corresponding block, a second color component block (i.e., a target block), and a neighboring block of the target block.
[0361] In the reference sample reconstruction step described above, an indicator corresponding to a predetermined reference sample line among the plurality of reference sample lines may be signaled. In this case, during the reconstruction process, reconstruction is performed using the predetermined reference sample line corresponding to the signaled indicator. For example, when the value of the indicator mrl_index is 0, the reconstruction process is performed using the first and second reference sample lines adjacent to the block corresponding to the first color component. Alternatively, when the value of the indicator mrl_index is 1, the reconstruction process is performed using the second and third reference sample lines adjacent to the block corresponding to the first color component. Alternatively, when the value of the indicator mrl_index is 3, the reconstruction process is performed using the third and fourth reference sample lines adjacent to the block corresponding to the first color component. The reference sample line indicated by the indicator mrl_index may be used for the target block of the second color component.
[0362] In the reconstruction process, when the boundary of the second color component block (target block) or the boundary of the first color component block (corresponding block) is the boundary of a predetermined area, reference samples for reconstruction may be selected differently. In this case, the number of reference sample lines on the upper side may be different from the number of reference sample lines on the left side. The predetermined area may be at least any one of a picture, a slice, a tile, a CTU, and a CU.
[0363] For example, when the upper boundary of the block corresponding to the first color component is the boundary of the predetermined region, the reference samples on the upper side may not be used for reconstruction, and only the reference samples on the left side may be used for reconstruction. When the left boundary of the block corresponding to the first color component is the boundary of the predetermined region, the reference samples on the left side may not be used for reconstruction, and only the reference samples on the upper side may be used for reconstruction. Alternatively, both N reference sample lines on the upper side and M reference sample lines on the left side may be used for reconstruction, where N may be less than M. For example, when the upper boundary corresponds to the boundary of the predetermined region, N may be 1. Alternatively, when the left boundary corresponds to the boundary of the predetermined region, M may be 1.
[0364] Alternatively, reconstruction may be performed by using N reference sample lines on the upper side and M reference sample lines on the left side of the first color component corresponding block, regardless of whether the boundary of the predetermined area is the upper boundary or the left boundary of the first color component block.
[0365] Figure 13 is a diagram illustrating an embodiment in which reconstruction is performed by using a plurality of upper reference sample lines and / or a plurality of left reference sample lines.
[0366] like Figure 13 As shown in (a) of FIG. 5 , reconstruction can be performed using four upper reference sample point lines and four left reference sample point lines.
[0367] For example, when the upper boundary or the left boundary of the first color component corresponding block is the boundary of the predetermined area, the number of upper reference sample lines and the number of left reference sample lines used for reconstruction may be different from each other. Figure 13 (b) to Figure 13 As shown in (d), any of the following combinations can be used for reconstruction: two upper reference sample point lines and four left reference sample point lines; one upper reference sample point line and three left reference sample point lines; one upper reference sample point line and two left reference sample point lines.
[0368] The number of reference sample lines used for reconstruction is not limited to the above combination. That is, N upper reference sample lines and M left reference sample lines may be used, where N and M are equal to or different from each other. When both the upper boundary and the left boundary of the corresponding block correspond to the boundary of the predetermined area, N and M may be equal to each other. That is, N and M may both be 1. Alternatively, N may be set to be smaller than M under the same conditions. This is because the upper reference sample lines require more resources (memory) than the left reference sample lines.
[0369] Alternatively, as Figure 13 As shown in (e), one or more reference samples within a region whose vertical and horizontal lengths are not greater than the vertical and horizontal lengths of the corresponding block of the first color component may be used for reconstruction.
[0370] When performing reconstruction processing, the reference sample of the first color component corresponding block can be set differently according to any one of the block size, block shape and encoding parameters of at least any one block selected from the first color component corresponding block, the neighboring block of the first color component corresponding block, the second color component target block and the neighboring block of the second color component target block.
[0371] For example, among the samples in the block corresponding to the first color component and its neighboring blocks, the samples in the block whose coding mode is inter-frame coding mode are not used, and only the samples in the block whose coding mode is intra-frame coding mode are used for reconstruction.
[0372] Figure 14 is an exemplary diagram showing reference samples used for reconstruction according to the intra prediction mode or coding parameters of the corresponding block. The reconstruction of the reference samples of the first color component block may be performed differently according to the intra prediction mode of the first color component corresponding block. For example, Figure 14 As shown in (a) of FIG. 5 , when the intra prediction mode of the corresponding block is a non-angular mode such as a DC mode and a planar mode or an angular mode in which both the upper reference sample and the left reference sample are used, at least one sample group of the upper reference sample and the left reference sample is used for reconstruction. Optionally, as Figure 14 As shown in (b) of FIG5 , when the intra prediction mode of the corresponding block is an angle mode in which both the upper reference sample and the upper right reference sample of the corresponding block are used, reconstruction of the corresponding block is performed using at least one sample group of the upper reference sample and the upper right reference sample. Figure 14 As shown in (c), when the intra prediction mode of the corresponding block is an angle mode in which both the left reference sample and the lower left reference sample are used, the corresponding block can be reconstructed using at least any one sample group of the left reference sample and the lower left reference sample.
[0373] Optionally, the reconstruction of the reference samples of the first color component corresponding block is performed differently according to the quantization parameter of at least one of the first color component corresponding block and its neighboring blocks. Figure 14 As shown in (d), the reference samples in the upper block with a relatively small quantization parameter value QP in the neighboring block are used to perform reconstruction.
[0374] Optionally, when the second color component target block has a rectangular shape, reference samples arranged around the first color component corresponding block having a square shape are used for reconstruction.
[0375] Alternatively, when the second color component target block is divided into two sub-blocks (e.g., two 16×8-sized sub-blocks) and when the first color component corresponding block is a 32×16-sized block, reference samples arranged around the 32×32-sized block are used to reconstruct the corresponding block. In this case, reference samples surrounding the reconstructed 32×32-sized block can be shared as reference samples of the first color component block corresponding to the second 16×8-sized sub-block arranged on the lower side of the two sub-blocks of the partitioned second color component target block.
[0376] In the following, the prediction parameter derivation steps will be described.
[0377] Prediction parameters may be derived using at least any one of a reference sample of the reconstructed first color component corresponding block and a reference sample of the second color component prediction target block. Hereinafter, the terms "first color component" and "first color component block" may refer to the reconstructed first color component and the reconstructed first color component block, respectively.
[0378] Figure 15 is a diagram illustrating an exemplary reconstructed first color component corresponding block when the second color component prediction target block is a 4×4 block. In this case, the number of reference sample lines may be N.
[0379] like Figure 15 As shown in (a), the prediction parameters may be derived using reference samples arranged on the upper and left sides of the reconstructed first color component corresponding block or the second color component prediction target block.
[0380] For example, the prediction parameters may be derived by adaptively using the reconstructed reference samples of the first color component based on the intra prediction mode of the block corresponding to the first color component. In this case, the reference samples of the second color component may be adaptively used based on the intra prediction mode of the block corresponding to the first color component.
[0381] As shown in FIG15( a ), when the intra prediction mode of the first color component corresponding block is a non-angular mode such as a DC mode or a planar mode, or an angular mode in which both the upper reference sample and the left reference sample are used, the reference samples on the upper and left sides of the first color component corresponding block can be used.
[0382] like Figure 15 (b) or Figure 15 As shown in (c), when the intra prediction mode of the first color component corresponding block is the angle mode in which the upper reference sample is used, the reference sample on the upper side of the first color component corresponding block may be used.
[0383] like Figure 15 (d) or Figure 15 As shown in (e), when the intra prediction mode of the first color component corresponding block is an angle mode in which the left reference sample is used, the reference sample on the left side of the first color component corresponding block may be used.
[0384] Optionally, when the intra prediction mode of the block corresponding to the first color component is the angular mode, the reference samples used in each prediction mode may be used as the reference samples of the first color component. For example, when the intra prediction mode is the vertical mode, the reference samples may be used. Figure 15 When the intra prediction mode is horizontal mode, the reference sample shown in (b) can be used. Figure 15 When the intra prediction mode is the upper right diagonal mode, the reference sample shown in (d) can be used. Figure 15 When the intra prediction mode is the lower left diagonal mode, the reference sample shown in (c) can be used. Figure 15 When the intra prediction mode is between the vertical mode and the upper right diagonal mode, the Figure 15 When the intra prediction mode is the 45° diagonal angle mode, the reference sample shown in (f) can be used. Figure 15The reference samples selected differently for each intra prediction mode are stored in a lookup table format for easy use.
[0385] The prediction parameters may be derived by adaptively using reference samples of the first color component or the second color component according to the size and / or shape of the first color component block and / or the second color component block.
[0386] For example, when the size of the second color component target block is 64×64, 32, 16, or 8 reference samples can be used among the reference samples on the upper side or the left side of the first color component block or the second color component block. As described above, when the size of the second color component target block is a predetermined size, the reference samples of the first color component block or the second color component block can be adaptively used. The predetermined size is not limited to 64×64, but can be a size signaled through the bitstream, or can be a size derived based on coding parameters of the current block or its neighboring blocks.
[0387] Alternatively, when the second color component target block has a rectangular shape, reference samples adjacent to a longer side (vertical side or horizontal side) of the second color component target block may be used. For example, when the target block has a block size of 32×8, reference samples on the upper side of the first color component or second color component block may be used.
[0388] Alternatively, when the second color component target block has a rectangular shape, reference samples around the square block may be used. For example, when the target block is a 32×8 block, reference samples around a 32×32 block may be used.
[0389] Prediction parameters may be derived using reference samples around the reconstructed first color component block and reference samples around the reconstructed second color component block. Prediction parameters may be derived based on any one of factors including correlation, variation, average value, and distribution of color components. In this case, any one of the least squares (LS) and least mean squares (LMS) methods may be used.
[0390] When the prediction parameters are derived using the LMS method, the prediction parameters may be a and b, α and β, or both a and b and α and β. The prediction parameters that minimize the error between the reference sample of the first color component and the reference sample of the second color component can be derived using Equation 15.
[0391] [Equation 15]
[0392]
[0393] In Equation 15, p2 n represents the reference sample of the second color component, and p1'n represents the reference sample of the reconstructed first color component, N is the number of reference samples arranged in the vertical direction or the horizontal direction used, and a and b represent prediction parameters.
[0394] In this case, the correlation between the reference samples can be calculated by Equation 16.
[0395] [Equation 16]
[0396] k=Max(0,BitDepth+log2(N)-15)
[0397]
[0398]
[0399]
[0400]
[0401] In Equation 16, BitDepth represents a bit depth, p1′ represents a sample of the reconstructed first color component, and p2 represents a sample of the second color component. Figure 16 is a diagram showing samples of a first color component and samples of a second color component.
[0402] When there is an area without reference samples in the process of deriving prediction parameters, the prediction parameters may be derived using only existing samples.
[0403] One or more prediction parameters may be derived. For example, a first prediction parameter may be derived from reference points having values that meet a specific requirement among the reference points used to derive the prediction parameters. Alternatively, a second prediction parameter may be derived from reference points having values that do not meet a specific requirement. The specific requirement may be a condition that the value of the reference point is less than a statistical value (e.g., an average value).
[0404] According to another embodiment of the present invention, basic prediction parameters (default parameters) can be used instead of deriving prediction parameters from the values of reference samples. Default parameters can be predefined in the encoder and decoder. For example, prediction parameters a and b can be 1 and 0, respectively.
[0405] Optionally, when the prediction parameters are derived from the reference samples, the derived prediction parameters may be encoded and decoded.
[0406] When inter-color component prediction is performed between color components Y, Cb, and Cr, prediction parameters for predicting color components Cb and Cr may be derived from color component Y. Prediction parameters for predicting color component Cr may be derived from color component Cb. Alternatively, as prediction parameters for predicting color component Cr, prediction parameters for predicting color component Cb that have been derived from color component Y may be used as they are, rather than deriving new prediction parameters for predicting color component Cr.
[0407] Hereinafter, inter-color component prediction execution steps will be described.
[0408] As described above, after the prediction parameters are derived, inter-color component intra prediction may be performed using at least any one of the derived prediction parameters.
[0409] For example, according to Equation 17, prediction of the second color component target block may be performed by applying the derived prediction parameter to the reconstructed signal of the reconstructed first color component.
[0410] [Equation 17]
[0411] p2[x,y]=a×p1′[x,y]+b
[0412] In Equation 17, p2[x,y] represents a prediction block of the second color component target block, and p1'[x,y] represents a first color component block or a reconstructed first color component block.
[0413] Alternatively, according to Equation 18, prediction of the second color component target block may be performed by applying the derived prediction parameter to the reconstructed residual signal of the first color component.
[0414] [Equation 18]
[0415] p2[x,y]=p2_pred[x,y]+a×p1′_residual[x,y]
[0416] In Equation 18, p1′_residual represents a residual signal of a first color component, and p2_pred represents a prediction signal obtained by performing intra prediction on a second color component target block.
[0417] When the number of derived prediction parameters is one or more, the one or more prediction parameters may be applied to the reconstructed samples of the first color component. For example, when the reconstructed samples of the first color component meet a specific requirement, inter-color component intra-frame prediction may be performed by applying a first prediction parameter derived from a reference sample that meets the specific requirement. Meanwhile, when the reconstructed samples of the first color component do not meet the specific requirement, inter-color component intra-frame prediction may be performed by applying a second prediction parameter derived from a reference sample that does not meet the specific requirement. The specific requirement refers to a condition that a value of the reference sample is less than a statistical value (e.g., an average value) of the reference samples of the first color component.
[0418] An inter-color component prediction method may be used in inter-frame prediction mode. For example, when inter-frame prediction is performed on the current block, inter-frame prediction is performed on the first color component, and inter-color component prediction or a combination of inter-frame prediction and inter-color component prediction may be performed on the second color component. For example, the first color component may be a luma component, and the second color component may be a chroma component.
[0419] Inter-color component prediction can be performed using prediction samples or reconstructed samples of the luma component. For example, after performing inter-frame prediction on the luma component, prediction for the color component can be performed by applying inter-color component prediction parameters to prediction samples obtained from the inter-frame prediction of the luma component. Here, the prediction samples refer to samples that have been subjected to at least one of motion compensation, motion refinement, overlapped block motion compensation (OBMC), and bidirectional optical flow (BIO).
[0420] In addition, inter-color component prediction can be adaptively performed based on the encoding parameters of the first color component. For example, whether to perform inter-color component prediction can be determined based on the CBF information of the first color component. The CBF information can be information indicating whether a residual signal exists. That is, when the CBF of the first color component is 1, inter-color component prediction can be performed on the second color component. When the CBF of the first color component is 0, inter-color component prediction may not be performed on the second color component, and inter-frame prediction may be performed on the second color component. Optionally, a flag indicating whether to perform inter-color component prediction can be transmitted using a signal.
[0421] When the encoding parameters of the first color component meet a predetermined condition, a flag indicating whether to perform inter-color component prediction may be transmitted by a signal. For example, when the CBF of the first color component is 1, the flag may be transmitted by a signal to determine whether to perform inter-color component prediction.
[0422] When performing inter-color component prediction on the second color component, an inter-frame motion prediction or compensation value for the second color component may be used. For example, inter-frame prediction information for the first color component may be used to perform inter-frame motion prediction or compensation for the second color component. Alternatively, prediction may be performed by calculating a weighted sum of an inter-frame motion compensation value and an inter-color component prediction value for the second color component.
[0423] According to another embodiment of the present invention, intra prediction based on representative samples may be performed. When performing intra prediction based on representative samples, prediction may be performed using at least one of the following: block partitioning, representative sample determination, representative sample prediction, transformation and quantization, intra prediction using representative samples, and reconstruction.
[0424] The current block may be divided into one or more sub-blocks. The size of the current block and / or sub-block is represented by W×H, where W and H are predetermined integers. For example, the size of the current block and / or sub-block may be any one selected from CTU, CU, signaling unit (SU), QTMax, QTMin, BTMax, BTMin, 4x4, 8x8, 16×16, 32×32, 64×64, 128×128, 4×8, 8×16, 16×8, 32×64, 32×8, 4×32, etc. In this case, QTMax and QTMin respectively represent the maximum size and minimum size of a block that can be generated by quadtree partitioning. Among these sizes, BTMax and BTMin respectively represent the maximum size and minimum size of a block that can be generated by binary tree partitioning.
[0425] The size of the sub-block varies depending on the size of the current block. For example, the size of the sub-block is equal to the size (width or height) of the current block divided by N. In this case, N may be a positive integer, and more specifically, may be at least one of 2, 4, 8, 16, 32, and 64. For example, when the size of the current block is 32×32 and each of the width and height of the current block is divided by 4 (i.e., N is 4), the size of the sub-block may be 8×8.
[0426] The size of a subblock can be determined based on the coding parameters of the neighboring blocks. For example, the size of a subblock can be determined based on whether the neighboring block is intra-coded or inter-coded. Alternatively, the size of a subblock can be determined based on the intra prediction mode of the neighboring block. Alternatively, the size of a subblock can be determined based on whether the neighboring block is partitioned.
[0427] At least one of the divisible size of the current block, the size of the sub-block, and a value obtained by dividing the size of the current block by N may be a predetermined fixed size or a fixed value.
[0428] For example, when the divisible size of the current block is a fixed size of 16×16, in case the size of the current block is 16×16, the current block may be divided into sub-blocks.
[0429] For example, when the size of the sub-block is fixed to 4×4, the size of the sub-block is required to always be 4×4 regardless of the size of the current block.
[0430] For example, assuming that the divisible size of the current block is CTU and the value of N is 4, when the size of the current block corresponds to CTU, the current block can be divided into sub-blocks in a manner such that each of the width and height of the current block is divided by 4.
[0431] One or more sub-blocks in a sub-block may be divided into smaller sub-blocks. For example, when the size of the current block is 32×32 and the size of the sub-block is 16×16, the sub-block may be divided into smaller sub-blocks of 8×8, 4×4, 16×8, 4×16, etc.
[0432] At least one of the divisible size of the current block, the size of the sub-block, and the value of the size of the current block divided by N can be determined through entropy encoding / decoding. Information on at least one of the divisible size of the current block, the size of the sub-block, and the value of the size of the current block divided by N can be predefined in the encoder and decoder. Alternatively, information can be signaled at the block level or a higher level than the block level. Higher levels include video, sequence, picture, slice, tile, CTU, and CU.
[0433] One or more samples in the current block or sub-block may be determined as representative samples.
[0434] The representative samples may be one or more samples located in a block, where the block may be a current block or a sub-block.
[0435] Figure 17 is a diagram illustrating an exemplary method of determining representative sample points.
[0436] exist Figure 17 , diagrams represented by (a) and (d) show examples of a current block, and diagrams represented by (b) and (c) show examples of subblocks obtained according to division of the current block.
[0437] For example, refer to Figure 17 As shown in (a) in FIG, the sample point located at the lower right corner of the current block can be determined as the representative sample point.
[0438] Optionally, refer to Figure 17 As shown in (b) in FIG, the sample point located at the center of the current block can be determined as the representative sample point.
[0439] Optionally, refer to Figure 17As shown in the diagram (c) in FIG, two sample points located at the lower right corner and the center of the current block respectively can be determined as representative sample points.
[0440] The value of the representative sample point can be the same as that of the reference point. Figure 17 At least one of the original sample value, the predicted sample value and the reconstructed sample value corresponding to the position described in the diagrams (a) to (c).
[0441] The position of the representative sample point can be a fixed position. For example, the position can be the lower right corner of the block. In this case, there is no need to transmit information about the position of the representative sample point using a signal.
[0442] Alternatively, information indicating the position of the representative sample point may be signaled.
[0443] Alternatively, the number of representative samples and / or the positions of the representative samples may be determined based on at least one of an intra prediction mode of the current block (i.e., a directional mode or a non-directional mode and / or a specific direction in the case of a directional mode), a size of the current block, and a shape of the current block.
[0444] The values of the representative samples are obtained by Figure 17 Statistical values of one or more sample points near the position shown in the diagram represented by (a), (b) or (c).
[0445] For example, if Figure 17 As shown in the diagram represented by (d) in FIG, when the position of the representative sample is determined to be D, statistical values of two or more samples selected from samples A, B, C, and D (i.e., the sample located at the designated position D and the neighboring samples located around the designated position D) can be determined as representative sample values. In this case, examples of the statistical value include an average, a median, a maximum, a minimum, a mode, and a weighted average. The position of the neighboring sample to be used is determined according to at least one of the intra prediction mode, the size, and the shape of the current block.
[0446] For example, when the intra prediction mode is a vertical mode, samples B and D may be used. For example, when the size of the block is equal to or larger than a predetermined size, all samples A to D may be used. For example, when the block has a vertically extending rectangular shape, samples B and D may be used.
[0447] For example, when the intra prediction mode is a vertical mode, samples C and D may be used. For example, when the size of the block is equal to or smaller than a predetermined size, all samples A to D may be used. For example, when the block has a vertically extending rectangular shape, samples C and D may be used.
[0448] For example, when the position of the representative sample point is determined by Figure 17When D in the diagram represented by (d) in FIG, the average value of the samples A, B, C, and D (i.e., (A+B+C+D+2)>>2) is determined as the representative sample value. Alternatively, the weighted sum of the samples B, C, and D (i.e., (B+2×D+C+2)>>2) can be determined as the representative sample value. Alternatively, the median value of the samples A, B, C, and D can be determined as the representative sample value.
[0449] One or more operations of prediction, transform / inverse transform, and quantization / dequantization are performed on the determined representative samples.
[0450] Prediction of the representative sample may be performed using one or more reconstructed reference samples surrounding the current block.
[0451] Figure 18 is a diagram illustrating an exemplary method of performing prediction on representative samples.
[0452] Figure 18 Four blocks are shown, including the current block at the lower right corner, the left neighboring block, the upper neighboring block, and the upper left neighboring block. Figure 18 In the example, the black dots in the current block represent representative samples, and the gray dots in each neighboring block represent reference samples. In the following description, the reference samples in or within the upper neighboring block are represented by "A," the reference samples in or within the left neighboring block are represented by "L," and the reference samples in or within the upper left neighboring block are represented by "AL."
[0453] For example, Figure 18 As shown, the value of a representative sample R located at the lower right corner of the current block can be predicted using at least one of the reconstructed reference samples within the upper neighboring block A, the left neighboring block L, or the upper left neighboring block AL. The reconstructed reference sample can be the sample located at the lower right corner of the reconstructed neighboring block. Alternatively, the reconstructed reference sample can be a co-located sample within the reconstructed neighboring block. That is, within the reconstructed neighboring block, the sample located at a position corresponding to the position of the representative sample within the current block is called a co-located sample. In this case, the representative sample value can be the original sample value of the sample at that position. For example, when reconstructed reference samples within the upper neighboring block A and the left neighboring block L are used, the predicted representative sample value "Pred_R," which is the predicted value for the representative sample, is derived using Equation 19 described below.
[0454] [Equation 19]
[0455] Pred_R=(A+L+1)>>1
[0456] In Equation 19, A represents the value of the reconstructed reference sample in the upper neighboring block A, and L represents the value of the reconstructed reference sample in the left neighboring block.
[0457] Figure 19 is a diagram illustrating another exemplary method of performing prediction on representative samples.
[0458] exist Figure 19 In the embodiment shown, the current block is divided into 16 sub-blocks. The left adjacent block, the upper adjacent block and the upper left adjacent block of the current block have the same size as the sub-blocks. In order to understand the determination of the positions of the representative sample points and the reference sample points, appropriate reference is made to the Figure 18 Related to the above description.
[0459] For example, referring to Figure 19 In the diagram (a) of FIG, the lower right corner sample point in each sub-block in the current block is determined as the representative sample point. In this case, referring to Figure 19 As shown in (b) of FIG, a block is generated by gathering representative samples in each sub-block. Figure 19 The reference samples present in the vicinity of the current block as shown in the diagram (a) are used as Figure 19 The reconstructed reference samples of the newly generated block (hereinafter referred to as the representative sample block) composed of representative samples are shown in the diagram (b) in FIG. Figure 19 When performing prediction on a block consisting of representative samples as shown in the diagram (b) in FIG, directional prediction or non-directional prediction is performed using a reconstructed reference sample block consisting of reference samples existing near the current block. In this case, the reference sample is a sample in a neighboring block having the same x-coordinate value or the same y-coordinate value as the representative sample.
[0460] Alternatively, the average value of the reference samples adjacent to the current block may be used as the prediction value of the representative sample. For example, the DC mode prediction value for the current block may be used as the prediction value of the representative sample. Figure 19 A block composed of representative samples (ie, a representative sample block) shown in the diagram (b) in FIG. 3 may be used as a current block, and the method according to the present invention may be applied. In this case, the representative sample block may be reconstructed.
[0461] The representative sample residual signal corresponding to the difference between the value of the representative sample and the predicted value of the representative sample may be entropy encoded or entropy decoded.
[0462] Transformation / inverse transformation or quantization / dequantization may be performed on the representative sample residual signal. In this case, the type of transformation / inverse transformation may vary depending on the prediction mode of the representative sample.
[0463] After reconstructing the representative samples using the predicted values of the representative samples and the residual signal, intra prediction is performed on the current block based on the reconstructed representative samples.
[0464] The reconstructed representative samples are values obtained by performing inverse quantization and / or inverse transformation on the representative sample residual signal to generate an operation value, and then adding the predicted representative samples (the predicted values of the representative samples) to the operation value. Hereinafter, the representative samples refer to the reconstructed representative samples.
[0465] Intra prediction on the current block may be performed using at least one of the reconstructed representative samples and reference samples adjacent to the current block.
[0466] Intra prediction may be performed using the reconstructed representative samples and interpolation of each reference sample.
[0467] Figure 20 is a diagram illustrating an exemplary method of generating right column prediction samples and bottom row prediction samples of a current block by using reconstructed representative samples and reference samples.
[0468] Figure 20 Four blocks are shown, including the current block (the lower right block in the diagram), the left neighboring block, the upper neighboring block, and the upper left neighboring block. Figure 20 In , the black dots in the current block represent representative samples, and the gray dots in each neighboring block represent reference samples.
[0469] For example, Figure 20 As shown, the right column prediction samples (hatched points) and the bottom row prediction samples (hatched points) of the current block are obtained by interpolating the representative sample located at the bottom right corner and each reference sample. For example, when the size of the current block is 8×8, the bottom row prediction samples (the prediction sample values in the bottom row) are calculated according to (a×L+b×Re+4)>>3, where "a" and "b" represent weights that vary with the positions of the samples to be predicted, L represents the bottom left reference sample, and Re represents the representative sample located at the bottom right corner in the current block.
[0470] Prediction samples for each sample within the block may be generated by using reference samples and one or more prediction samples from the bottom row and right column prediction samples.
[0471] Figure 21 is a diagram illustrating an exemplary method of performing prediction by using reference samples and right column or bottom row prediction samples.
[0472] Figure 21 Shown using Figure 20 An embodiment of predicting samples in the current block using the right column and bottom row prediction samples (corresponding to the hatched points) generated by the method.
[0473] like Figure 21As shown, an interpolation method is used to predict the samples in the current block. For example, when the size of the current block is 8×8, the predicted samples (predicted sample values) are calculated according to (a×L+b×R+c×A+d×B+8)>>4, where "a", "b", "c", and "d" represent weights that vary with the positions of the samples to be predicted, L represents the reference sample on the left side of the current block, R represents the predicted sample on the right column in the current block, A represents the reference sample above the current block, and B represents the predicted sample on the bottom row in the current block.
[0474] To predict samples within the current block, directional prediction or non-directional prediction is performed. In this case, directional intra prediction can be performed from the right column prediction samples and the bottom row prediction samples. Alternatively, bidirectional intra prediction can be performed from the reference samples as well as the right column prediction samples and the bottom row prediction samples. The prediction direction (hereinafter referred to as the second direction) used to perform directional intra prediction based on the right column prediction samples and the bottom row prediction samples is determined based on the prediction direction (hereinafter referred to as the first direction) used to perform directional intra prediction based on the reference samples. For example, the second direction is at an angle of 180° relative to the first direction. Alternatively, the second direction can be determined independently of the first direction. For example, information about the first direction and information about the second direction can be signaled independently.
[0475] Figure 22 is a diagram illustrating an exemplary prediction method for a case where a current block is divided into subblocks.
[0476] Reference Figure 22 , the current block is divided into 16 sub-blocks. In this case, intra prediction based on the bottom right reconstructed reference sample is performed based on the sub-blocks. In this case, intra prediction for each sub-block can be performed in parallel.
[0477] When performing intra prediction based on representative samples, the residual signal of the current block may not be encoded / decoded. For example, the predicted samples generated by prediction based on the representative samples are determined as the reconstructed samples of the current block.
[0478] Whether representative sample-based intra prediction is performed may be determined during the step of deriving the intra prediction mode. For example, a flag may be sent to determine whether representative sample-based intra prediction is performed on the current block. For example, the representative sample-based intra prediction mode may be derived as one of the non-directional modes.
[0479] When performing intra prediction or inter prediction, the first color component may be intra predicted and the second color component may be inter predicted. For example, the first color component is a luma component and the second color component is a chroma component. Conversely, the first color component may be a chroma component and the second color component may be a luma component.
[0480] Regarding the application of filtering to the prediction samples, whether filtering is applied may be determined based on at least one of the intra prediction mode, size (width and height), block shape, prediction based on multiple sample lines, and color components of the current block. Filtering refers to a method of filtering one or more prediction samples using one or more reference samples.
[0481] For example, when the intra prediction mode of the current block is a predetermined mode, filtering may be applied to the prediction samples. For example, the predetermined mode is a directional mode, a non-directional mode, a horizontal mode, or a vertical mode.
[0482] For example, filtering may be applied to the prediction samples when the size of the current block falls within a predetermined size range. For example, filtering may be applied when the width of the current block is less than 64 and the height is less than 64. Alternatively, filtering may be applied when the width or height of the current block is greater than or less than a predetermined size.
[0483] For example, whether filtering is applied to the prediction samples may be determined based on the reference sample line used for prediction. For example, when the reference sample line used for prediction is the first reference sample line adjacent to the current block, filtering may be applied. On the other hand, when the reference sample line is one of the second reference sample line and the forward reference sample line located around the current block, filtering may not be applied. The indicator mrl_index may be used to determine the reference sample line. For example, when the index for the current block is zero, filtering is applied. However, when the value of the index for the current block is greater than zero, filtering is not applied.
[0484] For example, when the color component of the block element is a luminance signal, filtering is applied. However, when the color component of the current block is a chrominance signal, filtering is not applied.
[0485] Prediction of the current block may be performed by combining one or more of the above-described exemplary prediction methods.
[0486] For example, prediction of the current block may be performed by calculating a weighted sum of a prediction value obtained using a predetermined non-directional intra prediction mode and a prediction value obtained using a predetermined directional intra prediction mode. In this case, the weight may vary depending on at least one of the intra prediction mode of the current block, the size / shape of the current block, and the position of the prediction target sample.
[0487] For example, prediction of the current block can be performed by calculating a weighted sum of a prediction value obtained using a predetermined intra-prediction mode and a prediction value obtained using a predetermined inter-prediction mode. In this case, the weights may vary depending on at least one of the current block's coding mode, intra-prediction mode, inter-prediction mode, and size / shape. For example, when the intra-prediction mode is a non-directional mode such as DC or planar, a weight corresponding to 1 / 2 may be applied to the intra-prediction samples and the inter-prediction samples, respectively. Alternatively, when the intra-prediction mode is vertical, the weights applied to the intra-prediction samples decrease with distance from a reference sample line above the current block. Similarly, when the intra-prediction mode is horizontal, the weights applied to the intra-prediction samples decrease with distance from a reference sample line to the left of the current block. The sum of the weights applied to the intra-prediction samples and the weights applied to the inter-prediction samples can be any power of 2. That is, it can be any of 4, 8, 16, 32, etc. For example, when the size of the current block is within a predetermined size range, a weight corresponding to 1 / 2 may be applied to the intra prediction samples and the inter prediction samples, respectively.
[0488] The intra prediction mode may be fixed to the DC mode and the planar mode, or may be determined by transmitting information with a signal. Alternatively, the intra prediction mode may be any mode selected from the MPM candidate modes, and may be determined by the MPM candidate mode derived from the intra prediction mode of the neighboring block. The mode of the neighboring block may be replaced by a predetermined representative mode. For example, when the intra prediction mode of the neighboring block is a direction mode of a specific direction classified into the vertical direction group, the mode of the neighboring block is replaced by the vertical mode. On the other hand, when the intra prediction mode of the neighboring block is a direction mode of a specific direction classified into the horizontal direction group, the mode of the neighboring block is replaced by the horizontal mode.
[0489] Inter prediction may be at least one of a DC mode, a merge mode, and an AMVP mode. When the inter prediction mode of the current block is the merge mode, prediction of the current block may be performed by calculating a weighted sum of an inter prediction value obtained by using motion information corresponding to the merge index and a prediction value obtained by using the DC mode or the planar mode.
[0490] For example, prediction of the current block may be performed by calculating a weighted sum of one or more prediction samples obtained using multiple sample lines. For example, prediction may be performed by calculating a weighted sum of a first prediction value obtained using a first reference sample line near the current block and a second prediction value obtained using a second reference sample line near the current block and a forward reference sample line. The reference sample line used to obtain the second prediction value may be the reference sample line indicated by mrl_index. The weights for the first prediction value and the second prediction value may be equal. Alternatively, the weights for the first prediction value and the second prediction value may vary depending on at least one of the intra prediction mode of the current block, the size / shape of the current block, and the position of the sample to be predicted. The first prediction value may be a value predicted using a predetermined mode. For example, the first prediction value may be a value predicted using at least one of a DC mode and a planar mode. The second prediction value may be a value predicted using the intra prediction mode of the current block derived in the available intra prediction mode derivation step.
[0491] When prediction is performed by calculating a weighted sum of one or more prediction samples, filtering may not be performed on the prediction samples.
[0492] The above embodiments can be performed in the same way in an encoder and a decoder.
[0493] The order in which the above embodiments are applied may be different between an encoder and a decoder, or the order in which the above embodiments are applied may be the same in an encoder and a decoder.
[0494] The above embodiments may be performed on each of the luminance signal and the chrominance signal, or may be performed identically on the luminance signal and the chrominance signal.
[0495] The block shape to which the above embodiments of the present invention are applied may have a square shape or a non-square shape.
[0496] The above embodiments of the present invention may be applied based on the size of at least one of the following: coding block, prediction block, transform block, block, current block, coding unit, prediction unit, transform unit, unit, and current unit. Here, the size may be defined as a minimum size or a maximum size or both a minimum size and a maximum size, thereby applying the above embodiments, or the size may be defined as a fixed size to which the above embodiments are applied. In addition, in the above embodiments, the first embodiment may be applied to the first size, and the second embodiment may be applied to the second size. In other words, the above embodiments may be applied in combination based on the size. In addition, the above embodiments may be applied when the size is equal to or greater than the minimum size and equal to or less than the maximum size. In other words, the above embodiments may be applied when the block size is included in a specific range.
[0497] For example, when the size of the current block is 8×8 or larger, the above embodiment may be applied. For example, when the size of the current block is 4×4 or larger, the above embodiment may be applied. For example, when the size of the current block is equal to or smaller than 16×16, the above embodiment may be applied. For example, when the size of the current block is equal to or larger than 16×16 and equal to or smaller than 64×64, the above embodiment may be applied.
[0498] The above embodiments of the present invention can be applied according to time layers. To identify the time layers to which the above embodiments are applicable, a corresponding identifier can be transmitted by a signal, and the above embodiments can be applied to the specified time layers identified by the corresponding identifier. Here, the identifier can be defined as the lowest layer, the highest layer, or both the lowest layer and the highest layer to which the above embodiments are applicable, or can be defined as a specific layer to which the embodiments are applied. In addition, a fixed time layer to which the embodiments are applied can be defined.
[0499] For example, when the temporal layer of the current image is the lowest layer, the above embodiment can be applied. For example, when the temporal layer identifier of the current image is 1, the above embodiment can be applied. For example, when the temporal layer of the current image is the highest layer, the above embodiment can be applied.
[0500] A stripe type to which the above embodiments of the present invention are applied may be defined, and the above embodiments may be applied according to the corresponding stripe type.
[0501] In the above embodiments, the method is described based on a flowchart having a series of steps or units, but the present invention is not limited to the order of these steps, but some steps may be performed simultaneously with other steps or in a different order. In addition, it should be understood by those skilled in the art that the steps in the flowchart are not mutually exclusive, and other steps may be added to the flowchart or some of the steps may be deleted from the flowchart without affecting the scope of the present invention.
[0502] The embodiments include various aspects of the examples. All possible combinations of the various aspects may not be described, but those skilled in the art will be able to recognize different combinations. Therefore, the present invention may include all replacements, modifications and changes within the scope of the claims.
[0503] Embodiments of the present invention can be implemented in the form of program instructions, wherein the program instructions can be executed by various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium may include program instructions, data files, data structures, etc. individually, or may include a combination of program instructions, data files, data structures, etc. The program instructions recorded in the computer-readable recording medium may be specially designed and constructed for the present invention, or may be well known to those skilled in the art of computer software technology. Examples of computer-readable recording media include magnetic recording media (such as hard disks, floppy disks, and magnetic tapes); optical data storage media (such as CD-ROMs or DVD-ROMs); magneto-optical media (such as floppy disks); and hardware devices specially constructed to store and implement program instructions (such as read-only memory (ROM), random access memory (RAM), flash memory, etc.). Examples of program instructions include not only machine language code formatted by a compiler, but also high-level language code that can be implemented by a computer using an interpreter. The hardware device can be configured to be operated by one or more software modules, or vice versa, to perform processing according to the present invention.
[0504] Although the present invention has been described in terms of specific items (such as detailed elements) and limited embodiments and drawings, they are only provided to help a more comprehensive understanding of the present invention, and the present invention is not limited to the above embodiments. It will be understood by those skilled in the art that various modifications and changes may be made to the above description.
[0505] Therefore, the spirit of the present invention should not be limited to the above-described embodiments, and the full scope of the appended claims and their equivalents should fall within the scope and spirit of the present invention.
[0506] Industrial Applicability
[0507] The present invention can be used to encode / decode images.
Claims
1. An image decoding method, comprising: Derivation of intra prediction mode for the current chroma block; In response to an intra prediction mode of the current chroma block being an inter-color component prediction mode, selecting one or more luma reference sample lines from a plurality of luma reference sample lines based on whether an upper boundary of a current luma block corresponding to the current chroma block is part of a boundary of a luma block of a current coding tree that includes the current luma block; deriving luma reference samples using the selected one or more luma reference sample lines; Deriving chroma reference samples for the current chroma block; Determine, based on the luma reference samples and the chroma reference samples, a correlation parameter of a linear model for inter-color component prediction of a current chroma block; as well as generating a prediction block for the current chrominance block by performing inter-color component prediction based on the current luminance block and the correlation parameter, wherein, in response to an upper boundary of the current luminance block being part of a boundary of a luminance block of the current coding tree, the number of the one or more luminance reference sample lines selected is 1, and In which, in response to an upper boundary of the current luminance block not being part of a boundary of a luminance block of the current coding tree, the number of the one or more luminance reference sample lines selected is greater than one.
2. The method according to claim 1, wherein The intra prediction mode of the current chroma block is derived based on prediction mode information, wherein the prediction mode information indicates whether the inter-color component prediction is performed.
3. The method according to claim 2, wherein: Whether the inter-color component prediction is performed is determined based on at least one of the encoding parameters and the size of the current luminance block.
4. An image encoding method performed by an image encoding device, the method comprising: Derivation of intra prediction mode for the current chroma block; In response to an intra prediction mode of the current chroma block being an inter-color component prediction mode, selecting one or more luma reference sample lines from a plurality of luma reference sample lines based on whether an upper boundary of a current luma block corresponding to the current chroma block is part of a boundary of a luma block of a current coding tree that includes the current luma block; deriving luma reference samples using the selected one or more luma reference sample lines; Deriving chroma reference samples for the current chroma block; Determine, based on the luma reference samples and the chroma reference samples, a correlation parameter of a linear model for inter-color component prediction of a current chroma block; as well as generating a prediction block for a current chrominance block by performing the inter-color component prediction based on the current luminance block and the correlation parameter, wherein, in response to an upper boundary of the current luma block being part of a boundary of a luma block of the current coding tree, the number of the one or more luma reference sample lines selected is 1, and In which, in response to an upper boundary of the current luminance block not being part of a boundary of a luminance block of the current coding tree, the number of the one or more luminance reference sample lines selected is greater than one.
5. A method for transmitting a bit stream generated by an encoding method performed by an image encoding device, the encoding method comprising: Derivation of intra prediction mode for the current chroma block; In response to an intra prediction mode of the current chroma block being an inter-color component prediction mode, selecting one or more luma reference sample lines from a plurality of luma reference sample lines based on whether an upper boundary of a current luma block corresponding to the current chroma block is part of a boundary of a luma block of a current coding tree that includes the current luma block; deriving luma reference samples using the selected one or more luma reference sample lines; Deriving chroma reference samples for the current chroma block; Determine, based on the luma reference samples and the chroma reference samples, a correlation parameter of a linear model for inter-color component prediction of a current chroma block; generating a prediction block for a current chrominance block by performing the inter-color component prediction based on the current luminance block and the correlation parameter; as well as Transmit the bitstream generated based on the prediction block, wherein, in response to an upper boundary of the current luma block being part of a boundary of a luma block of the current coding tree, the number of the one or more luma reference sample lines selected is 1, and In which, in response to an upper boundary of the current luminance block not being part of a boundary of a luminance block of the current coding tree, the number of the one or more luminance reference sample lines selected is greater than one.
Citation Information
Patent Citations
Video encoding method and apparatus, and video decoding method and apparatus
CN107113425A