Image encoding / decoding method and recording medium storing bit stream

The location and value of representative sample points are determined by intra prediction method, and the image encoding and decoding is used for representative sample points and reference sample points, which solves the problem of high resolution and high-quality image data transmission and storage costs, and achieves higher compression efficiency.

CN120263969APending Publication Date: 2025-07-04INTELLECTUAL DISCOVERY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510631840.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-09-13
Filing Date
2018-10-18
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

The transmission and storage costs of high-resolution and high-quality image data have increased, and the compression efficiency of existing image encoding technologies is insufficient.

Method used

By using the intra prediction method, by determining the location and value of representative sample points, image encoding and decoding is performed using representative sample points and reference sample points to improve compression efficiency.

Benefits of technology

Improve the compression efficiency of image encoding and decoding, and reduce transmission and storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120263969A_ABST
    Figure CN120263969A_ABST
Patent Text Reader

Abstract

The invention provides an image encoding / decoding method and a recording medium storing a bit stream. An image decoding method includes: determining whether a combination of intra prediction and inter prediction is used for prediction of a current block; generating an intra prediction block of the current block by performing intra prediction on the current block using the intra prediction mode; generating an inter prediction block of the current block by performing inter prediction on the current block; generating a prediction block of the current block based on a weighted sum of the intra prediction block and the inter prediction block; and generating a reconstructed block of the current block on the basis of the prediction block, in which an intra prediction mode is fixed to a planar mode in response to a combination of intra prediction and inter prediction being used for prediction of the current block, and a decoding process of intra prediction mode information of the current block is skipped, and in which the intra prediction mode information of the current block is decoded by the planar mode. In response to a combination of intra prediction and inter prediction being used for prediction of the current block, the inter prediction mode is fixed to a merge mode.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a Chinese invention patent application with an application date of October 18, 2018, an application number of 202210863160.3, and a title of "Image Encoding / Decoding Method and Apparatus and Recording Medium Storing Bitstream", and the application with an application number of 202210863160.3 is a divisional application of a Chinese invention patent application with an application date of October 18, 2018, an application number of 201880067363.3, and a title of "Image Encoding / Decoding Method and Apparatus and Recording Medium Storing Bitstream". 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 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 traditional image data, higher-resolution and higher-quality image data has an increased data volume. Therefore, when transmitting image data through a medium such as a traditional wired or wireless broadband network, or when storing image data using a traditional storage medium, the cost of transmission and storage increases. To solve these problems that arise as the resolution and quality of image data increase, efficient image encoding / decoding techniques are required for higher-resolution and higher-quality images.

[0004] Image compression techniques include various techniques, including: an inter prediction technique that predicts pixel values included in a current picture from a previous or subsequent picture of the current picture; an intra prediction technique that predicts pixel values included in the current picture by using pixel information in the current picture; a transform and quantization technique that compresses the energy of a residual signal; an entropy encoding technique that assigns a short code to a value with a high occurrence frequency and assigns a long code to a value with a low occurrence frequency; and so on. Image data can be effectively compressed by using such image compression techniques and can be transmitted or stored. Summary of the Invention

[0005] Technical Problem

[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 prediction to improve compression efficiency.

[0008] Still another object of the present invention is to provide a recording medium storing a bitstream generated by the image encoding method / apparatus 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 prediction mode of a current block, configuring reference samples of the current block, and performing intra prediction on the current block based on the intra prediction mode and the reference samples, wherein the intra 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 a position of the representative samples, determining values of the representative samples, and using the representative samples and the reference samples to predict samples in the current block.

[0012] In the image decoding method according to the present invention, the position of the representative samples 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 bottom right position of the current block.

[0014] In the image decoding method according to the present invention, the values of the representative samples may be determined as statistical values of the representative samples specified by the position of the representative samples and neighboring samples of the representative samples.

[0015] In the image decoding method according to the present invention, the position of the representative samples may be a bottom right position of the current block, and the values of the representative samples may be an average value of the representative samples, a left sample of the representative samples, an upper left sample of the representative samples, and an upper sample of the representative samples.

[0016] In the image decoding method according to the present invention, the step of determining the values of the representative samples may include: deriving a predicted value for the representative samples, reconstructing a residual value for the representative samples, and using the predicted value and the residual value to determine the values of the representative samples.

[0017] In the image decoding method according to the present invention, the predicted value for the representative samples 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, the prediction value for the right boundary sample adjacent to the right boundary of the current block in the current block can be derived using interpolation of the representative sample and the upper reference sample, and the prediction value for the bottom boundary sample adjacent to the bottom boundary of the current block in the current block can be derived using interpolation of the representative sample and the left reference sample.

[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 prediction mode of a current block, configuring reference samples of the current block, and performing intra prediction on the current block based on the intra prediction mode and the reference samples, wherein the intra prediction is a prediction based on representative samples.

[0021] In the image encoding method according to the present invention, the prediction based on representative samples may include: determining a position of the representative sample, determining a value of the representative sample, and using the representative sample and the reference samples to predict samples in the current block.

[0022] In the image encoding method according to the present invention, the position of the representative sample may be determined as a predetermined fixed position or encoded by information signaled through a bitstream.

[0023] In the image encoding method according to the present invention, the value of the representative sample may be determined as using a statistical value of the representative sample specified by the 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 bottom right position of the current block, and the value of the representative sample is the average of the representative sample, the left sample of the representative sample, the upper left sample of the representative sample, and the upper sample of 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 using the prediction value and the residual value to determine the value of the representative sample.

[0026] In the image encoding method according to the present invention, the prediction value for the representative sample can be derived using the left reference sample of the current block and the upper reference sample of the current block.

[0027] In the image coding method according to the present invention, the prediction value for a right boundary sample adjacent to the right boundary of the current block in the current block can be derived using interpolation of the representative sample and the upper reference sample, and the prediction value for a bottom boundary sample adjacent to the bottom boundary of the current block in the current block can be derived using interpolation of the representative sample and the left reference sample.

[0028] In the image coding method according to the present invention, the prediction value for a 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 can store a bitstream generated by the image coding method or apparatus according to the present invention.

[0030] An image decoding method performed by an image decoding apparatus includes: determining whether a combination of intra prediction and inter prediction is used for predicting a current block; performing intra prediction on the current block using an intra prediction mode to generate an intra prediction block of the current block; performing inter prediction on the current block to generate an inter prediction block of the current block; generating a prediction block of the current block based on a weighted sum of the intra prediction block and the inter prediction block; and generating a reconstructed block of the current block based on the prediction block, wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the intra prediction mode is fixed to a planar mode, and decoding processing of the intra prediction mode information of the current block is skipped, and wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the inter prediction mode is fixed to a merge mode.

[0031] An image coding method performed by an image coding apparatus includes: determining whether a combination of intra prediction and inter prediction is used for predicting a current block; performing intra prediction on the current block using an intra prediction mode to generate an intra prediction block of the current block; performing inter prediction on the current block to generate an inter prediction block of the current block; generating a prediction block of the current block based on a weighted sum of the intra prediction block and the inter prediction block; and encoding a bitstream generated based on the prediction block, wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the intra prediction mode is fixed to a planar mode, and encoding processing of the intra prediction mode information of the current block is skipped, and wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the inter prediction mode is fixed to a merge mode.

[0032] A non-transitory computer-readable recording medium storing the bitstream generated by the above image coding method is also provided.

[0033] Beneficial effects

[0034] According to the present invention, there is provided a method and apparatus for encoding and decoding an image to improve compression efficiency.

[0035] According to the present invention, there is provided a method and apparatus for encoding and decoding an image using intra prediction to improve compression efficiency.

[0036] According to the present invention, there is provided a recording medium storing a bitstream generated by the image encoding method / apparatus of the present invention. Description of the drawings

[0037] Figure 1 is a block diagram showing the configuration of an encoding device according to an embodiment of the present invention.

[0038] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment of the present invention.

[0039] Figure 3 is a diagram schematically showing the partitioning structure of an image when encoding and decoding the image.

[0040] Figure 4 is a diagram for explaining an embodiment of the processing of inter prediction.

[0041] Figure 5 is a diagram for explaining intra prediction according to the present invention.

[0042] Figure 6 is an exemplary diagram showing the relationship between a luminance block and a chrominance block.

[0043] Figure 7 is a diagram for describing multiple reconstructed sample lines.

[0044] Figure 8 is a diagram for describing the process of replacing unavailable samples with available samples.

[0045] Figure 9 Shows various filter shapes.

[0046] Figure 10 is a diagram for describing intra prediction according to the shape of the current block.

[0047] Figure 11 is a diagram for describing neighboring samples of the current block for deriving parameters of a linear model for predicting a chrominance component from a luminance component.

[0048] Figure 12 is an exemplary diagram showing the process of reconstructing a color component block.

[0049] Figure 13 It is a diagram showing an embodiment in which reconstruction is performed by using multiple upper reference sample lines and / or multiple left reference sample lines.

[0050] Figure 14 It is an exemplary diagram showing reference samples for reconstruction according to the intra prediction mode or coding parameters of a corresponding block.

[0051] Figure 15 It is a diagram showing a corresponding block of a first color component of an exemplary reconstruction when a second color component prediction target block is a 4×4 block.

[0052] Figure 16 It is a diagram showing samples of a first color component and samples of a second color component.

[0053] Figure 17 It is a diagram showing an exemplary method for determining representative samples.

[0054] Figure 18 It is a diagram showing an exemplary method for performing prediction on representative samples.

[0055] Figure 19 It is a diagram showing another exemplary method for performing prediction on representative samples.

[0056] Figure 20 It is a diagram showing an exemplary method for generating right-column prediction samples and bottom-row prediction samples of a current block by using reconstructed representative samples and reference samples.

[0057] Figure 21 It is a diagram showing an exemplary method for performing prediction by using reference samples and right-column prediction samples or bottom-row prediction samples.

[0058] Figure 22 It is a diagram showing an exemplary prediction method for the case where a current block is divided into sub-blocks. Detailed Description

[0059] Various modifications can be made to the present invention, and there are various embodiments of the present invention. Among them, examples of various embodiments of the present invention will now be provided and described in detail with reference to the accompanying drawings. However, although the exemplary embodiments can be interpreted as including all modifications, equivalent forms, 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 all aspects. In the drawings, the shapes and sizes of the elements may be exaggerated for clarity. In the following detailed description of the present invention, reference is made to the drawings which illustrate specific embodiments in which the present invention can 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, without departing from the spirit and scope of the present disclosure, the specific features, structures, and characteristics described herein in connection with one embodiment can be implemented in other embodiments. In addition, it should be understood that without departing from the spirit and scope of the present disclosure, the position or arrangement of each element within each disclosed embodiment can be modified. Therefore, the following detailed description should not be understood in a limiting sense, and the scope of the present disclosure is only defined by the appended claims (and, where appropriate, the full scope of equivalents claimed by the claims).

[0060] The terms "first", "second", etc. used in the specification may be used to describe various components, but these components are not to be construed as being limited by these terms. These terms are only used to distinguish one component from another. For example, without departing from the scope of the present invention, the "first" component may be referred to as the "second" component, and the "second" component may similarly be referred to as the "first" component. The term "and / or" includes combinations of multiple items or any one of multiple terms.

[0061] It will be understood that in this specification, when an element is only referred to as "connected to" or "coupled to" another element rather than "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 in the case where there are other elements between the element and the other element. Conversely, it should be understood that when an element is referred to as "directly coupled" or "directly connected" to another element, there is no intermediate element.

[0062] In addition, the constituent components shown in the embodiments of the present invention are shown independently to present different characteristic functions from each other. Therefore, this does not mean that each constituent component is composed of a separate hardware or software component unit. In other words, for convenience, each constituent component includes each of the enumerated constituent components. Thus, at least two constituent components in each constituent component may be combined to form one constituent component, or one constituent component may be divided into multiple constituent components for performing each function. Without departing from the essence of the present invention, embodiments in which each constituent component is combined and embodiments in which one constituent component is divided are also included in the scope of the present invention.

[0063] The terms used in this specification are only for describing specific embodiments and are not intended to limit the present invention. Expressions used in the singular include plural expressions unless they have 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 the presence of the features, quantities, steps, actions, elements, components, or combinations thereof disclosed in the specification, and are not intended to exclude the possibility of the existence or addition of one or more other features, quantities, steps, actions, elements, components, or combinations thereof. In other words, when a specific element is referred to as "being included", elements other than the corresponding element are not excluded, but additional elements may be included in the embodiments of the present invention or within the scope of the present invention.

[0064] In addition, some constituent elements may not be indispensable constituent elements for performing the essential functions of the present invention, but may be optional constituent elements only for enhancing its performance. The present invention may be implemented by excluding the constituent elements used for enhancing performance and only including the indispensable constituent components for implementing the essence of the present invention. Structures that only include the indispensable constituent elements and exclude the optional constituent elements only used for enhancing performance are also included in the scope of the present invention.

[0065] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. When describing the exemplary embodiments of the present invention, well-known functions or structures will not be described in detail because they will unnecessarily obscure the understanding of the present invention. The same constituent components in the drawings are denoted by the same reference numerals, and repeated descriptions of the same components will be omitted.

[0066] 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" may refer to "encoding or decoding a moving picture or both encoding and decoding", and may refer to "encoding or decoding or both encoding and decoding one image in the images of a moving picture".

[0067] Hereinafter, the terms "moving picture" and "video" may be used with the same meaning and may be interchangeable with each other.

[0068] Hereinafter, the target image may be an encoding target image as an encoding target and / or a decoding target image as a decoding target. In addition, the target image may be an input image input to an encoding device and an input image input to a decoding device. Here, the target image may have the same meaning as the current image.

[0069] Hereinafter, the terms "image", "picture", "frame", and "screen" may be used with the same meaning and may be interchangeable with each other.

[0070] Hereinafter, the target block may be an encoding target block as an encoding target and / or a decoding target block as a decoding target. In addition, the 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 with the same meaning and may be interchangeable with each other.

[0071] Hereinafter, the terms "block" and "unit" may be used with the same meaning and may be interchangeable with each other. Or "block" may represent a specific unit.

[0072] Hereinafter, the terms "region" and "segment" may be interchangeable with each other.

[0073] 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.

[0074] In an embodiment, each of specific information, data, flag, index, element, and attribute, etc. may have a value. A value of information, data, flag, index, element, and attribute equal to "0" may represent logical false or a first predefined value. In other words, the values "0", false, logical false, and the first predefined value may be interchangeable with each other. A value of information, data, flag, index, element, and attribute equal to "1" may represent logical true or a second predefined value. In other words, the values "1", true, logical true, and the second predefined value may be interchangeable with each other.

[0075] When variables i or j are used to represent a column, row, or index, the value of i may be an integer equal to or greater than 0, or an integer equal to or greater than 1. That is, columns, rows, indexes, etc. may be counted starting from 0, or may be counted starting from 1.

[0076] Term description

[0077] Encoder: Represents a device that performs encoding. That is, it represents an encoding device.

[0078] Decoder: Represents a device that performs decoding. That is, it represents a decoding device.

[0079] Block: A block is an M×N sample array. Here, M and N can represent positive integers, and the block can represent a sample array in two-dimensional form. A block can refer to a unit. The current block can represent an encoding target block that becomes a target during encoding, or a decoding target block that becomes a target during decoding. In addition, the current block can be at least one of an encoding block, a prediction block, a residual block, and a transform block.

[0080] Sample: A sample is a basic unit that constitutes a block. Depending on the bit depth (Bd), a sample can be represented as a value from 0 to 2 Bd -1. In the present invention, a sample can be used in the sense of a pixel. That is, a sample, a pel, and a pixel can have the same meaning as each other.

[0081] Unit: A unit can refer to an encoding and decoding unit. When encoding and decoding an image, a unit can be a region generated by partitioning a single image. In addition, when a single image is partitioned into sub-partition units during encoding or decoding, a unit can represent a sub-partition unit. That is, an image can be partitioned into multiple units. When encoding and decoding an image, predetermined processing can be performed for each unit. A single unit can be partitioned into sub-units with a size smaller than the size of the unit. Depending on the function, a unit can represent a block, a macroblock, a coding tree unit, a coding tree block, an encoding unit, an encoding block, a prediction unit, a prediction block, a residual unit, a residual block, a transform unit, a transform block, etc. In addition, in order to distinguish a unit from a block, a unit can include a luminance component block, a chrominance component block associated with the luminance component block, and syntax elements of each color component block. A unit can have various sizes and shapes. Specifically, the shape of a unit can be a two-dimensional geometric figure, such as a square, a rectangle, a trapezoid, a triangle, a pentagon, etc. In addition, unit information can include at least one of a unit type indicating an encoding unit, a prediction unit, a transform unit, etc., and a unit size, a unit depth, an encoding and decoding order of the unit, etc.

[0082] Coding tree unit: A coding tree unit is configured with a single coding tree block of the luminance component Y and two coding tree blocks related to the chrominance components Cb and Cr. In addition, a coding tree unit can represent a block and syntax elements of each block. Each coding tree unit can be partitioned by using at least one of a quadtree partitioning method, a binary tree partitioning method, and a ternary tree partitioning method to configure lower-level units such as an encoding unit, a prediction unit, and a transform unit. A coding tree unit can 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, a quadtree can represent a quaternary tree.

[0083] When the size of a coding block falls within a first predetermined range, only quadtree partitioning is allowed for the coding block. Here, the first predetermined range may be defined by at least one of the maximum size and the minimum size of coding blocks that can be partitioned only by quadtree partitioning. Information indicating the maximum size / minimum size of coding blocks allowed for quadtree partitioning may be signaled as data included in the bitstream, and this information may be signaled in units of at least one of sequences, picture parameters, and slices. Optionally, the maximum size / minimum size of coding blocks may be fixed sizes preset in the encoder / decoder. For example, when the size of a coding block is in the range from 64×64 to 256×256, the coding block may be partitioned only by quadtree partitioning. Optionally, when the size of a coding block is greater than the maximum size of a transform block (TB), the coding block may be partitioned only by 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 to partition a coding unit by quadtree partitioning. When the size of a coding block falls within a second predetermined range, the coding block may be partitioned only by binary tree partitioning or ternary tree partitioning. In this case, the above description of quadtree partitioning may also be applied to binary tree partitioning or ternary tree partitioning.

[0084] Coding tree block: A term that can be used to specify any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

[0085] Neighboring block: Can represent a block adjacent to the current block. A block adjacent to the current block can represent a block that touches the boundary of the current block, or a block located within a predetermined distance from the current block. A neighboring block can represent a block adjacent to a vertex of the current block. Here, a block adjacent to a vertex of the current block can represent a block that is vertically adjacent to a horizontally neighboring block of the current block, or a block that is horizontally adjacent to a vertically neighboring block of the current block.

[0086] Reconstructed neighboring block: Can represent a neighboring block that is adjacent to the current block and has been encoded or decoded in space / time. Here, a reconstructed neighboring block can represent a reconstructed neighboring unit. A reconstructed spatial neighboring block can be a block that has been reconstructed by encoding or decoding or both encoding and decoding within the current picture. A reconstructed temporal neighboring block is a block or a neighboring block of the block at the corresponding position in a reference image with respect to the current block of the current picture.

[0087] Unit depth: It can represent the partitioning degree of a unit. In a tree structure, the highest node (root node) can correspond to the first unit that is not partitioned. Additionally, the highest node can have the minimum depth value. In this case, the depth of the highest node can be level 0. A node with a depth of level 1 can represent a unit generated by partitioning the first unit once. A node with a depth of level 2 can represent a unit generated by partitioning the first unit twice. A node with a depth of level n can represent a unit generated by partitioning the first unit n times. A leaf node can be the lowest node and a node that cannot be further partitioned. The depth of a leaf node can be the maximum level. For example, the predefined value of the maximum level can be 3. The depth of the root node can be the lowest, and the depth of the leaf node can be the deepest. Moreover, when a unit is represented as a tree structure, the level where the unit exists can represent the unit depth.

[0088] Bitstream: It can represent a bitstream including encoded image information.

[0089] Parameter set: It corresponds to the header information among the configurations within the bitstream. At least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptive parameter set can be included in the parameter set. Additionally, the parameter set can include slice headers and tile header information.

[0090] Parsing: It can represent determining the value of a syntax element by performing entropy decoding, or can represent entropy decoding itself.

[0091] Symbol: It can represent at least one of a syntax element, an encoding parameter, and a transform coefficient value of an encoding / decoding target unit. Additionally, a symbol can represent an entropy encoding target or an entropy decoding result.

[0092] Prediction mode: It can be information indicating a mode encoded / decoded using intra prediction or a mode encoded / decoded using inter prediction.

[0093] Prediction unit: It can represent a basic unit when performing predictions (such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation). A single prediction unit can be partitioned into multiple partitions with smaller sizes, or can be partitioned into multiple lower-level prediction units. Multiple partitions can be basic units when performing predictions or compensations. Partitions generated by dividing a prediction unit can also be prediction units.

[0094] Prediction unit partition: It can represent a shape obtained by partitioning a prediction unit.

[0095] Transform unit: It can represent the basic unit when performing encoding / decoding on the residual signal (such as transformation, inverse transformation, quantization, dequantization, transform coefficient encoding / decoding). A single transform unit can be partitioned into multiple lower-level transform units with smaller sizes. Here, the transformation / inverse transformation can include at least one of the first transformation / first inverse transformation and the second transformation / second inverse transformation.

[0096] Scaling: It can represent the process of multiplying the quantization level by a factor. The transform coefficients can be generated by scaling the quantization level. Scaling can also be referred to as dequantization.

[0097] Quantization parameter: It can represent the value used when generating the quantization level using the transform coefficients during quantization. The quantization parameter can also represent the value used when generating the transform coefficients by scaling the quantization level during dequantization. The quantization parameter can be a value mapped to the quantization step size.

[0098] Delta quantization parameter: It can represent the difference between the predicted quantization parameter and the quantization parameter of the encoding / decoding target unit.

[0099] Scanning: It can represent a method of sorting the coefficients within a unit, block, or matrix. For example, changing a two-dimensional matrix of coefficients into a one-dimensional matrix can be referred to as scanning, and changing a one-dimensional matrix of coefficients into a two-dimensional matrix can be referred to as scanning or inverse scanning.

[0100] Transform coefficient: It can represent the coefficient value generated after performing the transformation in the encoder. The transform coefficient can represent the coefficient value generated after performing at least one of entropy decoding and dequantization in the decoder. The quantization level or the quantization transform coefficient level obtained by quantizing the transform coefficient or the residual signal can also fall within the meaning of the transform coefficient.

[0101] Quantization level: It can represent the value generated by quantizing the transform coefficient or the residual signal in the encoder. Optionally, the quantization level can represent the value to be dequantized in the decoder as the dequantization target. Similarly, the quantization transform coefficient level as the result of transformation and quantization can also fall within the meaning of the quantization level.

[0102] Non-zero transform coefficient: It can represent a transform coefficient with a value other than zero, or a transform coefficient level or quantization level with a value other than zero.

[0103] Quantization matrix: It can represent the matrix used in the quantization process or dequantization process performed to improve the subjective image quality or objective image quality. The quantization matrix can also be referred to as the scaling list.

[0104] Quantization matrix coefficient: It can represent each element within the quantization matrix. The quantization matrix coefficient can also be referred to as the matrix coefficient.

[0105] Default matrix: It can represent a predetermined quantization matrix pre - defined in an encoder or a decoder.

[0106] Non - default matrix: It can represent a quantization matrix that is not pre - defined in an encoder or a decoder but signaled by a user.

[0107] Statistical value: For at least one of variables, coding parameters, constant values, etc. having computable specific values, the statistical 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, interpolation of the corresponding specific values.

[0108] Figure 1 FIG. is a block diagram showing the configuration of an encoding device according to an embodiment to which the present invention is applied.

[0109] The encoding device 100 can be an encoder, a video encoding device, or an image encoding device. The video can include at least one image. The encoding device 100 can sequentially encode at least one image.

[0110] Referring to Figure 1 , the encoding device 100 can include a motion prediction unit 111, a motion compensation unit 112, an intra - 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.

[0111] The encoding device 100 can perform encoding on an input image by using an intra - mode or an inter - mode or both an intra - mode and an inter - mode. In addition, the encoding device 100 can generate a bitstream including encoding information by encoding the input image and output the generated bitstream. The generated bitstream can be stored in a computer - readable recording medium or can be streamed through a wired / wireless transmission medium. When the intra - mode is used as a prediction mode, the switch 115 can be switched to intra. Optionally, when the inter - mode is used as a prediction mode, the switch 115 can be switched to the inter - mode. Here, the intra - mode can represent an intra - prediction mode, and the inter - mode can represent an inter - prediction mode. The encoding device 100 can generate a prediction block for an input block of the input image. In addition, the encoding device 100 can encode a residual block by using the residual between the input block and the prediction block after generating 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.

[0112] When the prediction mode is an intra mode, the intra prediction unit 120 may use the samples of the blocks that have been encoded / decoded and are adjacent to the current block as reference samples. The intra prediction unit 120 may perform spatial prediction on the current block by using the reference samples, or generate prediction samples of the input block by performing spatial prediction. Here, intra prediction may represent prediction within a frame.

[0113] When the prediction mode is an inter mode, the motion prediction unit 111 may retrieve, when performing motion prediction, the region that best matches the input block from a reference image, and derive a motion vector by using the retrieved region. In this case, the search region may be used as the region. The reference image may be stored in the reference picture buffer 190. Here, when the encoding / decoding of the reference image has been performed, the reference image may be stored in the reference picture buffer 190.

[0114] The motion compensation unit 112 may generate a prediction block by performing motion compensation on the current block by using the motion vector. Here, inter prediction may represent inter-frame prediction or motion compensation.

[0115] 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 region of the reference picture. In order to perform inter prediction or motion compensation on an encoding unit, it may be determined which one of the skip mode, the merge mode, the advanced motion vector prediction (AMVP) mode, and the current picture reference mode is to be used for the motion prediction and motion compensation of the prediction units included in the corresponding encoding unit. Then, according to the determined mode, inter prediction or motion compensation may be performed differently.

[0116] The subtractor 125 may generate a residual block by using the residuals of 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 or transforming and quantizing the difference between the original signal and the prediction signal. The residual block may be the residual signal of a block unit.

[0117] The transform unit 130 may generate transform coefficients by performing a transform on the residual block, and output the generated transform coefficients. Here, the transform coefficients may be the coefficient values generated by performing a transform on the residual block. When the transform skip mode is applied, the transform unit 130 may skip the transform of the residual block.

[0118] Quantized levels may be generated by applying quantization to the transform coefficients or to the residual signal. Hereinafter, the quantized levels may also be referred to as transform coefficients in the embodiments.

[0119] The quantization unit 140 may generate quantized levels by quantizing transform coefficients or residual signals according to parameters, and output the generated quantized levels. Here, the quantization unit 140 may quantize transform coefficients by using a quantization matrix.

[0120] The entropy encoding unit 150 may generate a bitstream by performing entropy encoding on the value calculated by the quantization unit 140 or on the encoding parameter value calculated during encoding according to a probability distribution, and output the generated bitstream. The entropy encoding unit 150 may perform entropy encoding on the sample information of the image and the information for decoding the image. For example, the information for decoding the image may include syntax elements.

[0121] When entropy encoding is applied, symbols are represented such that a smaller number of bits are assigned to symbols with a high generation probability, and a larger number of bits are assigned to symbols with a low generation probability. Therefore, the size of the bitstream of the symbols to be encoded can be reduced. The entropy encoding unit 150 may use encoding methods for entropy encoding such as exponential Golomb, context-adaptive variable length coding (CAVLC), context-adaptive binary arithmetic coding (CABAC), etc. For example, the entropy encoding unit 150 may perform entropy encoding by using a variable length code (VLC) table. In addition, the entropy encoding unit 150 may derive a binarization method for target symbols and a probability model of target symbols / bits, and perform arithmetic encoding by using the derived binarization method and context model.

[0122] To encode the transform coefficient levels (quantized levels), the entropy encoding unit 150 may change the coefficients in two-dimensional block form into one-dimensional vector form by using a transform coefficient scanning method.

[0123] Coding parameters may include information such as syntax elements (flags, indices, etc.) that are coded in an encoder and signaled to a decoder, as well as information derived during the execution of coding or decoding. The coding parameters may represent the information required for 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 partitioning information, unit / block shape, unit / block partitioning structure, whether to perform quadtree-based partitioning, whether to perform binary tree-based partitioning, the binary tree-based partitioning direction (horizontal direction or vertical direction), the binary tree-based partitioning form (symmetric partitioning or asymmetric partitioning), whether to perform ternary tree-based partitioning, the ternary tree partitioning direction (horizontal direction or vertical direction), the ternary tree-based partitioning form (symmetric partitioning or asymmetric partitioning), whether to perform multi-type tree-based partitioning, the multi-type tree partitioning direction (horizontal direction or vertical direction), the multi-type tree-based partitioning form (symmetric partitioning or asymmetric partitioning), the multi-type tree-based partitioning tree, prediction mode (intra prediction or inter prediction), luminance intra prediction mode / direction, chrominance intra prediction mode / direction, intra partitioning information, inter partitioning information, coding block partitioning flag, prediction block partitioning flag, transform block partitioning 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 prediction mode, inter prediction mode, motion information, motion vector, motion vector difference, reference picture index, inter prediction angle, inter 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 the merge mode, merge index, merge candidate, merge candidate list, whether to use the skip mode, interpolation filter type, interpolation filter taps, interpolation filter coefficients, motion vector magnitude, representation precision of the motion vector, transform type, transform size, information on whether the first (initial) transform is used, information on whether the second transform is used, first transform index, second transform index, information on whether a residual signal exists, coding block style, coding block flag (CBF), quantization parameter, quantization parameter for residuals, quantization matrix, whether to apply an intra-loop filter, intra-loop filter coefficients, intra-loop filter taps, intra-loop filter shape / form, whether to apply a deblocking filter, deblocking filter coefficients, deblocking filter taps, deblocking filter strength, deblocking filter shape / form, whether to apply an adaptive sample offset, adaptive sample offset value, adaptive sample offset category, adaptive sample offset type, whether to apply an adaptive loop filter, adaptive loop filter coefficients, adaptive loop filter taps, adaptive loop filter shape / form, binarization / de-binarization method,Context model determination method, context model update method, whether to execute the normal mode, whether to execute the bypass mode, context binary bits, bypass binary bits, valid coefficient flag, last valid coefficient flag, coding flag for the unit of the coefficient group, position of the last valid coefficient, flag indicating whether the value of the coefficient is greater than 1, flag indicating whether the value of the coefficient is greater than 2, flag indicating whether the value of the coefficient is greater than 3, information about the remaining coefficient values, sign information, reconstructed luminance samples, reconstructed chrominance samples, residual luminance samples, residual chrominance samples, luminance transform coefficients, chrominance transform coefficients, quantized luminance levels, quantized chrominance levels, transform coefficient level scanning method, size of the motion vector search area on the decoder side, shape of the motion vector search area on the decoder side, number of times of motion vector search on the decoder side, information about the CTU size, information about the minimum block size, information about the maximum block size, information about the maximum block depth, information about the minimum block depth, image display / output order, slice identification information, slice type, slice partition information, parallel block identification information, parallel block type, parallel block partition information, picture type, bit depth of the input samples, bit depth of the reconstructed samples, bit depth of the residual samples, bit depth of the transform coefficients, bit depth of the quantized levels, and information about the luminance signal or information about the chrominance signal.

[0124] Here, it can be indicated by a signaling flag or index that the encoder performs entropy coding on the corresponding flag or index and includes it in the bitstream, and it can be indicated that the decoder performs entropy decoding on the corresponding flag or index from the bitstream.

[0125] When the encoding device 100 performs encoding through inter-frame prediction, the encoded current image can be used as a reference image for another image to be processed subsequently. Therefore, the encoding device 100 can reconstruct or decode the encoded current image, or store the reconstructed or decoded image in the reference picture buffer 190 as a reference image.

[0126] The quantized levels can be dequantized in the dequantization unit 160, or can be inverse-transformed in the inverse transform unit 170. The coefficients that have been dequantized or inverse-transformed or both can be added to the prediction block by the adder 175. By adding the coefficients that have been dequantized or inverse-transformed or both to the prediction block, a reconstructed block can be generated. Here, the coefficients that have been dequantized or inverse-transformed or both can represent the coefficients on which at least one of dequantization and inverse transformation has been performed, and can represent the reconstructed residual block.

[0127] The reconstructed block can pass through the filter unit 180. The filter unit 180 can apply at least one of a deblocking filter, sample adaptive offset (SAO), and adaptive loop filter (ALF) to the reconstructed samples, the reconstructed block, or the reconstructed image. The filter unit 180 can be referred to as an in-loop filter.

[0128] The deblocking filter can remove block distortion generated at the boundary between blocks. To determine whether to apply the deblocking filter, it can be determined whether to apply the deblocking filter to the current block based on the samples included in several rows or columns included in the block. When applying the deblocking filter to a block, another filter can be applied according to the required deblocking filter strength.

[0129] To compensate for coding errors, an appropriate offset value can be added to the sample value by using sample adaptive offset. The sample adaptive offset can correct the offset between the deblocked image and the original image on a sample-by-sample basis. A method that applies the offset considering the edge information about each sample can be used, or the following method can be used: partitioning the samples of the image into a predetermined number of regions, determining the region to which the offset is applied, and applying the offset to the determined region.

[0130] The adaptive loop filter can perform filtering based on the comparison result between 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 the ALF can be signaled through the coding unit (CU), and the form and coefficients of the ALF to be applied to each block can vary.

[0131] The reconstructed block or the reconstructed image that has passed through the filter unit 180 can be stored in the reference picture buffer 190. The reconstructed block processed by the filter unit 180 can be part of the 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 can be used later during inter-frame prediction or motion compensation.

[0132] Figure 2 is a block diagram showing the configuration of a decoding device according to an embodiment and applying the present invention.

[0133] The decoding device 200 can be a decoder, a video decoding device, or an image decoding device.

[0134] Referring to Figure 2 , the decoding device 200 can 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.

[0135] The decoding device 200 can receive the bitstream output from the encoding device 100. The decoding device 200 can receive the bitstream stored in a computer-readable recording medium, or can receive the bitstream streamed through a wired / wireless transmission medium. The decoding device 200 can decode the bitstream by using an intra mode or an inter mode. In addition, the decoding device 200 can generate a reconstructed image or a decoded image generated by decoding, and output the reconstructed image or the decoded image.

[0136] When the prediction mode used during decoding is the intra mode, the switcher can be switched to intra. Optionally, when the prediction mode used during decoding is the inter mode, the switcher can be switched to the inter mode.

[0137] The decoding device 200 can obtain a reconstructed residual block by decoding the input bitstream, 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 to be decoded by adding the reconstructed residual block and the prediction block. The block to be decoded can be referred to as the current block.

[0138] The entropy decoding unit 210 can generate symbols by performing entropy decoding on the bitstream according to a probability distribution. The generated symbols can include symbols in a quantized level form. Here, the entropy decoding method can be the inverse process of the above entropy encoding method.

[0139] In order to decode the transform coefficient levels (quantized levels), the entropy decoding unit 210 can change the coefficients in a one-way vector form into a two-dimensional block form by using a transform coefficient scanning method.

[0140] The quantized levels can be dequantized in the dequantization unit 220, or the quantized levels can be inverse-transformed in the inverse transform unit 230. The quantized levels can be the result of performing dequantization or inverse transformation or both dequantization and inverse transformation, and can be generated as a reconstructed residual block. Here, the dequantization unit 220 can apply a quantization matrix to the quantized levels.

[0141] When using the intra mode, the intra prediction unit 240 can generate a prediction block by performing spatial prediction on the current block, where the spatial prediction uses the sample values of the blocks adjacent to and already decoded from the block to be decoded.

[0142] When using the inter mode, the motion compensation unit 250 can generate a prediction block by performing motion compensation on the current block, where the motion compensation uses a motion vector and a reference image stored in the reference picture buffer 270.

[0143] The adder 225 may generate a reconstructed block by adding the reconstructed residual block and the prediction block. The filter unit 260 may apply at least one of a deblocking filter, sample adaptive offset, and adaptive loop filter to the reconstructed block or the reconstructed image. The filter unit 260 may output the reconstructed image. The reconstructed block or the reconstructed image may be stored in the reference picture buffer 270 and used during inter-frame prediction. The reconstructed block processed by the filter unit 260 may be part of a reference image. That is, the reference image is the reconstructed image composed of the reconstructed blocks processed by the filter unit 260. The stored reference image may be used later during inter-frame prediction or motion compensation.

[0144] Figure 3 is a diagram schematically showing the partitioning structure of an image when encoding and decoding the image. Figure 3 Schematically shows an example of partitioning a single unit into multiple lower-level units.

[0145] To effectively partition an image, a coding unit (CU) may be used when encoding and decoding. The coding unit may be used as a basic unit when encoding / decoding an image. In addition, the 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. The coding unit may be a basic unit for prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding processing of transform coefficients.

[0146] Referring to Figure 3 , the image 300 is sequentially partitioned according to the largest coding unit (LCU), and the LCU unit is determined as the partitioning structure. Here, the LCU may be used with the same meaning as the coding tree unit (CTU). Unit partitioning may represent partitioning of the blocks associated with the unit. In the block partitioning information, information on the unit depth may be included. The depth information may represent the number of times or the degree or both the number of times and the degree to which the unit is partitioned. 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 the child nodes of the node, respectively. Each of the partitioned lower-level units may have depth information. The depth information may be information representing the size of the CU and may be stored in each CU. The unit depth represents the number and / or degree related to partitioning of the unit. Therefore, the partitioning information of the lower-level units may include information on the size of the lower-level units.

[0147] The partition structure may represent the distribution of coding units (CUs) within the CTU 310. Such a distribution may be determined based on whether a single CU is partitioned into multiple (positive integers equal to or greater than 2, including 2, 4, 8, 16, etc.) CUs. The horizontal size and vertical size of the CUs generated by the partition may be half of the horizontal size and vertical size of the CU before the partition, respectively, or may have sizes smaller than the horizontal size and vertical size before the partition according to the number of partitions. The CU may be recursively partitioned into multiple CUs. Through recursive partitioning, at least one of the height and width of the CU after partitioning may be reduced compared to at least one of the height and width of the CU before partitioning. The partitioning of the CU may be recursively executed until a predefined depth or a predefined size is reached. For example, the depth of the CTU may be 0, and the depth of the smallest coding unit (SCU) may be the predefined maximum depth. Here, as described above, the CTU may be a coding unit with the maximum coding unit size, and the SCU may be a coding unit with the smallest coding unit size. The partitioning starts from the CTU 310, and when the horizontal size or vertical size or both the horizontal size and vertical size of the CU are reduced by the partition, the CU depth is incremented by 1. For example, for each depth, the size of the unpartitioned CU may be 2N×2N. In addition, in the case of a partitioned CU, a CU with a size of 2N×2N may be partitioned into four CUs with a size of N×N. When the depth is incremented by 1, the size of N may be halved.

[0148] In addition, information indicating whether the CU is partitioned may be represented by using the partition information of the CU. The partition information may be 1-bit information. All CUs except the SCU may include the partition information. For example, when the value of the partition information is the first value, the CU may not be partitioned, and when the value of the partition information is the second value, the CU may be partitioned.

[0149] Referring to Figure 3 , the CTU with a depth of 0 may be a 64×64 block. 0 may be the minimum depth. The SCU with a depth of 3 may be an 8×8 block. 3 may be the maximum depth. The CUs of the 32×32 block and the 16×16 block may be represented as depth 1 and depth 2, respectively.

[0150] For example, when a single coding unit is partitioned into four coding units, the horizontal size and vertical size of the four partitioned coding units may be half the size of the horizontal size and vertical size of the CU before partitioning. In one embodiment, when a coding unit with a size of 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 may be said that the coding unit may be partitioned (quad-tree partitioning) in a quad-tree form.

[0151] For example, when a single coding unit is partitioned into two coding units, the horizontal size or vertical size of the two coding units can be half of the horizontal size or vertical size of the coding unit before partitioning. For example, when a coding unit with a size of 32×32 is partitioned vertically, each of the two partitioned coding units can have a size of 16×32. For example, when a coding unit with a size of 8×32 is horizontally partitioned into two sub-coding units, each of the two sub-coding units can have a size of 8×16. When a single coding unit is partitioned into two coding units, it can be said that the coding unit is partitioned (binary tree partitioning) in a binary tree form.

[0152] For example, when a coding unit is partitioned into three sub-coding units, the horizontal size or vertical size of the coding unit can be partitioned in a 1:2:1 ratio, thereby generating three sub-coding units with a horizontal size or vertical size ratio of 1:2:1. For example, when a coding unit with a size of 16×32 is horizontally partitioned into three sub-coding units, the three sub-coding units can have sizes of 16×8, 16×16, and 16×8 in order from the topmost sub-coding unit to the bottommost sub-coding unit. For example, when a coding unit with a size of 32×32 is vertically divided into three sub-coding units, the three sub-coding units can have sizes of 8×32, 16×32, and 8×32 in order from the leftmost sub-coding unit to the rightmost sub-coding unit. When a coding unit is partitioned into three sub-coding units, it can be said that the coding unit is partitioned by a ternary tree or partitioned according to a ternary tree partitioning structure.

[0153] In Figure 3 the coding tree unit (CTU) 320 is an example of a CTU to which a quadtree partitioning structure, a binary tree partitioning structure, and a ternary tree partitioning structure are all applied.

[0154] As described above, in order to partition a CTU, at least one of a quadtree partitioning structure, a binary tree partitioning structure, and a ternary tree partitioning structure can be applied. Various tree partitioning structures can be sequentially applied to the CTU according to a predetermined priority order. For example, the quadtree partitioning structure can be preferentially applied to the CTU. A coding unit that can no longer be partitioned using the quadtree partitioning structure can correspond to a leaf node of the quadtree. A coding unit corresponding to a leaf node of the quadtree can be used as the root node of a binary tree and / or ternary tree partitioning structure. That is, a coding unit corresponding to a leaf node of the quadtree can be further partitioned according to a binary tree partitioning structure or a ternary tree partitioning structure, or may not be further partitioned. Therefore, by preventing a coding block generated by binary tree partitioning or ternary tree partitioning of a coding unit corresponding to a leaf node of the quadtree from being further partitioned by a quadtree, block partitioning and / or signaling of partitioning information can be effectively performed.

[0155] The fact that a coding unit corresponding to a node of a quadtree is partitioned can be signaled using quadtree partition information. Quadtree partition information having a first value (e.g., "1") can indicate that the current coding unit is partitioned according to a quadtree partition structure. Quadtree partition information having a second value (e.g., "0") can indicate that the current coding unit is not partitioned according to a quadtree partition structure. The quadtree partition information can be a flag having a predetermined length (e.g., one bit).

[0156] There may be no priority between binary tree partitioning and ternary tree partitioning. That is, a coding unit corresponding to a leaf node of a quadtree can be further partitioned by either binary tree partitioning or ternary tree partitioning. In addition, a coding unit generated by binary tree partitioning or ternary tree partitioning can be further partitioned by binary tree partitioning or ternary tree partitioning, or may not be further partitioned.

[0157] A tree structure in which there is no priority between binary tree partitioning and ternary tree partitioning is called a multi-type tree structure. A coding unit corresponding to a leaf node of a quadtree can be used as a root node of a multi-type tree. At least one of multi-type tree partition indication information, partition direction information, and partition tree information can be used to signal whether to partition a coding unit corresponding to a node of a multi-type tree. To partition a coding unit corresponding to a node of a multi-type tree, multi-type tree partition indication information, partition direction, and partition tree information can be signaled sequentially.

[0158] Multi-type tree partition indication information having a first value (e.g., "1") can indicate that the current coding unit will be subjected to multi-type tree partitioning. Multi-type tree partition indication information having a second value (e.g., "0") can indicate that the current coding unit will not be subjected to multi-type tree partitioning.

[0159] 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 can further include partition direction information. The partition direction information can indicate in which direction the current coding unit will be partitioned according to the multi-type tree partition. Partition direction information having a first value (e.g., "1") can indicate that the current coding unit will be vertically partitioned. Partition direction information having a second value (e.g., "0") can indicate that the current coding unit will be horizontally partitioned.

[0160] When a coding unit corresponding to a node of a multi-type tree is partitioned according to a multi-type tree partition structure, the current coding unit can further include partition tree information. The partition tree information can indicate the tree partition structure to be used for partitioning the node of the multi-type tree. Partition tree information having a first value (e.g., "1") can indicate that the current coding unit will be partitioned according to a binary tree partition structure. Partition tree information having a second value (e.g., "0") can indicate that the current coding unit will be partitioned according to a ternary tree partition structure.

[0161] The partition indication information, the partition tree information, and the partition direction information may each be a flag having a predetermined length (e.g., one bit).

[0162] At least any one of the quadtree partition indication information, the multi-type tree partition indication information, the partition direction information, and the partition tree information may be entropy-coded / entropy-decoded. To entropy-code / entropy-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 likelihood that the partition type (partitioned or unpartitioned, 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 / entropy-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 the quad-partition information, the multi-type tree partition indication information, the partition direction information, and the partition tree information.

[0163] As another example, in binary tree partitioning and ternary tree partitioning, binary tree partitioning may be preferentially performed. That is, the current coding unit may first be subjected to binary tree partitioning, and subsequently, the coding unit corresponding to the leaf node of the binary tree may be set as the root node for 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.

[0164] A coding unit that cannot be partitioned according to the quadtree partition structure, the binary tree partition structure, and / or the ternary tree partition structure becomes a basic unit for coding, prediction, and / or transformation. That is, the coding unit cannot be further partitioned for prediction and / or transformation. Therefore, there may be no partition structure information and partition information in the bitstream for partitioning the coding unit into a prediction unit and / or a transformation unit.

[0165] 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 can be recursively partitioned until the size of the coding unit is reduced to be equal to or less than the size of the maximum transform block. For example, when the size of the coding unit is 64×64 and when the size of the maximum transform block is 32×32, the coding unit can be partitioned into four 32×32 blocks for transformation. 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 can be partitioned into two 32×32 blocks for transformation. In this case, the partitioning of the coding unit for transformation is not signaled separately, and the partitioning of the coding unit for transformation can be determined by comparing the horizontal size or vertical size of the coding unit with the horizontal size 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 can be vertically bisected. 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 can be horizontally bisected.

[0166] The information on the maximum size and / or minimum size of the coding unit and the information on the maximum size and / or minimum size of the transform block can be signaled or determined at a higher level of the coding unit. The higher level can be, for example, the sequence level, the picture level, the slice level, etc. For example, the minimum size of the coding unit can be determined as 4×4. For example, the maximum size of the transform block can be determined as 64×64. For example, the minimum size of the transform block can be determined as 4×4.

[0167] The information on the minimum size (quadtree minimum size) of the coding unit corresponding to the leaf node of the quadtree and / or the information on the maximum depth (maximum tree depth of the multi-type tree) from the root node to the leaf node of the multi-type tree can be signaled or determined at a higher level of the coding unit. For example, the higher level can be the sequence level, the picture level, the slice level, etc. The information on the minimum size of the quadtree and / or the information on the maximum depth of the multi-type tree can be signaled or determined for each of the intra-slice and the inter-slice.

[0168] The difference information between the size of the CTU and the maximum size of the transform block can be signaled or determined at a higher level of the coding unit. For example, the higher level can be the sequence level, the picture level, the slice level, etc. The information on 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) can 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) can vary according to the type of the slice. For example, for an intra slice, the maximum size of the ternary tree can be 32×32. For example, for an inter slice, the maximum size of the ternary tree can 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) can be set to the minimum size of the coding block.

[0169] As another example, the maximum size of the binary tree and / or the maximum size of the ternary tree can be signaled or determined at the slice level. Optionally, the minimum size of the binary tree and / or the minimum size of the ternary tree can be signaled or determined at the slice level.

[0170] According to the above various block size information and depth information, the quad-partition information, the multi-type tree partition indication information, the partition tree information, and / or the partition direction information may or may not be included in the bitstream.

[0171] For example, when the size of the coding unit is not greater than the minimum size of the quadtree, the coding unit does not contain the quad-partition information. Therefore, the quad-partition information can be derived from a second value.

[0172] For example, when the size (horizontal size and vertical size) of the coding unit corresponding to a node of the multi-type tree is greater 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, instead of signaling the multi-type tree partition indication information, the multi-type tree partition indication information can be derived from a second value.

[0173] Optionally, when the size (horizontal size and vertical size) of the coding unit corresponding to a node of the multi-type tree is the same as the maximum size (horizontal size and vertical size) of the binary tree, and / or twice as large as the maximum size (horizontal size and vertical size) of the ternary tree, the coding unit may not be further partitioned into a binary tree or a ternary tree. Therefore, instead of signaling the multi-type tree partition indication information, the multi-type tree partition indication information may be derived from a second value. This is because, when partitioning the coding unit according to the binary tree partition structure and / or the ternary tree partition structure, coding units smaller than the minimum size of the binary tree and / or the minimum size of the ternary tree are generated.

[0174] Optionally, when the depth of the coding unit corresponding to a node of the 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, instead of signaling the multi-type tree partition indication information, the multi-type tree partition indication information may be derived from a second value.

[0175] Optionally, the multi-type tree partition indication information may be signaled only when at least one of the vertical binary tree partition, the horizontal binary tree partition, the vertical ternary tree partition, and the horizontal ternary tree partition is feasible for the coding unit corresponding to a node of the multi-type tree. Otherwise, the coding unit may not be partitioned into a binary tree and / or a ternary tree. Therefore, instead of signaling the multi-type tree partition indication information, the multi-type tree partition indication information may be derived from a second value.

[0176] Optionally, the partition direction information may be signaled only when both the vertical binary tree partition and the horizontal binary tree partition or both the vertical ternary tree partition and the horizontal ternary tree partition are feasible for the coding unit corresponding to a node of the multi-type tree. Otherwise, instead of signaling the partition direction information, the partition direction information may be derived from a value indicating possible partition directions.

[0177] Optionally, the partition tree information may be signaled only when both the vertical binary tree partition and the vertical ternary tree partition or both the horizontal binary tree partition and the horizontal ternary tree partition are feasible for the coding tree corresponding to a node of the multi-type tree. Otherwise, instead of signaling the partition tree information, the partition tree information may be derived from a value indicating possible partition tree structures.

[0178] Figure 4 is a diagram showing the intra prediction process.

[0179] Figure 4 The arrows from the center to the outside in may represent the prediction direction of the intra prediction mode.

[0180] Intra coding and / or decoding can be performed by using reference samples of neighboring blocks of a current block. The neighboring blocks can be reconstructed neighboring blocks. For example, intra coding and / or decoding can be performed by using values of reference samples included in the reconstructed neighboring blocks or coding parameters.

[0181] A predicted block can refer to a block generated by performing intra prediction. The predicted block can correspond to at least one of a CU, a PU, and a TU. The unit of the predicted block can have the size of one of a CU, a PU, and a TU. The predicted block can be a square block with a size of 2×2, 4×4, 16×16, 32×32, or 64×64, etc., or can be a rectangular block with a size of 2×8, 4×8, 2×16, 4×16, and 8×16, etc.

[0182] Intra prediction can be performed according to an intra prediction mode for a current block. The number of intra prediction modes that the current block can have can be a fixed value and can be a value determined differently according to attributes of the predicted block. For example, the attributes of the predicted block can include the size of the predicted block and the shape of the predicted block, etc.

[0183] Regardless of the block size, the number of intra prediction modes can be fixed to N. Alternatively, the number of intra prediction modes can be 3, 5, 9, 17, 34, 35, 36, 65, or 67, etc. Optionally, the number of intra prediction modes can vary according to the block size or the color component type or both the block size and the color component type. For example, the number of intra prediction modes can vary according to whether the color component is a luminance signal or a chrominance signal. For example, as the block size becomes larger, the number of intra prediction modes can increase. Optionally, the number of intra prediction modes for a luminance component block can be greater than the number of intra prediction modes for a chrominance component block.

[0184] The intra prediction mode can be a non - angular mode or an angular mode. The non - angular mode can be a DC mode or a planar mode, and the angular mode can be a prediction mode with a specific direction or angle. The intra prediction mode can be represented by at least one of a mode number, a mode value, a mode digit, a mode angle, and a mode direction. The number of intra prediction modes can be M which is equal to or greater than 1, including non - angular and angular modes.

[0185] To perform intra prediction for a current block, a step of determining whether samples included in the reconstructed neighboring blocks can be used as reference samples for the current block can be performed. When there are samples that cannot be used as reference samples for the current block, values obtained by copying or performing interpolation or both copying and interpolation on at least one sample value among the samples included in the reconstructed neighboring blocks can be used to replace the unavailable sample values of the samples. Thus, the replaced sample values are used as reference samples for the current block.

[0186] When performing intra prediction, a filter may be applied to at least one of reference samples and predicted samples based on an intra prediction mode and a current block size / shape.

[0187] In the case of the planar mode, when generating a prediction block of a current block, according to the position of a prediction target sample in the prediction block, a sample value of the prediction target sample may be generated by using a weighted sum of an upper reference sample and a left reference sample of the current sample and an upper-right reference sample and a lower-left reference sample of the current block. In addition, in the case of the DC mode, when generating a prediction block of the current block, an average value of an upper reference sample and a left reference sample of the current block may be used. In addition, in the case of the angular mode, a prediction block may be generated by using an upper reference sample, a left reference sample, an upper-right reference sample, and / or a lower-left reference sample of the current block. To generate a predicted sample value, interpolation of real number units may be performed.

[0188] The intra prediction mode of the current block may be entropy encoded / decoded by predicting the intra prediction mode of a block adjacent to the current block. When the intra prediction mode of the current block is the same as that of an adjacent block, information indicating that the intra prediction modes of the current block and the adjacent block are the same may be signaled by using predetermined flag information. In addition, indicator information of the intra prediction mode that is the same as the intra prediction mode of the current block among the intra prediction modes of a plurality of adjacent blocks may be signaled. When the intra prediction mode of the current block is different from that of an adjacent block, the intra prediction mode information of the current block may be entropy encoded / decoded by performing entropy encoding / decoding based on the intra prediction mode of the adjacent block.

[0189] Figure 5 is a diagram showing intra prediction according to the present invention.

[0190] 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.

[0191] In step S510, the intra prediction mode of the current block may be derived. The intra prediction mode of the current block may be derived by using the following methods: a method using the intra prediction mode of an adjacent block, a method of entropy encoding / decoding the intra prediction mode of the current block from a bitstream, a method using the coding parameters of an adjacent block, and / or a method using the intra prediction mode of a color component. According to the method using the intra prediction mode of an adjacent block, the intra prediction mode of the current block may be derived by using at least one of an intra prediction mode derived by using the intra prediction mode of an adjacent block, a combination of at least one intra prediction mode of an adjacent block, and at least one MPM.

[0192] In step S520, the reference sample may be configured by performing at least one of reference sample selection, reference sample filling, and reference sample filtering.

[0193] In step S530, intra prediction may be performed by performing at least one of non-angle prediction, angle prediction, position information-based prediction, color component-inter prediction, and representative sample-based intra prediction. When performing representative sample-based intra prediction, intra prediction may be performed based on at least one representative sample within a block. Representative sample-based prediction may perform at least one of partitioning the block, determining representative samples, predicting / transforming / quantizing the representative samples, and representative sample-based intra prediction. In step S530, filtering of the predicted samples may be additionally performed.

[0194] 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 a position derived through encoding / decoding. Hereinafter, encoding / decoding may represent entropy encoding and entropy decoding. For example, when the coordinates of the top-left side sample of a current block with size W×H are (0, 0), the neighboring block may be at least one of the blocks adjacent to the blocks with 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 the number of samples of the width (W) and height (H) of the current block.

[0195] The intra prediction mode of an unavailable neighboring block may be replaced with a predetermined intra prediction mode. The predetermined intra prediction mode may be, for example, the DC mode, the planar mode, the vertical mode, the horizontal mode, and / or the diagonal mode. For example, when a neighboring block is outside the boundary of at least one predetermined unit such as a picture, a slice, a parallel block, and a coding tree unit, the neighboring block is inter predicted, or when a neighboring block is encoded in the PCM mode, the corresponding block may be determined to be unavailable. Optionally, when a neighboring block is unavailable, the intra prediction mode of the corresponding block is not replaced and not used.

[0196] The intra prediction mode of the current block may be derived as the intra prediction mode of a neighboring block at a predetermined position or a statistical value of 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, a weighted average value, and interpolation.

[0197] Optionally, the intra prediction mode of the current block may be derived based on the sizes of neighboring blocks. For example, the intra prediction mode of a neighboring block having a relatively large size may be derived as the intra prediction mode of the current block. Optionally, a statistical value may be calculated by assigning a large weight to the intra prediction mode of a block having a relatively large size. Optionally, the mode(s) 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 direction mode, a horizontal direction mode, a diagonal direction mode, and a non-directional mode. The same weight may be assigned to the above-mentioned modes.

[0198] Optionally, whether the intra prediction mode of a neighboring block is an angular mode may be considered. For example, when the intra prediction mode of a neighboring block is a non-angular mode, the non-angular mode may be derived as the intra prediction mode of the current block. Optionally, the intra prediction mode of other neighboring blocks except the non-angular mode may be derived as the intra prediction mode of the current block.

[0199] To derive the intra prediction mode of the current block, one or more most probable mode (MPM) lists may be configured by 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 according to the size or shape or both the size and shape of the current block. The MPM list may be configured not to include overlapping modes. When the number of available candidate modes is less than N, a predetermined candidate mode among the available candidate modes (e.g., a mode obtained by adding or subtracting a predetermined offset to / from an angular mode) may be added to the one or more MPM lists. Optionally, at least one of a horizontal mode, a vertical mode, a 45-degree angular mode, a 135-degree angular mode, a 225-degree angular mode, and a non-directional mode may be added to the MPM list. The predetermined offset may be 1, 2, 3, 4, or a positive integer. An MPM flag indicating whether a mode matching the intra prediction mode of the current block exists in the MPM list may be signaled. When the value of the MPM flag is 1, the MPM index information mpm_idx of the matching mode in 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 for calculating a weighted sum of an intra prediction value and an inter prediction value is performed, 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 the weighted sum operation of the intra prediction value and the inter prediction value is performed, the remaining mode information may not be signaled.

[0200] The MPM list can be configured in a predetermined order based on the positions of neighboring blocks. For example, the predetermined order can be the order of the blocks adjacent to the left side, upper side, lower left corner side, upper right corner side, and upper left corner side of the current block. The non-angular mode can be included at any position in the MPM list. For example, the non-angular mode can be added next to the intra prediction modes of the blocks adjacent to the left side and the upper side.

[0201] The MPM list generated based on the current block can be used as the MPM list for at least one sub-block included in the current block. The order between the candidate modes for 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 component of the current block.

[0202] Optionally, a mode group can be configured by selecting a part of the modes not included in the MPM list. The configured mode group can be used as another list. For example, the mode group can be configured using the modes obtained by sampling at a predetermined interval after arranging the modes that are not MPM candidates or using the modes obtained by adding n (n is an integer equal to or greater than 1) to the MPM candidate modes or subtracting n from the MPM candidate modes.

[0203] When constructing the MPM list, the MPM list can be constructed differently based on at least one element selected from the stripe type, coding mode, and multiple 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 modes, and the default mode. For example, the MPM list for I stripes and the MPM list for P stripes or B stripes are constructed differently. For example, the MPM list for I stripes is constructed by deriving six MPM candidate modes, and the MPM list for P stripes or B stripes 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 the intra mode and the MPM list for the case where the coding mode of the current block is the inter mode are constructed in different ways. The inter mode can include a mode that performs prediction using a weighted sum of the inter prediction value and the intra prediction value. The intra prediction mode used for performing intra prediction in the process of performing prediction using the inter mode can be derived, and the derived mode can 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 at least one of, for example, the DC mode, the planar mode, the horizontal mode, and the vertical mode. For example, in the case of using multiple reference sample lines (i.e., the mrl_index has a non-zero value), the MPM list can be constructed differently. That is, the MPM candidate modes include intra prediction modes that allow prediction based on multiple reference sample lines. When non-directional modes (such as the DC mode and the 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 can be constructed only by using one or more directional modes.

[0204] According to another embodiment of the present invention related to a method of deriving an intra prediction mode, the intra prediction mode of the current block can be derived by using the intra prediction modes of different color components. For example, when the current block is a chrominance block, the intra prediction mode of the luminance block corresponding to the chrominance block can be used to derive the intra prediction mode of the chrominance block. As the luminance block corresponding to the chrominance block, there can be one or more luminance blocks. The corresponding luminance block can be determined based on at least any one of the size, shape, and coding parameters of the chrominance block. Alternatively, the corresponding luminance block can be determined based on at least any one of the size, shape, and coding parameters of the luminance block.

[0205] The luminance block corresponding to a chrominance block may be composed of a plurality of partitions. All or a part of the plurality of partitions may have different intra prediction modes. The intra prediction mode of the chrominance block may be derived based on all or a part of the plurality of partitions included in the corresponding luminance block. In this case, some partitions may be selectively used, where the used partitions are selected based on a comparison of 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 plurality of partitions). Partitions at positions corresponding to a predetermined position in the chrominance block in the luminance block may be selectively used. The predetermined position may refer to the position of a corner sample (e.g., the upper left sample) in the chrominance block or the position of the center sample in the chrominance block.

[0206] The method for deriving the intra prediction mode of a color component block according to the present invention using the intra prediction mode between different color component blocks (i.e., the intra prediction mode between color components) 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 may 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.

[0207] Figure 6 is an exemplary diagram showing the relationship between the luminance block and the chrominance block.

[0208] In Figure 6 the example shown, the sample ratio of the color component is 4:2:0, and at least one of the luminance blocks A, B, C, and D corresponds to one chrominance block.

[0209] Referring to Figure 6 , the intra prediction mode of a chrominance block may 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 chrominance 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 chrominance block. The predetermined position in the chrominance 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 chrominance block may be (W / 2, H / 2), where W is the block width and H is the block height.

[0210] The predetermined position may be selected based on the shape of the chrominance block. For example, for a chrominance block having a square shape, the predetermined position may be the center sample position. For a chrominance block having a rectangular shape, the predetermined position may be the upper left sample position. Optionally, the predetermined position may be the position of the upper left sample in the chrominance block having a square shape or the position of the center sample in the chrominance block having a rectangular shape.

[0211] According to another embodiment, the intra prediction mode of a chrominance block can be derived by using the statistical data of one or more intra prediction modes of a luma block having the same size as the chrominance block.

[0212] In Figure 6 the example shown, the mode corresponding to the average value of the intra prediction modes of luma blocks A and D or the mode corresponding to the average value of the intra prediction modes of blocks A, B, C, and D within the luma block corresponding to the size of the chrominance block is derived as the intra prediction mode of the chrominance block.

[0213] When there are multiple intra prediction modes of available luma blocks, all or a part of the multiple intra prediction modes can be selected. The selection is performed based on a predetermined position in the chrominance block or based on the size, shape, and / or depth of the chrominance block, the luma block, or both the chrominance block and the luma block. The intra prediction mode of the chrominance block can be derived by using the intra prediction mode of the selected luma block.

[0214] For example, the size of luma block A corresponding to the top-left sample position (0, 0) in the chrominance block and the size of luma block D corresponding to the center sample position (nS / 2, nS / 2) in the chrominance block are compared, and the intra prediction mode of luma block D with the larger size can be used to derive the intra prediction mode of the chrominance block.

[0215] Optionally, when the size of the luma block corresponding to a 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 luma block.

[0216] Optionally, when the size of the chrominance block is within a predetermined range, the intra prediction mode of the chrominance block is derived by using the intra prediction mode of the luma block corresponding to the top-left sample position (0, 0) in the chrominance block.

[0217] Optionally, when the size of the chrominance block is within a predetermined range, the size of the luma block corresponding to the predetermined position (0, 0) of the chrominance block and the size of the luma block arranged at another predetermined position (nS / 2, nS / 2) of the chrominance block are compared, and the intra prediction mode of the chrominance block is derived by using the intra prediction mode of the luma block with the larger size.

[0218] The predetermined range can be derived from at least any one of the information signaled by the bitstream, the information of the size (and / or depth) of the block (chrominance block, luma block, or both the chrominance block and the luma block), and the information predefined in the encoder or decoder.

[0219] Optionally, when the chrominance block has a rectangular shape, the intra prediction mode of the chrominance 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 chrominance block.

[0220] Among the multiple partitions of the luma block, a partition having the same shape as the chrominance block may be used. For example, when the chrominance block is square-shaped or non-square-shaped, a partition having a square shape or a non-square shape selected from among the multiple partitions of the luma block may be used.

[0221] In the example described with reference to Figure 6 the method of deriving the intra prediction mode of the chrominance block by 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 chrominance block as it is. The method of deriving the intra prediction mode of the chrominance block is not limited to the method of using the intra prediction mode of the corresponding luma block. For example, the intra prediction mode of the chrominance block may be derived from information for deriving the intra prediction mode of the luma block including an MPM list and an MPM index mpm_idx.

[0222] Optionally, the intra prediction mode of the luma block corresponding to the sample at a predetermined position in the chrominance block may be used to construct the MPM list of the chrominance block. In this case, the mpm_idx information of the chrominance block may be encoded and signaled. The MPM list of the chrominance block may be constructed in a manner similar to the construction of the MPM list of the luma block. The MPM candidates of the chrominance block may include the intra prediction modes of neighboring chrominance blocks and / or the intra prediction mode of the luma block corresponding to the chrominance block.

[0223] When the MPM flag is 0, a second MPM list including at least one intra prediction mode may be configured, and the intra prediction mode of the current block may be derived by using a 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 may be encoded / decoded. Similar to the first MPM list, the second MPM list may be configured by using the intra prediction modes of neighboring blocks. Here, the intra prediction modes 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 may be used.

[0224] When the intra prediction mode of the current block is not included in one of the multiple MPM lists, the intra prediction mode of the luma component of the current block may be encoded / decoded. In addition, the intra prediction mode of the chrominance component may be derived based on the associated intra prediction mode of the luma component and encoded / decoded.

[0225] When the current block is partitioned into multiple sub - blocks, at least one of the described methods can be applied to derive the intra - prediction mode for each sub - block.

[0226] The size or shape or both the size and shape of the sub - block can be a predetermined size or shape or both (e.g., 4×4), or can be determined according to the size or shape or both the size and shape of the current block. Optionally, the size of the sub - block can be determined based on whether the neighboring blocks of the current block are partitioned, or the size of the sub - block can be determined based on the intra - prediction mode of the neighboring blocks of the current block. For example, the current block can be partitioned based on the boundaries with different intra - prediction modes of the neighboring blocks. Optionally, the current block can be partitioned based on whether the neighboring blocks are intra - coded blocks or inter - coded blocks.

[0227] An indicator (e.g., NDIP_flag) indicating that the intra - prediction mode of the current block is derived by using the intra - prediction mode of the neighboring blocks can be encoded / decoded. The indicator can be encoded / decoded according to at least one unit in the current block and the sub - block. Here, when the size of the current block or sub - block corresponds to a predetermined size or a predetermined size range, the indicator can be encoded / decoded.

[0228] An operation of determining whether the size of the current block corresponds to a predetermined size can 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, it is determined that the size of the current block corresponds to a predetermined size.

[0229] The intra - prediction information can be signaled by at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), an adaptive parameter set (APS), a slice header, and a parallel block header. In the case of a predetermined block size or a smaller size, at least one piece of intra - prediction information can be not signaled. Here, the intra - prediction information of a previously encoded / decoded block (e.g., an upper - layer block) can be used.

[0230] The reference samples for intra - prediction can be configured based on the derived intra - prediction mode. In the following description, the current block can represent a prediction block or a sub - block with a size / shape smaller than that of the prediction block. The reference samples can be configured by using at least one reconstructed sample adjacent to the current block or by using a combination of samples. Additionally, filtering can be applied to the configured reference samples.

[0231] The number or position or both the number and position of the reconstructed sample lines for configuring reference samples may vary according to the position of the current block within the coded tree block. Each reconstructed sample on multiple reconstructed sample lines may be used as a reference sample as it is. Optionally, a predetermined filter may be applied to the reconstructed samples, and reference samples may be generated by using the filtered reconstructed samples. The reconstructed samples to which the filter is applied may be included in the same reconstructed sample line or different reconstructed sample lines.

[0232] 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.

[0233] When the indicator indicates that multiple reference sample lines are used, a reference sample line index is also signaled. For example, mrl_index is signaled. Thus, which reference sample lines are used can be determined.

[0234] 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 correspond to the reconstructed sample lines 1 to reconstructed sample line 4 shown respectively in Figure 7 correspond to the reconstructed sample lines 1 to reconstructed sample line 4 shown respectively.

[0235] The indicator mrl_index is signaled based on at least one of the intra prediction mode of the current block, the MPM information, the size (width and height), the presence or absence of the upper boundary of the CTU, and the color component. When the indicator mrl_index is not signaled, the first reference sample line adjacent to the current block is used.

[0236] For example, when the intra prediction mode is a predetermined mode, the indicator mrl_index may be signaled. The intra prediction mode may be at least one of the intra prediction modes of the respective neighboring blocks or the intra 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 prediction mode of a neighboring block adjacent to the left boundary or the upper boundary of the current block is one of the directional modes, the indicator mrl_index may be signaled. Optionally, when the intra 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.

[0237] 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 MPM candidates. For example, when the MPM flag for the intra prediction mode of the current block indicates a match, the indicator mrl_index may be signaled. Optionally, when there is any directional prediction mode in the MPM candidate list or when there is only a directional prediction mode in the MPM candidate list, the indicator mrl_index may be signaled. Optionally, when there is any non-directional prediction mode in the MPM candidate list, the indicator mrl_index may be signaled. Optionally, the MPM information of the current block may be signaled differently according to 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-zero value, the MPM index may be signaled, and the MPM index may be used to derive the intra prediction mode of the current block. For example, when the indicator mrl_index has a non-zero value, the MPM mode may be determined without parsing the MPM flag.

[0238] 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 (e.g., 4), the indicator mrl_index may be signaled.

[0239] For example, the indicator mrl_index may be signaled according to 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.

[0240] For example, when the color component of the current block is a luminance signal, the indicator mrl_index may be signaled, and when the color component is a chrominance signal, the indicator mrl_index may not be signaled.

[0241] Optionally, the indicator mrl_index indicates a reference sample line that may 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.

[0242] When multiple reference sample lines are used, it is determined whether to apply filtering for each reference sample line. For example, based on the intra prediction mode and the block size / shape, filtering can be applied to the first reference sample line adjacent to the current block, while filtering may not be applied to the second reference sample line and subsequent reference sample lines around the current block. Optionally, filtering can be applied to only one reference sample line. For example, filtering can be applied only to the left reference sample line or the upper reference sample line. Which reference sample line to filter can be determined based on at least one of the shape, size, and intra prediction mode of the current block. The shape of the current block can be determined based on the size comparison between the width and height of the current block or the ratio of the width and height.

[0243] The configured reference samples can be represented as ref[m, n], and the samples obtained by applying the filter to the configured reference samples can be represented as rec[m, n]. Here, m or n can be a predetermined integer value representing the sample position. When the position of the upper left sample within the current block is (0, 0), the position of the upper left reference sample of the current block can be set to (-1, -1).

[0244] Figure 7 is a diagram for describing multiple reconstructed sample lines.

[0245] Reference samples can be constructed by selecting one or more reconstructed sample lines adjacent to the current block. For example, in Figure 7 , one of the multiple reconstructed sample lines can be selected to construct a reference sample.

[0246] A specific reconstructed sample line among the multiple reconstructed sample lines can be selected fixedly or adaptively, or any one of the reconstructed sample lines can be selected adaptively to construct the reconstructed sample.

[0247] In another embodiment, to construct a reference sample, one or more reconstructed sample lines can be selected from the multiple reconstructed sample lines shown in Figure 7 , and the selected reconstructed sample lines can be combined.

[0248] For example, as shown in Equation 1, a weighted average of the reconstructed samples can be used to construct a reference sample, where the weights of the reconstructed samples are different according to the distance between the reconstructed samples and the current block.

[0249] [Equation 1]

[0250] ref[-1,-1] = (rec[-2,-1] + 2 × rec[-1,-1] + rec[-1,-2] + 2) >> 2

[0251] ref[x,-1] = (rec[x,-2] + 3 × rec[x,-1] + 2) >> 2, (x = 0 to W + H - 1)

[0252] ref[-1, y] = (rec[-2, y] + 3 × rec[-1, y] + 2) >> 2, (y = 0 to W + H - 1)

[0253] Optionally, at least one of the average value, maximum value, minimum value, median value, and mode value of multiple reconstructed samples may be used to construct a reference sample based on at least one of the distance from the current block to the corresponding reconstructed sample and the intra-frame prediction mode of the current block.

[0254] Optionally, a reference sample may be constructed based on the change (change amount) between each of the sample values of consecutive reconstructed samples. For example, a reference sample may be constructed based on at least one of determining whether the values of two consecutive reconstructed samples differ by more than a threshold and determining whether the values of consecutive reconstructed samples change continuously or discontinuously. For example, when the value of rec[-1, -1] differs from the value of rec[-2, -1] by more than the threshold, the value of ref[-1, -1] may be determined to have the value of rec[-1, -1] or a value corresponding to the 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 value of the values of consecutive reconstructed samples changes by n, so the value of ref[-1, -1] may be expressed as "ref[-1, -1] = rec[-1, -1] - n".

[0255] In different embodiments, with reference to Figure 7 , two or more reconstructed sample lines may be selected to construct a reference sample. For example, two lines including reconstructed sample line 1 and reconstructed sample line 2 may be fixedly selected, or four lines from reconstructed sample line 1 to reconstructed sample line 4 may be selected to construct a reference sample.

[0256] Optionally, two or more reconstructed sample lines may be adaptively selected to construct a reference sample. For example, one reconstructed sample line may be fixedly selected, and one or more reconstructed sample lines may be adaptively selected from other reconstructed sample lines to construct a reference sample.

[0257] The reconstructed sample lines that are fixedly selected may be predefined in the encoder / decoder. For the case where the reconstructed sample lines that are fixedly selected are predefined, information about the reconstructed sample lines that are fixedly selected may not be signaled.

[0258] Information about the adaptively selected reconstructed sample lines may be signaled in the form of indicators or indices. The adaptively selected reconstructed sample lines may be determined based on at least one of the coding parameters of the current block or a block adjacent to the current block. For example, the adaptively selected reconstructed sample lines may be determined based on at least one of the size / shape and the intra prediction mode of the current block or a block adjacent to the current block. In such a case, the information required for selection may not be signaled.

[0259] The reference sample lines may include one or more samples. For example, the reference sample lines may include samples corresponding to a length equal to the width (i.e., horizontal size) or height (i.e., vertical size) of the current block. As another example, the reference sample lines may include samples corresponding to a length that is twice the width or height of the current block. As another example, the reference sample lines may include samples corresponding to a length equal to the sum of twice the number of N samples (N is 1, 2, 3,...) and the width and height of the current block. That is, the reference sample lines 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).

[0260] The method of constructing the reference samples adjacent to the upper part of the current block and the method of constructing the reference samples adjacent to the left side of the current block may be different. For example, the number of reference sample lines located above the current block and the number of reference sample lines located to the left of the current block may be different. For example, according to 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 upper part of the current block may be 1, and the number of reference sample lines adjacent to the left part of the current block may be 2. For example, the length of the reference sample lines above the current block and the length of the reference sample lines located to the left of the current block may be different. For example, the length of the reference sample lines may vary according to at least one of the intra prediction mode of the current block and the width or height of the current block.

[0261] Each reference sample line may have a different length. For example, referring to Figure 7 , the lengths of the reconstructed sample lines 2 to 4 may be longer than the length of the reconstructed sample line 1 by a length corresponding to one or more samples.

[0262] 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 a length corresponding to m samples. In Figure 7 the example shown, the reconstructed sample line n is longer than the reconstructed sample line n - 1 by a length corresponding to one sample.

[0263] As described above, decision information regarding whether to use only the most recent reference sample line or multiple reference sample lines to construct reference samples can be encoded / decoded. For example, the decision information can be encoded / decoded at the level of at least one of a sequence, a picture, a slice, a parallel block, a CTU, a CU, a PU, and a TU. Additionally, information regarding the availability of each reference sample line among multiple reference sample lines can be signaled at a higher level.

[0264] When the top boundary or left boundary of the current block corresponds to the boundary of at least one of a picture, a slice, a parallel block, and a coding tree block (CTB), at least one of the number, position, and configuration of the reconstructed sample lines used in reference sample construction can be set differently. For example, when constructing two or more reference sample lines, when the top boundary of the current block corresponds to the boundary of at least one of a picture, a parallel block, a slice, and a coding tree block (CTB), one reference sample line adjacent to the upper part of the current block can be constructed. For example, when the top boundary of the current block corresponds to the top boundary of the CTU, one reference sample line can be configured, otherwise, two or more reference sample lines can 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 for storing the reference sample data of the reference sample lines can be reduced.

[0265] When selecting reference samples, availability determination and reference sample filling can 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 can be used. On the other hand, when the block containing the reference samples is unavailable, one or more available neighboring reference samples can be used to fill the unavailable reference samples in the block.

[0266] When a reference sample is located outside the boundary of at least one of a picture, a parallel block, a slice, or a coding tree block (CTB), the reference sample can be determined to be unavailable. When encoding the current block using constrained intra prediction (CIP), the reference sample is determined to be unavailable in the case where the block including the reference sample has been encoded / decoded in an inter prediction mode.

[0267] Figure 8 It is a diagram for describing the process of replacing unavailable samples with available samples.

[0268] When it is determined that a reconstructed neighboring sample is unavailable, the unavailable sample can be replaced with a reconstructed neighboring sample that is an available sample. For example, as Figure 8 shown, when there are both available samples and unavailable samples, one or more available samples can be used to replace one or more unavailable samples.

[0269] The sample values of unavailable samples can be replaced with the values of available samples in a predetermined order. The available samples used to replace the unavailable samples can be the available samples adjacent in position to the unavailable samples. When there are no available samples adjacent to the unavailable samples, the earliest or the closest available samples can be used to replace the unavailable samples. The replacement order of the unavailable samples can be, for example, from the lower left to the upper right. Optionally, the replacement order can be from the upper right to the lower left. In particular, the replacement order can be from the upper left to the upper right and / or to the lower left. Optionally, the replacement order can be from the upper right and / or from the lower left to the upper left.

[0270] For example, filling the unavailable samples with the values of the available samples can start from position 0, where position 0 is the lower left sample position. That is, the first four unavailable samples can be filled with the value "a", and the subsequent 13 unavailable samples can be filled with the value "b".

[0271] For example, the unavailable samples can be filled with the combined values of the available samples. For example, the unavailable samples can be filled with the average value or interpolation of the available samples adjacent to both ends of the line of the unavailable samples respectively. That is, the first four unavailable samples can be filled with the value "a", and the next 13 unavailable samples can be filled with the average value of the values "b" and "c", or the next 13 unavailable samples can be filled by interpolating the values "b" and "c".

[0272] Optionally, any intermediate value between the sample values "b" and "c" of the available samples can be used to fill in the 13 unavailable samples. In this case, different corresponding values can be used to fill in the unavailable samples. For example, as the distance of the unavailable sample to the available sample with the value "a" decreases, a value closer to the value "a" will be used to fill in the unavailable sample. For example, the closer the unavailable sample is to the available sample with the value "b", the closer the value used to fill in the unavailable sample is to the value "b". That is, 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 the available samples, one or more replacement methods including the above method can be adaptively used. The method of replacing the unavailable samples with the available samples can be signaled as information included in the bitstream, or can be predetermined in the encoder / decoder. Optionally, the replacement method can be derived according to 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 the threshold, and / or when the number of unavailable samples is greater than the threshold, the unavailable samples can be replaced with different values from each other. The selection of the method of replacing the unavailable samples with the available samples can be performed based on each predetermined unit. For example, the selection of replacement can be based on each video, each sequence, each picture, each slice, each parallel block, each coding tree unit (CTU), each coding unit (CU), each prediction unit (PU), each transform unit (TU), or each block. At this time, the selection of the method of replacing the unavailable samples with the available samples can be determined according to the information signaled based on each predetermined unit, or the selection of the method of replacing the unavailable samples with the available samples can be derived based on each predetermined unit. Optionally, the method of selecting the replacement method can be predetermined in the encoder / decoder.

[0273] When the reference sample is located at a predetermined position, filling can be automatically performed without determining whether the block including the reference sample is available. For example, referring to Figure 7 , when the position (x, y) of the top-left 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)), it may not be possible to determine the sample availability, and the sample can be filled with a neighboring reference sample.

[0274] For example, without performing an availability determination on the sample ref[W+H, -2], the value of the sample ref[W+H-1, -2] can be used to fill the sample ref[W+H, -2]. As another example, without performing an availability determination on the sample [W+H, -3], the value of the sample ref[W+H-1, -3] can be used to fill the sample ref[W+H, -3]. That is, without performing an availability determination on samples located at positions (x, y: x is equal to or greater than W+H or y is equal to or greater than W+H), samples located at positions (x, y: x is equal to or greater than W+H or y is equal to or greater than W+H) can be filled by using the closest sample on the same sample line.

[0275] When the position of the top-left sample of the current block is (0, 0), for samples located at positions (x, y: x is equal to or greater than W and less than W+H) among the samples above the current block, an availability determination will be performed, and then filling will be performed according to the result of the availability determination. For samples located at positions (x, y: y is equal to or greater than H and less than W+H) among the samples to the left of the current block, an availability determination will be performed, and filling will be performed according to the availability determination.

[0276] For example, when the position of the top-left sample of the current block is (0, 0), an availability determination and filling can be performed for samples corresponding to rec[x, -1] (x ranging from -1 to W+H-1) and / or samples corresponding to rec[-1, y] (y ranging from 0 to H+W-1).

[0277] For filling, multiple reference sample lines can be used. For example, when filling the first reference sample line adjacent (i.e., closest) to the current block, the second reference sample line that is the second-closest to the current block can be used. For example, filling can be performed according to Equation 2. That is, the sample value of the first reference sample line can be derived by using the weighted average of the sample selected from the first reconstructed sample line and the sample selected from the second reconstructed sample line. In this case, the selected reconstructed samples can be samples located at the current sample position or positions adjacent to the current sample position.

[0278] [Equation 2]

[0279] ref[x, -1] = (rec[x, -2] + 3×rec[x, -1] + 2) >> 2, (x = 0 ~ H+W-1)

[0280] Filtering can be performed on one or more reference samples among the samples constructed as above. Filtering can be adaptively performed based on 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. For example, at least one of the determination of whether to apply filtering, the filter type, the filter strength, and the filter coefficients can be adaptively determined.

[0281] For example, it can be determined whether to apply filtering for each of a plurality of reference sample lines. For example, filtering can be applied to a first reference sample line adjacent to the current block and not applied to a second reference sample line. For example, both the filtered value and the unfiltered value can be used for the same reference sample.

[0282] For example, at least one of a 3-tap filter, a 5-tap filter, a 7-tap filter, and an N-tap filter can 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.

[0283] For example, filters with different shapes can 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.

[0284] The shape of the current block can 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 decision on whether to apply a filter, the filter type, the filter strength, and the filter coefficients can be adaptively determined according to whether the current block is a horizontal rectangular block or a vertical rectangular block. Optionally, at least one of the decision on whether to apply filtering, the filter type, the filter strength, and the filter coefficients can be adaptively determined according to whether the current block is a rectangular block or a square block.

[0285] Intra prediction for the current block can be performed based on the derived intra prediction mode and the constructed reference samples.

[0286] For example, non-directional intra prediction can be performed on the current block. The mode of non-directional intra prediction can be at least one of the DC mode, the plane mode, and the LM mode.

[0287] For the DC mode, prediction can be performed using the average value of one or more reference samples among the constructed reference samples. In this case, filtering can be applied to one or more prediction samples (also referred to as predicted samples) located at the boundary of the current block. DC prediction can be adaptively performed based on at least one of the size of the current block and the shape of the current block. In addition, the range of reference samples used in the DC mode can be determined based on at least one of the size and shape of the current block.

[0288] Figure 10 It is a diagram for describing intra prediction according to the shape of the current block.

[0289] For example, when the current block is a square block, as Figure 10As shown in (a) thereof, DC prediction can be performed by using the average value of a reference sample located above the current block and a reference sample located to the left of the current block.

[0290] For example, when the current block is a non-square block, neighboring samples adjacent to the left end and the upper end of the current block can be selectively used. When the current block is a rectangular block, as Figure 10 shown in (b) thereof, prediction can be performed by using the average value of reference samples adjacent to the longer side among the left side and the upper side of the current block.

[0291] 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 the 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 can 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 can be the same as or different from each other. The predetermined range can represent a threshold for selecting reference samples for predicting the current block. The threshold can be set using at least one of a minimum value and a maximum value. The minimum value and / or the maximum value can be one or more fixed values preset in the encoder / decoder, or one or more variable values signaled after being encoded by the encoder.

[0292] For example, one or more average values can 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 and a second average value can be used, where 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 can be the first average value or the second average value. Optionally, the DC prediction value of the current block can 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 can be the same (i.e., 1:1).

[0293] According to the above method, shift operations can be used to calculate all DC values. For example, even when the sample length representing the width, height, or the sum of the width and height of the current block is not a power of 2, the method can be used. The method can be applied to both luminance DC prediction and chrominance DC prediction. Optionally, the method can be applied to luminance DC prediction or chrominance DC prediction.

[0294] For example, when the current block is a non-square block, prediction can be performed based on the width or height of the current block. For example, the prediction value can be obtained by dividing the sum of the values of the upper reference sample and 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 one of the width and the height can be performed by a shift operation.

[0295] For example, multiple reference sample lines can be used to perform DC prediction. For example, as Figure 10 shown in (c) of, two reference sample lines can be used to perform prediction.

[0296] For example, the average value of the reference samples included in the two reference sample lines can be determined as the DC prediction value of the current block.

[0297] Optionally, different weights can be applied to the reference samples of the first adjacent line and the reference samples of the second adjacent line of the current block. For example, the weighted average of each sample in the first reference sample line and each sample in the second reference sample line is calculated by applying a weight of 3:1 to each sample in the first reference sample line and each sample in the second reference sample line (i.e., (3×the reference sample of the first line + the reference sample of the second line + 2) >> 2), and the average value of the weighted averages can be determined as the DC prediction value of the current block. Optionally, the result value of ((3×the reference sample of the first line - the reference sample of the second line) >> 1) can be obtained, and the average value of these values can be determined as the DC prediction value of the current block. The weights are not limited to the above examples, and any weights can be used. In this case, the closer the 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 can be used for prediction.

[0298] For the planar mode, prediction can be performed according to a weighted sum that is a function of the distance from at least one reference sample to the intra-prediction target sample located in the current block.

[0299] Filtering can be performed on the reference samples of the current block or the predicted samples of the current block (i.e., the predicted samples). For example, after filtering is applied to the reference samples, planar prediction can be performed, and then filtering can be performed on one or more predicted samples. Among the predicted samples, filtering can be performed on the samples in one, two, or N sample lines located at the top boundary or the left boundary of the current block.

[0300] To perform planar prediction, a weighted sum of one or more reference samples can be used. For example, as Figure 10 shown in (d) of, 5 reference samples can be used. For example, to generate a predicted sample at the target position [x, y], the 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 predicted 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).

[0301] [Equation 3]

[0302] pred[x, y] = (a × r[-1, -1] + b × r[x, -1] + c × r[-1, y] + d × r[W, -1] + e × r[-1, H]) >> N

[0303] As another example, multiple reference sample lines can be used to perform planar prediction. For example, the weighted sum of two reference sample lines can be used to perform planar prediction. As another example, the weighted sum of reference samples in two reference sample lines can be used to perform planar prediction. 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 the weighted sum of the selected reference samples, and in this case, the same weights as those used for DC prediction can be used.

[0304] The direction prediction mode refers to at least one of a horizontal mode, a vertical mode, and an angular mode with a predetermined angle.

[0305] In the horizontal mode or the vertical mode, one or more reference samples arranged along a straight line direction (i.e., the horizontal direction or the vertical direction) are used to perform prediction. Multiple reference sample lines can be used. For example, when two reference sample lines are used, two reference samples arranged in a horizontal line or a vertical line can be used to perform prediction. Similarly, when N reference sample lines are used, N reference samples in a horizontal line or a vertical line can be used.

[0306] For the vertical mode, the statistical values of the first reference sample on the first reference sample line (e.g., r[x, -1]) and the second reference sample on the second reference sample line (e.g., r[x, -2]) can be used to perform direction prediction.

[0307] For example, the predicted value of the vertical mode can be determined by calculating the result value of (3 × r[x, -1] + r[x, -2] + 2) >> 2. Optionally, the predicted value of the vertical mode can be determined by calculating the result value of (3 × r[x, -1] - r[x, -2] + 1) >> 1. In another alternative, the predicted value of the vertical mode can be determined by calculating the value of (r[x, -1] + r[x, -2] + 1) >> 1.

[0308] For example, the variation between each sample point value on a vertical line may be considered. For example, the predicted value of 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. Optionally, N may increase as the y coordinate of the predicted target sample point increases. For example, N = y + 1.

[0309] Even for the horizontal mode, one or more methods for the vertical mode may be used.

[0310] For an angular mode of a specific angle, prediction may be performed using one or more reference sample points arranged in an inclined direction from the intra-prediction target sample point of the current block or one or more sample points adjacent to the reference sample points located in the inclined direction. In this case, a total of N reference sample points may be used, where N may be 2, 3, 4, 5, or 6. Prediction may also be performed by applying at least one of the N-tap filters to the N reference sample points. Examples of the N-tap filter include a 2-tap filter, a 3-tap filter, a 4-tap filter, a 5-tap filter, and a 6-tap filter. At this time, at least one of the reference sample points may be located above the current block, and the remaining reference sample points may be located to the left of the current block. The reference sample points located above the current block (or the reference sample points located to the left of the current block) may be on the same line or on different lines.

[0311] According to another embodiment, intra-prediction may be performed based on position information. In this case, the position information may be encoded / decoded, and the reconstructed sample point block located at the above position may be derived as the intra-prediction block of the current block. Optionally, the decoder may search for a block similar to the current block, and the found block may be derived as the intra-prediction block of the current block. The search for the similar block may be performed in the encoder or the decoder. The range (search range) for performing the search may be limited to a predetermined range. For example, the search range may be limited to the reconstructed sample point blocks within the picture including the current block. Optionally, the search range may be limited to include the CTU of the current block or limited to a predetermined CU. That is, intra-prediction based on position information may be performed by searching for a block similar to the current block among the reconstructed samples within the CTU. A template may be used to perform the search. For example, one or more reconstructed sample points adjacent to the current block are used as a template, and sample points similar to the template are searched for in the CTU.

[0312] When the CTU consists of only intra-coding modes or when the luminance block and the chrominance block have different partitioning structures, intra prediction based on position information can be performed. For example, for inter prediction available stripes (e.g., P or B stripes), information indicating that the current CTU consists of only intra-coding modes can be signaled. In this case, when this information indicates that the current CTU consists of only intra-coding modes, intra prediction based on position information can be performed. Optionally, when the luminance block and the chrominance block in the current CTU have different partitioning structures (e.g., when the value of dual_tree or separate_tree is 1), intra prediction based on position information can be available. On the other hand, when the CTU includes intra-coded blocks and inter-coded blocks or when the luminance block and the chrominance block have the same partitioning structure, intra prediction based on position information may not be available.

[0313] According to another embodiment, intra prediction between color components is performed. For example, intra prediction of a chrominance component can be performed from the corresponding reconstructed luminance component of the current block. Optionally, intra prediction of one chrominance component Cr can be performed from the corresponding reconstructed chrominance component Cb of the current block.

[0314] Intra prediction between color components includes a color component block reconstruction step, a prediction parameter derivation step, and / or an intra prediction execution step between color components. The term "color component" can 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 can be performed by 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 can include at least any one of an original signal, a reconstructed signal, a residual signal, and a prediction signal.

[0315] When performing intra prediction on a second color component target block, the samples of the corresponding first color component corresponding block of the second color component target block, the samples of the neighboring blocks of the first color component corresponding block, or both the samples of the corresponding first color component corresponding block of the second color component target block and the samples of the neighboring blocks of the first color component corresponding block can be used. For example, when performing intra prediction on a chrominance component block Cb or Cr, the reconstructed luminance component block Y corresponding to the chrominance component block Cb or Cr can be used.

[0316] When predicting a chrominance component based on a luminance component, the prediction can be performed according to Equation 4.

[0317] [Equation 4]

[0318] Pred C (i, j) = α · rec L ’(i, j) + β

[0319] In Equation 4, Pred C(i, j) represents the predicted chrominance sample of the current block, and rec L (i, j) represents the reconstructed luma sample of the current block. At this time, rec L ’(i, j) can be the downsampled reconstructed luma sample. The parameters α and β can be derived by minimizing the regression error between the reconstructed neighboring luma samples and the reconstructed neighboring chrominance samples around the current block.

[0320] There are two modes for predicting the chrominance component using the luma component. The two modes may include a single model mode and a multi-model mode. When predicting the chrominance component from the luma component of the current block, the single model mode may use one linear model. The multi-model mode may use two linear models.

[0321] In the multi-model mode, the samples adjacent to the current block (i.e., adjacent luma samples and adjacent chrominance samples) can be classified into two groups. That is, the parameters α and β can be derived for each of the two groups. In addition, the luma samples of the current block can be classified according to the rule for classifying the luma samples adjacent to the current block.

[0322] For example, a threshold for classifying adjacent samples into two groups can be calculated. The average value of the reconstructed adjacent luma samples can be used to calculate the threshold. However, the calculation of the threshold is not limited to this. In addition to the average value, at least one of various statistical values recognized in this specification can also be used. When the value of an adjacent sample is greater than the threshold, the adjacent sample can be classified into the first group. Otherwise, the adjacent sample can be classified into the second group.

[0323] Although the multi-model mode is described as using two linear models in the above embodiments, the present invention is not limited to this, and can cover other cases using two or more linear models. When using N linear models, the samples can be classified into N groups. For this purpose, N - 1 thresholds can be calculated.

[0324] As described above, when predicting the chrominance component from the luma component, a linear model can 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 can 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.

[0325] Figure 11 is a diagram for describing the "neighboring samples of the current block" (hereinafter referred to as "adjacent data set") for deriving the parameters of the model.

[0326] The adjacent data set for deriving the parameters of LM1 can consist of a pair of samples, which includesFigure 11 The luminance samples and chrominance samples in each of line region B and line region C shown in. The adjacent data sets for deriving the parameters of LM2 and LM3 can be composed of a pair of samples, and the pair of samples includes those in Figure 11 the luminance samples and chrominance samples in each of line region B, line region C, line region E, and line region F shown in.

[0327] However, the adjacent data sets are not limited to the above examples. For example, in order to cover various linear relationships between the luminance samples and chrominance samples in the current block, N adjacent data sets can be used for each mode. For example, N can be an integer of 2 or greater, particularly 3.

[0328] Both the upper template and the left template can be used to calculate the parameters of the linear model. 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 the LM_A mode and the LM_L mode respectively. That is, in the LM_A mode, only the upper template can be used to obtain the linear model parameters. When the position of the top-left sample of the current block is (0, 0), the upper template can be extended to the 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 the LM_L mode, only the left template can be used to obtain the linear model parameters. The left template can be extended to the range from (-n, 0) to (-n, H + W - 1). In this case, n is an integer equal to or greater than 1.

[0329] The power of two sample numbers can be used to derive the parameters of the linear model. When the current chrominance block is a non-square block, the samples for deriving the parameters of the linear model can be determined based on the number of samples on the shorter side of the horizontal side and the vertical side of the current block. According to one embodiment, when the size of the current block is n×m (where n > m), for example, m samples can be selected from the n adjacent samples adjacent to the top boundary of the current block by uniformly performing subsampling. In this case, the number of samples for deriving 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 samples among the n adjacent samples adjacent to the top boundary of the current block may not be used. For example, among the n samples, the m samples farthest from the shorter side of the horizontal side and the vertical side of the current block may not be used. In this case, the number of samples for deriving the parameters of the linear model can be n (n - m samples adjacent to the top boundary of the current block + m samples adjacent to the left boundary of the current block).

[0330] Optionally, when performing intra prediction on a chrominance component block Cr, the chrominance component block Cb may be used. Optionally, when performing intra prediction on a fourth color component block, at least one of all the first color component block, the second color component block, and the third color component block corresponding to the fourth color component block may be used.

[0331] Whether to perform intra prediction between color components may 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 a coding tree unit (CTU), greater than a predetermined size, or within a predetermined size range, intra prediction between color components of the target block may be performed. Optionally, when the shape of the target block is a predetermined shape, intra prediction between color components of the target block may be performed. The predetermined shape may be a square. In this case, when the target block has a rectangular shape, intra prediction between color components of the target block may not be performed. Additionally, when the predetermined shape is a rectangular shape, the above embodiments operate conversely.

[0332] Optionally, whether to perform intra prediction between color components on a prediction target block may be determined based on at least any one of the coding parameters of at least any one block selected from the corresponding block corresponding to the prediction target block and the neighboring blocks of the corresponding block. For example, when the corresponding block has been predicted by an intra prediction method in a constrained intra prediction (CIP) environment, intra prediction between color components of the prediction target block may not be performed. Optionally, when the intra prediction mode of the corresponding block is a predetermined mode, intra prediction between color components of the prediction target block may be performed. Further optionally, whether to perform intra prediction between color components may be determined based on at least any one of the CBF information of the corresponding block and the CBF information of the neighboring blocks of the corresponding block. The coding parameters are not limited to the prediction mode of the block, but various parameters available for encoding / decoding may be used.

[0333] The color component block reconstruction step will be described below.

[0334] When predicting a second color component block by using a first color component block, the first color component block may 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 by using a first color component block having a different size from the second color component block, the first color component block may be reconstructed such that the block size of the first color component is equal to the block size of the second color component. 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 neighboring blocks of the first color component block. Figure 12 is an exemplary diagram showing the process of reconstructing a color component block.

[0335] In Figure 12In (a) thereof, p1[x, y] represents a sample at the position (x, y) in the first color component block. In Figure 12 In (b) thereof, p1’[x, y] represents a sample at the position (x, y) in the reconstructed block generated by reconstructing the first color component block.

[0336] When the size of the first color component block is larger than the size of the second color component block, downsampling is performed on the first color component block to have a size equal to that 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 Equation 5 to Equation 9 can be used. In the case where any one of various downsampling methods is selectively used, the encoder can select one downsampling method as a predetermined downsampling method. For example, the encoder can select the downsampling method with the best effect. The selected downsampling method is encoded and signaled to the decoder. The signaled information can be index information indicating the downsampling method.

[0337] [Equation 5]

[0338] p1’[x, y] = (p1[2x, 2y] + p1[2x, 2y + 1] + 1) >> 1

[0339] [Equation 6]

[0340] p1’[x, y] = (p1[2x + 1, 2y] + p1[2x + 1, 2y + 1] + 1) >> 1

[0341] [Equation 7]

[0342] p1’[x, y] = (p1[2x - 1, 2y] + 2 × p1[2x, 2y] + p1[2x + 1, 2y] + 2) >> 2

[0343] [Equation 8]

[0344] p1’[x, y] = (p1[2x - 1, 2y + 1] + 2 × p1[2x, 2y + 1] + p1[2x + 1, 2y + 1] + 2) >> 2

[0345] [Equation 9]

[0346] 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

[0347] The downsampling method performed on two or more sample points is not limited to any of the examples in Equations 5 to 9. For example, two or more sample points for calculating the downsampled value p1’[x, y] can be selected from a group of sample points consisting of the sample point p1[2x, 2y] and its neighboring sample points. The neighboring sample points can be sample points 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 can be performed by calculating the average value or weighted average value of two or more sample points.

[0348] Optionally, downsampling can be performed in such a way that a specific sample point is selected from one or more sample points. In this case, at least any one of the following equations (Equations 10 to 13) can be used for downsampling.

[0349] [Equation 10]

[0350] p1’[x, y] = p1[2x, 2y]

[0351] [Equation 11]

[0352] p1’[x, y] = p1[2x, 2y + 1]

[0353] [Equation 12]

[0354] p1’[x, y] = p1[2x + 1, 2y]

[0355] [Equation 13]

[0356] p1’[x, y] = p1[2x + 1, 2y + 1]

[0357] 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.

[0358] [Equation 14]

[0359] p1’[2x, 2y] = p1[x, y],

[0360] p1’[2x + 1, 2y] = (p1[x, y] + p1[x + 1, y] + 1) >> 1,

[0361] p1’[2x, 2y + 1] = (p1[x, y] + p1[x, y + 1] + 1) >> 1,

[0362] p1’[2x + 1, 2y + 1] = (p1[x + 1, y] + p1[x, y + 1] + 1) >> 1

[0363] In the reconstruction process, a filter can be applied to one or more samples. For example, the filter can be applied to one or more samples included in at least any one of the first color component block (i.e., the corresponding block), neighboring blocks of the corresponding block, the second color component block (i.e., the target block), and neighboring blocks of the target block.

[0364] In the above reference sample reconstruction step, an indicator corresponding to a predetermined reference sample line among multiple reference sample lines can be signaled. In this case, in the reconstruction process, the 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 reference sample line and the second reference sample line adjacent to the corresponding block of the first color component. Optionally, when the value of the indicator mrl_index is 1, the reconstruction process is performed using the second reference sample line and the third reference sample line adjacent to the corresponding block of the first color component. Optionally, when the value of the indicator mrl_index is 3, the reconstruction process is performed using the third reference sample line and the fourth reference sample line adjacent to the corresponding block of the first color component. The reference sample lines indicated by the indicator mrl_index can be used for the second color component target block.

[0365] 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 region, the reference samples used for reconstruction can be selected differently. In this case, the number of reference sample lines on the upper side can be different from the number of reference sample lines on the left side. The predetermined region can be at least any one of a picture, a stripe, a parallel block, a CTU, and a CU.

[0366] For example, when the upper boundary of the corresponding block of 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 corresponding block of 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. Optionally, N reference sample lines on the upper side and M reference sample lines on the left side can both be used for reconstruction, where N can be less than M. For example, when the upper boundary corresponds to the boundary of the predetermined region, N can be 1. Additionally, when the left boundary corresponds to the boundary of the predetermined region, M can be 1.

[0367] Optionally, the reconstruction can be performed by using N reference sample lines on the upper side and M reference sample lines on the left side of the corresponding block of the first color component, regardless of whether the boundary of the predetermined region is the upper boundary or the left boundary of the first color component block.

[0368] Figure 13 It is a diagram showing an embodiment of performing reconstruction by using a plurality of upper reference sample lines and / or a plurality of left reference sample lines.

[0369] As Figure 13 shown in (a) of , reconstruction can be performed by using four upper reference sample lines and four left reference sample lines.

[0370] For example, when the upper boundary or the left boundary of the corresponding block of the first color component is the boundary of a predetermined area, the number of upper reference sample lines and the number of left reference sample lines for reconstruction can be different from each other. For example, as Figure 13 shown in (b) of Figure 13 to (d) of , any combination of the following combinations can be used for reconstruction: two upper reference sample lines and four left reference sample lines; one upper reference sample line and three left reference sample lines; one upper reference sample line and two left reference sample lines.

[0371] The number of reference sample lines for reconstruction is not limited to the above combinations. That is, N upper reference sample lines and M left reference sample lines can 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 a predetermined area, N and M can be equal to each other. That is, N and M can both be 1. Optionally, N can be set to be less than M under the same conditions. This is because the upper reference sample lines require more resources (memory) than the left reference sample lines.

[0372] Optionally, as Figure 13 shown in (e) of , one or more reference samples within an area whose vertical length and horizontal length are not greater than the vertical length and horizontal length of the corresponding block of the first color component can be used for reconstruction.

[0373] When performing the reconstruction process, the reference samples of the corresponding block of the first color component can be set differently according to any one of the block size, block shape, and coding parameters of at least any one of the selected blocks among the corresponding block of the first color component, the neighboring blocks of the corresponding block of the first color component, the target block of the second color component, and the neighboring blocks of the target block of the second color component.

[0374] For example, among the samples in the corresponding block of the first color component and its neighboring blocks, the samples in the blocks with an inter-frame coding mode are not used, and only the samples in the blocks with an intra-frame coding mode are used for reconstruction.

[0375] Figure 14 It is an exemplary diagram showing the reference samples for performing reconstruction according to the intra-frame prediction mode or coding parameters of the corresponding block. The reconstruction of the reference samples of the first color component block can be performed differently according to the intra-frame prediction mode of the corresponding block of the first color component. For example, asFigure 14 As shown in (a) thereof, when the intra prediction mode of the corresponding block is a non-angular mode such as the DC mode and the 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 shown in (b) thereof, when the intra prediction mode of the corresponding block is an angular mode in which both the upper reference sample and the upper-right reference sample of the corresponding block are used, at least one sample group of the upper reference sample and the upper-right reference sample is used to perform the reconstruction of the corresponding block. Optionally, as Figure 14 shown in (c) thereof, when the intra prediction mode of the corresponding block is an angular mode in which both the left reference sample and the lower-left reference sample are used, at least any one sample group of the left reference sample and the lower-left reference sample can be used to reconstruct the corresponding block.

[0376] Optionally, the reconstruction of the reference samples of the corresponding block of the first color component is performed differently according to the quantization parameter of at least one of the corresponding block of the first color component and its neighboring blocks. For example, as Figure 14 shown in (d) thereof, the reference samples in the upper block with a relatively small quantization parameter value QP among the neighboring blocks are used to perform the reconstruction.

[0377] Optionally, when the target block of the second color component has a rectangular shape, the reference samples arranged around the corresponding block of the first color component having a square shape are used for reconstruction.

[0378] Optionally, when the target block of the second color component is divided into two sub-blocks (for example, two sub-blocks of 16×8 size) and when the corresponding block of the first color component is a block of 32×16 size, the reference samples arranged around the 32×32 size block are used to reconstruct the corresponding block. In this case, the reference samples around the reconstructed 32×32 size block can be shared as the reference samples of the corresponding block of the first color component corresponding to the second 16×8 size sub-block arranged at the lower side among the two sub-blocks of the partitioned target block of the second color component.

[0379] Hereinafter, the prediction parameter derivation step will be described.

[0380] At least any one of the reference samples of the reconstructed corresponding block of the first color component and the reference samples of the prediction target block of the second color component can be used to derive the prediction parameters. Hereinafter, the terms "first color component" and "corresponding block of the first color component" may respectively refer to the reconstructed first color component and the reconstructed corresponding block of the first color component.

[0381] Figure 15 is a diagram showing an exemplary reconstructed corresponding block of the first color component when the prediction target block of the second color component is a 4×4 block. In this case, the number of reference sample lines can be N.

[0382] As shown in Figure 15 (a) of the figure, reference samples arranged on the upper side and the left side of the target block corresponding to the reconstructed first color component or the second color component can be used to derive prediction parameters.

[0383] For example, prediction parameters can be derived by adaptively using reference samples of the reconstructed first color component based on the intra prediction mode of the corresponding block of the first color component. In this case, reference samples of the second color component can be adaptively used based on the intra prediction mode of the corresponding block of the first color component.

[0384] As shown in Fig. 15(a), when the intra prediction mode of the corresponding block of the first color component is a non - angular mode such as the DC mode or the planar mode, or an angular mode in which both the upper - side reference sample and the left - side reference sample are used, reference samples on the upper side and the left side of the corresponding block of the first color component can be used.

[0385] As shown in Figure 15 (b) or Figure 15 (c) of the figure, when the intra prediction mode of the corresponding block of the first color component is an angular mode in which the upper - side reference sample is used, reference samples on the upper side of the corresponding block of the first color component can be used.

[0386] As shown in Figure 15 (d) or Figure 15 (e) of the figure, when the intra prediction mode of the corresponding block of the first color component is an angular mode in which the left - side reference sample is used, reference samples on the left side of the corresponding block of the first color component can be used.

[0387] Optionally, when the intra prediction mode of the corresponding block of the first color component is an angular mode, the reference samples used in each prediction mode can be used as reference samples of the first color component. For example, when the intra prediction mode is the vertical mode, the reference samples shown in Figure 15 (b) can be used. When the intra prediction mode is the horizontal mode, the reference samples shown in Figure 15 (d) can be used. When the intra prediction mode is the upper - right diagonal mode, the reference samples shown in Figure 15 (c) can be used. When the intra prediction mode is the lower - left diagonal mode, the reference samples shown in Figure 15 (e) can be used. When the intra prediction mode is a mode between the vertical mode and the upper - right diagonal mode, the reference samples shown in Figure 15 (f) can be used. When the intra prediction mode is an angular mode in the 45° diagonal direction, the reference samples shown in Figure 15The upper right reference sample, the lower left reference sample, or both the upper right reference sample and the lower left reference sample as shown in (g). The reference samples selected differently for each intra prediction mode are stored in the form of a look-up table for easy use.

[0388] Prediction parameters can be derived by adaptively using the 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.

[0389] For example, when the size of the second color component target block is 64×64, 32, 16, or 8 reference samples among the reference samples on the upper side or the left side of the first color component block or the second color component block can be used. 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 used adaptively. The predetermined size is not limited to the 64×64 size, but can be a size signaled by the bitstream, or can be a size derived based on the coding parameters of the current block or its neighboring blocks.

[0390] Optionally, when the second color component target block has a rectangular shape, the reference samples adjacent to the longer side (vertical side or horizontal side) of the second color component target block can be used. For example, when the target block has a block size of 32×8, the reference samples on the upper side of the first color component or the second color component block can be used.

[0391] Optionally, when the second color component target block has a rectangular shape, the reference samples around the square block can be used. For example, when the target block is a 32×8 block, the reference samples around the 32×32 block can be used.

[0392] The reference samples around the reconstructed first color component block and the reference samples around the second color component block can be used to derive the prediction parameters. The prediction parameters can be derived based on any one of the factors including correlation, variation amount, average value, and distribution of the color components. In this case, any one of the methods such as least squares (LS), least mean square (LMS), etc. can be used.

[0393] When the prediction parameters are derived by the LMS method, the prediction parameters can be a and b, α and β, or both a and b and α and β. The prediction parameters that can minimize the error between the reference samples of the first color component and the reference samples of the second color component can be derived by Equation 15.

[0394] [Equation 15]

[0395]

[0396] In Equation 15, p2 n represents the reference sample of the second color component, and p1’n Reference sample points representing the reconstructed first color component. N is the number of reference sample points arranged in the vertical or horizontal direction used, and a and b represent prediction parameters.

[0397] In this case, the correlation between the reference sample points can be calculated by Equation 16.

[0398] [Equation 16]

[0399] k = Maaxx(0, BitDeepth + log2(N) - 15)

[0400]

[0401] In Equation 16, BitDepth represents the bit depth. p1’ represents a sample point of the reconstructed first color component, and p2 represents a sample point of the second color component. Figure 16 is a diagram showing the sample points of the first color component and the sample points of the second color component.

[0402] When there is a region without reference sample points in the process of deriving prediction parameters, only existing sample points can be used to derive prediction parameters.

[0403] One or more prediction parameters can be derived. For example, the first prediction parameter can be derived from the reference sample points having values that meet specific requirements among the reference sample points for deriving prediction parameters. Additionally, the second prediction parameter can be derived from the reference sample points having values that do not meet specific requirements. The specific requirement can be the condition that the value of the reference sample point is less than statistical data (e.g., the average value).

[0404] According to another embodiment of the present invention, instead of deriving prediction parameters from the values of reference sample points, basic prediction parameters (default parameters) can be used. The default parameters can be predefined in the encoder and decoder. For example, the prediction parameters a and b can be 1 and 0 respectively.

[0405] Optionally, when deriving prediction parameters from reference sample points, the derived prediction parameters can be encoded and decoded.

[0406] When performing inter-color-component prediction between color components Y, Cb, and Cr, the prediction parameters for predicting color components Cb and Cr can be derived from color component Y. The prediction parameters for predicting color component Cr can be derived from color component Cb. Optionally, as the prediction parameters for predicting color component Cr, the prediction parameters for predicting color component Cb that have been derived from color component Y can be used as they are, instead of deriving new prediction parameters for predicting color component Cr.

[0407] Hereinafter, the steps of performing inter-color-component prediction will be described.

[0408] As described above, after the prediction parameters are derived, at least any one of the derived prediction parameters can be used to perform intra-frame prediction between color components.

[0409] For example, according to Equation 17, the prediction of the target block of the second color component can be performed by applying the derived prediction parameters to the reconstructed signal of the first reconstructed color component.

[0410] [Equation 17]

[0411] p 2 [x,y] = a × p1′[x,y] + b

[0412] In Equation 17, p2[x, y] represents the predicted block of the target block of the second color component. p1′[x, y] represents the first color component block or the reconstructed first color component block.

[0413] Optionally, according to Equation 18, the prediction of the target block of the second color component can be performed by applying the derived prediction parameters to the residual signal of the first reconstructed color component.

[0414] [Equation 18]

[0415] p 2 [x,y] = p 2 _pred[x,y] + a × p1′_residual[x,y]

[0416] In Equation 18, p1′_residual represents the residual signal of the first color component, and p2_pred represents the predicted signal obtained by performing intra-frame prediction for the target block of the second color component.

[0417] When the number of derived prediction parameters is one or more, one or more prediction parameters can be applied to the reconstructed samples of the first color component. For example, when the reconstructed samples of the first color component meet specific requirements, intra-frame prediction between color components can be performed by applying the first prediction parameter derived from the reference samples that meet the specific requirements. At the same time, when the reconstructed samples of the first color component do not meet the specific requirements, intra-frame prediction between color components can be performed by applying the second prediction parameter derived from the reference samples that do not meet the specific requirements. The specific requirement refers to the condition that the value of the reference sample is less than the statistical data (e.g., average value) of the reference sample of the first color component.

[0418] The inter-color-component prediction method can be used in the inter-frame prediction mode. For example, when performing inter-frame prediction on a current block, inter-frame prediction is performed on a first color component, and inter-color-component prediction or a prediction combining inter-frame prediction and inter-color-component prediction can be performed on a second color component. For example, the first color component can be a luminance component, and the second color component can be a chrominance component.

[0419] The prediction samples or reconstructed samples of the luminance component can be used to perform inter-color-component prediction. For example, after performing inter-frame prediction on the luminance component, the prediction for the color component can be performed by applying the inter-color-component prediction parameters to the prediction samples obtained from the inter-frame prediction of the luminance component. Here, the prediction samples refer to the samples on which at least one of motion compensation, motion refinement, overlapping block motion compensation (OBMC), and bidirectional optical flow (BIO) has been performed.

[0420] In addition, inter-color-component prediction can be adaptively performed according to the coding parameters of the first color component. For example, it can be determined whether to perform inter-color-component prediction according to 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 can be performed on the second color component. Optionally, a flag indicating whether to perform inter-color-component prediction can be signaled.

[0421] When the coding parameters of the first color component meet a predetermined condition, a flag indicating whether to perform inter-color-component prediction can be signaled. For example, when the CBF of the first color component is 1, the flag can be signaled to determine whether to perform inter-color-component prediction.

[0422] When performing inter-color-component prediction on the second color component, the inter-frame motion prediction or compensation value for the second color component can be used. For example, the inter-frame prediction information of the first color component can be used to perform inter-frame motion prediction or compensation on the second color component. In addition, the prediction can be performed by calculating the weighted sum of the inter-frame motion compensation value and the inter-color-component prediction value for the second color component.

[0423] According to another embodiment of the present invention, intra-frame prediction based on representative samples can be performed. When performing intra-frame prediction based on representative samples, at least one of the following items can be used to perform the prediction: block partitioning, representative sample determination, representative sample prediction, transform and quantization, intra-frame prediction using representative samples, and reconstruction.

[0424] The current block can 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 can 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 the blocks that can be generated by quadtree partitioning. Among these sizes, BTMax and BTMin respectively represent the maximum size and minimum size of the blocks that can be generated by binary tree partitioning.

[0425] The size of the sub - block varies according to 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 can be a positive integer, more specifically, 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 can be 8×8.

[0426] The size of the sub - block can be determined according to the coding parameters of neighboring blocks. For example, the size of the sub - block can be determined according to whether the neighboring block is an intra - coded block or an inter - coded block. Optionally, the size of the sub - block can be determined according to the intra - prediction mode of the neighboring block. Optionally, the size of the sub - block can be determined according to whether the neighboring block is partitioned.

[0427] At least one of the dividable 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 a predetermined fixed size or fixed value.

[0428] For example, when the dividable size of the current block is the fixed size 16×16, the current block can be divided into sub - blocks when the size of the current block is 16×16.

[0429] For example, when the size of the sub - block is fixed to the size 4×4, regardless of the size of the current block, the size of the sub - block is required to be always 4×4.

[0430] For example, assuming that the dividable 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 the way that each of the width and height of the current block is divided by 4.

[0431] One or more sub-blocks in a 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 such as 8×8, 4×4, 16×8, 4×16, etc.

[0432] At least one of the dividable size of the current block, the size of the sub-block, and the value obtained by dividing the size of the current block by N may be determined by entropy encoding / decoding. Information of at least one of the dividable size of the current block, the size of the sub-block, and the value obtained by dividing the size of the current block by N may be predefined in the encoder and the decoder. Optionally, the information may be signaled at the block level or a level higher than the block. Higher levels include video, sequence, picture, slice, parallel block, CTU, and CU.

[0433] One or more samples in the current block or sub-block may be determined as representative samples.

[0434] The representative sample may be one or more samples located in a block, where the block may be the current block or sub-block.

[0435] Figure 17 It is a diagram showing an exemplary method for determining representative samples.

[0436] In Figure 17 , the diagrams represented by (a) and (d) show examples of the current block, and the diagrams represented by (b) and (c) show examples of sub-blocks obtained according to the division of the current block.

[0437] For example, referring to the diagram represented by (a) in Figure 17 , the sample located at the lower right corner of the current block may be determined as the representative sample.

[0438] Optionally, referring to the diagram represented by (b) in Figure 17 , the sample located at the center of the current block may be determined as the representative sample.

[0439] Optionally, referring to the diagram represented by (c) in Figure 17 , two samples located at the lower right corner and the center of the current block respectively may be determined as the representative samples.

[0440] The value of the representative sample may be at least one of the original sample value, the predicted sample value, and the reconstructed sample value corresponding to the position described with reference to the diagrams represented by (a) to (c) in Figure 17 .

[0441] The position of the representative sample may be a fixed position. For example, the position may be the lower right corner of the block. In this case, information on the position of the representative sample does not need to be signaled.

[0442] Optionally, information indicating the position of the representative sample points may be signaled.

[0443] Optionally, the number and / or the position of the representative sample points may be determined based on at least one of the intra prediction mode of the current block (i.e., whether it is a directional mode or a non-directional mode and / or the specific direction in the case of the directional mode), the size of the current block, and the shape of the current block.

[0444] The value of the representative sample point is a statistical value of one or more sample points near the position shown in the illustration represented by (a), (b), or (c) in Figure 17 For example, as shown in the illustration represented by (d) in

[0445] For example, when the position of the representative sample point is determined to be D as shown in the illustration represented by (d) in Figure 17 the statistical value of two or more sample points selected from sample points A, B, C, and D (i.e., the sample point located at the specified position D and the neighboring sample points around the specified position D) may be determined as the representative sample point value. In this case, examples of the statistical value include an average value, a median value, a maximum value, a minimum value, a mode value, and a weighted average value. The position of the neighboring sample points to be used is determined based on at least one of the intra prediction mode, size, and shape of the current block.

[0446] For example, when the intra prediction mode is a vertical mode, sample points B and D may be used. For example, when the size of the block is equal to or greater than a predetermined size, all sample points A to D may be used. For example, when the block has a rectangular shape extending vertically, sample points B and D may be used.

[0447] For example, when the intra prediction mode is a vertical mode, sample points C and D may be used. For example, when the size of the block is equal to or less than a predetermined size, all sample points A to D may be used. For example, when the block has a rectangular shape extending vertically, sample points C and D may be used.

[0448] For example, when the position of the representative sample point is determined to be D in the illustration represented by (d) in Figure 17 the average value of sample points A, B, C, and D (i.e., (A + B + C + D + 2) >> 2) is determined as the representative sample point value. Optionally, the weighted sum of sample points B, C, and D (i.e., (B + 2×D + C + 2) >> 2) may be determined as the representative sample point value. Optionally, the median value of sample points A, B, C, and D may be determined as the representative sample point value.

[0449] One or more operations among prediction, transform / inverse transform, and quantization / dequantization are performed on the determined representative sample points.

[0450] Prediction of the representative sample points may be performed using one or more reconstructed reference sample points around the current block.

[0451] Figure 18 is a diagram showing an exemplary method of performing prediction on representative samples.

[0452] Figure 18 Four blocks are shown, including a current block located at the lower right corner, an adjacent block on the left, an adjacent block above, and an adjacent block at the upper left. In Figure 18 , the black dots in the current block represent representative samples, and the gray dots in each adjacent block represent reference samples. In the following description, the reference samples in the adjacent block above or within the adjacent block above are represented by "A", the reference samples in the adjacent block on the left or within the adjacent block on the left are represented by "L", and the reference samples in the adjacent block at the upper left or within the adjacent block at the upper left are represented by "AL".

[0453] For example, as Figure 18 shown, at least one of the reconstructed reference samples in the adjacent block above A, the adjacent block on the left L, or the adjacent block at the upper left AL can be used to perform prediction on the value of the representative sample R located at the lower right corner position within the current block. The reconstructed reference sample can be a sample located at the lower right corner within the reconstructed adjacent block. Optionally, the reconstructed reference sample can be a co-located sample within the reconstructed adjacent block. That is, within the reconstructed adjacent block, the sample located at the 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 using the reconstructed reference samples in the adjacent block above A and the adjacent block on the left L, the predicted representative sample value "Pred_R" as the predicted value for the representative sample is derived by 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 adjacent block above A, and L represents the value of the reconstructed reference sample in the adjacent block on the left.

[0457] Figure 19 is a diagram showing another exemplary method of performing prediction on representative samples.

[0458] In Figure 19 the illustrated embodiment, the current block is divided into 16 sub-blocks. The adjacent block on the left, the adjacent block above, and the adjacent block at the upper left of the current block have the same size as the sub-blocks. For understanding the determination of the positions of the representative samples and the reference samples, reference is appropriately made to the above description associated with Figure 18 the above.

[0459] For example, referring to that by Figure 19In the view shown in (a), the lower right sample points in each sub-block within the current block are determined as representative sample points. In this case, referring to the view shown in (b) of Figure 19 , a block is generated by aggregating the representative sample points in each sub-block. Additionally, the reference sample points existing near the current block as shown in the view in (a) of Figure 19 are used as the reconstruction reference sample points for the newly generated block (hereinafter referred to as the representative sample point block) composed of representative sample points as shown in the view in (b) of Figure 19 . When performing prediction on the block composed of representative sample points as shown in the view in (b) of Figure 19 , a reconstruction reference sample point block composed of reference sample points existing near the current block is used to perform directional prediction or non-directional prediction. In this case, the reference sample points are the sample points within the neighboring blocks having the same x coordinate value or the same y coordinate value as the representative sample points.

[0460] Optionally, the average value of the reference sample points adjacent to the current block can be used as the predicted value of the representative sample points. For example, the DC mode predicted value for the current block can be used as the predicted value of the representative sample points. Optionally, as shown in the view in (b) of Figure 19 , the block composed of representative sample points (i.e., the representative sample point block) can be used as the current block and the method according to the present invention can be applied. In this case, the representative sample point block can be reconstructed.

[0461] The representative sample point residual signal corresponding to the difference between the value of the representative sample points and the predicted value of the representative sample points can be entropy encoded or entropy decoded.

[0462] The representative sample point residual signal can be subjected to transform / inverse transform or quantization / dequantization. In this case, the type of transform / inverse transform can vary according to the prediction mode of the representative sample points.

[0463] After reconstructing the representative sample points using the predicted value and the residual signal of the representative sample points, intra prediction is performed on the current block based on the reconstructed representative sample points.

[0464] The reconstructed representative sample points refer to the values obtained by the following operations: performing inverse quantization and / or inverse transform on the representative sample point residual signal to generate an operation value, and then adding the predicted representative sample points (the predicted value of the representative sample points) to the operation value. Hereinafter, the representative sample points refer to the reconstructed representative sample points.

[0465] At least one of the reconstructed representative sample points and the reference sample points adjacent to the current block can be used to perform intra prediction on the current block.

[0466] Intra prediction can be performed using the reconstructed representative sample points and the interpolation of each reference sample point.

[0467] Figure 20 FIG. is an exemplary diagram showing a method for 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 a current block (the bottom right block in the diagram), a left neighboring block, an upper neighboring block, and an upper left neighboring block. In Figure 20 , the black dots in the current block represent representative samples, and the gray dots in each neighboring block represent reference samples.

[0469] For example, as Figure 20 shown, right column prediction samples (hatched dots) and bottom row prediction samples (hatched dots) of the current block are obtained by interpolating the representative sample located at the lower right corner and each reference sample. For example, when the size of the current block is 8×8, the bottom row prediction sample (the predicted sample value in the bottom row) is calculated as (a×L + b×Re + 4) >> 3, where "a" and "b" represent weights that vary according to the position of the sample to be predicted, L represents the lower left reference sample, and Re represents the representative sample located at the lower right corner within the current block.

[0470] Prediction samples for each sample within the block can be generated by using reference samples and one or more prediction samples among the bottom row prediction samples and the right column prediction samples.

[0471] Figure 21 FIG. is an exemplary diagram showing an exemplary method for performing prediction by using reference samples and right column or bottom row prediction samples.

[0472] Figure 21 FIG. shows an embodiment of predicting samples within a current block by using right column and bottom row prediction samples (corresponding to hatched dots) generated by the method of Figure 20 .

[0473] As Figure 21 shown, interpolation methods are used to predict samples within the current block. For example, when the size of the current block is 8×8, the prediction sample (the predicted sample value) is calculated as (a×L + b×R + c×A + d×B + 8) >> 4, where "a", "b", "c", and "d" represent weights that vary according to the position of the sample to be predicted, L represents the reference sample on the left side of the current block, R represents the prediction sample on the right column within the current block, A represents the reference sample above the current block, and B represents the prediction sample on the bottom row within the current block.

[0474] To predict the 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. Optionally, bidirectional intra prediction can be performed from the reference samples and 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. Optionally, 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 independently signaled.

[0475] Figure 22 is a diagram illustrating an exemplary prediction method for a case where a current block is divided into sub-blocks.

[0476] Reference Figure 22 , the current block is divided into 16 sub-blocks. In this case, intra prediction based on the bottom right reconstruction 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, prediction samples generated by prediction based on representative samples are determined as reconstructed samples of the current block.

[0478] Whether intra prediction based on representative samples is performed may be determined in the step of deriving the intra prediction mode. For example, a flag may be sent to determine whether intra prediction based on representative samples is performed on the current block. For example, the intra prediction mode based on representative samples 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 luminance component and the second color component is a chrominance component. Conversely, the first color component may be a chrominance component and the second color component may be a luminance component.

[0480] Regarding applying filtering to the prediction samples, whether to apply filtering may be determined according to 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, when the size of the current block falls within a predetermined size range, filtering can be applied to the predicted sample points. For example, when the width of the current block is less than 64 and the height is less than 64, filtering can be applied. Optionally, filtering can be applied when the width or height of the current block is greater than or less than a predetermined size.

[0483] For example, it can be determined whether to apply filtering to the predicted sample points based on the reference sample point line used for prediction. For example, when the reference sample point line used for prediction is the first reference sample point line adjacent to the current block, filtering can be applied. On the other hand, when the reference sample point line is one of the second reference sample point line and the forward reference sample point line located around the current block, filtering may not be applied. The indicator mrl_index can be used to determine the reference sample point 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] The prediction of the current block can be performed by combining one or more of the above exemplary prediction methods.

[0486] For example, the prediction of the current block can be performed by calculating the weighted sum of the predicted value obtained using a predetermined non-directional intra prediction mode and the predicted value obtained using a predetermined directional intra prediction mode. In this case, the weight can vary according to at least one of the intra prediction mode of the current block, the size / shape of the current block, and the position of the predicted target sample point.

[0487] For example, prediction of a current block may 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 weight may vary according to at least one of the coding mode, intra prediction mode, inter prediction mode, and size / shape of the current block. For example, when the intra prediction mode is a non-directional mode such as DC or planar, weights corresponding to 1 / 2 may be respectively applied to the intra prediction samples and the inter prediction samples. Optionally, when the intra prediction mode is a vertical mode, the weight for the intra prediction samples decreases as the distance from the reference sample line above the current block increases. Similarly, when the intra prediction mode is a horizontal mode, the weight for the intra prediction samples decreases as the distance from the reference sample line to the left of the current block increases. The sum of the weight applied to the intra prediction samples and the weight applied to the inter prediction samples may be any one of powers of 2. That is, it may be any one of 4, 8, 16, 32, etc. For example, when the size of the current block is within a predetermined size range, weights corresponding to 1 / 2 may be respectively applied to the intra prediction samples and the inter prediction samples.

[0488] The intra prediction mode may be fixed to the DC mode and the planar mode, or may be determined by signaling information. Optionally, the intra prediction mode may be any mode selected from the MPM candidate modes, and may be determined by the MPM candidate modes derived from the intra prediction modes of neighboring blocks. 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 directional 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 directional mode of a specific direction classified into the horizontal direction group, the mode of the neighboring block is replaced by the horizontal mode.

[0489] The inter prediction may be at least one of the DC mode, the merge mode, and the 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 predicted samples obtained by using multiple sample lines. For example, prediction may be performed by calculating a weighted sum of a first predicted value obtained by using a first reference sample line near the current block and a second predicted value obtained by using a second reference sample line near the current block and a forward reference sample line. The reference sample line for obtaining the second predicted value may be the reference sample line indicated by mrl_index. The weights for the first predicted value and the second predicted value may be equal. Optionally, the weights for the first predicted value and the second predicted value may vary according to 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 for which prediction is to be performed. The first predicted value may be a value predicted using a predetermined mode. For example, the first predicted value may be a value predicted using at least one of the DC mode and the planar mode. The second predicted 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 predicted samples, filtering may not be performed on the predicted samples.

[0492] The above embodiments may be performed in the same manner in both the encoder and the decoder.

[0493] The order in which the above embodiments are applied may be different between the encoder and the decoder, or the order in which the above embodiments are applied may be the same in both the encoder and the decoder.

[0494] The above embodiments may be performed for each of the luminance signal and the chrominance signal, or the above embodiments may be performed identically for 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 according to the size of at least one of the following: coded 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 the minimum size or the maximum size or both the minimum size and the maximum size so as to apply the above embodiments, or the size may be defined as a fixed size to which the above embodiments are applied. Further, 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 combinatorially according to the size. Further, when the size is equal to or greater than the minimum size and equal to or less than the maximum size, the above embodiments may be applied. In other words, when the block size is included in a specific range, the above embodiments may be applied.

[0497] For example, when the size of the current block is 8×8 or larger, the above embodiments can be applied. For example, when the size of the current block is 4×4 or larger, the above embodiments can be applied. For example, when the size of the current block is equal to or less than 16×16, the above embodiments can be applied. For example, when the size of the current block is equal to or greater than 16×16 and equal to or less than 64×64, the above embodiments can 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 can be applied, corresponding identifiers can be signaled, and the above embodiments can be applied to the specified time layers identified by the corresponding identifiers. Here, the identifier can be defined as the lowest layer or the highest layer or both the lowest layer and the highest layer to which the above embodiments can be applied, or can be defined as indicating a specific layer to which the embodiments are applied. In addition, a fixed time layer for applying the embodiments can be defined.

[0499] For example, when the time layer of the current image is the lowest layer, the above embodiments can be applied. For example, when the time layer identifier of the current image is 1, the above embodiments can be applied. For example, when the time layer of the current image is the highest layer, the above embodiments can be applied.

[0500] The strip type for applying the above embodiments of the present invention can be defined, and the above embodiments can be applied according to the corresponding strip type.

[0501] The present disclosure provides the following solutions:

[0502] 1. An image decoding method, comprising:

[0503] Deriving an intra prediction mode of a current block;

[0504] Configuring reference samples of the current block; and

[0505] Performing intra prediction on the current block based on the intra prediction mode and the reference samples, wherein the intra prediction is a prediction based on representative samples.

[0506] 2. The image decoding method according to solution 1, wherein the prediction based on representative samples comprises:

[0507] Determining the position of the representative samples;

[0508] Determining the values of the representative samples; and

[0509] Predicting samples in the current block using the representative samples and the reference samples.

[0510] 3. The image decoding method according to solution 2, wherein the position of the representative samples is determined as a predetermined fixed position or determined by information signaled through a bitstream.

[0511] 4. The image decoding method according to Scheme 3, wherein the predetermined fixed position is the right bottom position of the current block.

[0512] 5. The image decoding method according to Scheme 2, wherein the value of the representative sample point is determined to use the statistical values of the representative sample point and the neighboring sample points of the representative sample point specified by the position of the representative sample point.

[0513] 6. The image decoding method according to Scheme 5, wherein the position of the representative sample point is the right bottom position of the current block, and

[0514] wherein the value of the representative sample point is 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.

[0515] 7. The image decoding method according to Scheme 2, wherein the step of determining the value of the representative sample point includes:

[0516] Deriving a predicted value for the representative sample point;

[0517] Reconstructing the residual value for the representative sample point; and

[0518] Using the predicted value and the residual value to determine the value of the representative sample point.

[0519] 8. The image decoding method according to Scheme 7, wherein the predicted value for the representative sample point is derived using the left reference sample point and the upper reference sample point of the current block.

[0520] 9. The image decoding method according to Scheme 8, wherein the predicted value for the right boundary sample point adjacent to the right boundary of the current block in the current block is derived using the interpolation of the representative sample point and the upper reference sample point, and

[0521] wherein the predicted value for the bottom boundary sample point adjacent to the bottom boundary of the current block in the current block is derived using the interpolation of the representative sample point and the left reference sample point.

[0522] 10. The image decoding method according to Scheme 9, wherein the predicted value for the sample point in the current block is derived using the right boundary sample point, the bottom boundary sample point, the upper reference sample point, and the left reference sample point.

[0523] 11. An image encoding method, including:

[0524] Determining the intra prediction mode of the current block;

[0525] Configure the reference sample points of the current block; and

[0526] Perform intra prediction on the current block based on the intra prediction mode and the reference sample points, wherein the intra prediction is a prediction based on representative sample points.

[0527] 12. The image coding method according to scheme 11, wherein the prediction based on representative sample points includes:

[0528] Determine the positions of the representative sample points;

[0529] Determine the values of the representative sample points; and

[0530] Use the representative sample points and the reference sample points to predict the sample points in the current block.

[0531] 13. The image coding method according to scheme 12, wherein the positions of the representative sample points are determined as predetermined fixed positions or are encoded by information signaled through a bitstream.

[0532] 14. The image coding method according to scheme 12, wherein the values of the representative sample points are determined as statistical values using the representative sample points specified by the positions of the representative sample points and the neighboring sample points of the representative sample points.

[0533] 15. The image coding method according to scheme 14, wherein the positions of the representative sample points are the bottom right positions of the current block, and

[0534] wherein the values of the representative sample points are the average values of the representative sample points, the left sample points of the representative sample points, the upper left sample points of the representative sample points, and the upper sample points of the representative sample points.

[0535] 16. The image coding method according to scheme 12, wherein the step of determining the values of the representative sample points includes:

[0536] Derive the predicted values for the representative sample points;

[0537] Derive the residual values for the representative sample points; and

[0538] Use the predicted values and the residual values to determine the values of the representative sample points.

[0539] 17. The image coding method according to scheme 16, wherein the predicted values for the representative sample points are derived using the left reference sample points and the upper reference sample points of the current block.

[0540] 18. The image coding method according to scheme 17, wherein the predicted value of the right boundary sample adjacent to the right boundary of the current block in the current block is derived by interpolation using the representative sample and the upper reference sample, and

[0541] wherein the predicted value of the bottom boundary sample adjacent to the bottom boundary of the current block in the current block is derived by interpolation using the representative sample and the left reference sample.

[0542] 19. The image coding method according to scheme 18, wherein the predicted value of the sample in the current block is derived using the right boundary sample, the bottom boundary sample, the upper reference sample, and the left reference sample.

[0543] 20. A computer-readable recording medium storing a bitstream, wherein the bitstream is generated by an image coding method,

[0544] wherein the image coding method includes:

[0545] Determining an intra prediction mode of a current block;

[0546] Configuring reference samples of the current block; and

[0547] Performing intra prediction on the current block based on the intra prediction mode and the reference samples,

[0548] wherein the intra prediction is a prediction based on representative samples.

[0549] In addition, the present disclosure also provides the following configuration:

[0550] 1. An image decoding method executed by an image decoding device, including:

[0551] Deriving first MPM information, wherein the first MPM information indicates whether the planar mode in the first MPM list is applied to a current block;

[0552] In response to the first MPM information indicating that the planar mode in the first MPM list is applied to the current block, deriving the intra prediction mode of the current block as the planar mode;

[0553] In response to the first MPM information indicating that the planar mode in the first MPM list is not applied to the current block, deriving second MPM information and deriving the intra prediction mode of the current block in the second MPM list based on the second MPM information, wherein the second MPM information indicates the intra prediction mode of the current block in the second MPM list;

[0554] Configuring reference samples for intra prediction of the current block; and

[0555] Perform intra prediction for the current block based on the intra prediction mode and the reference samples.

[0556] 2. The method according to Configuration 1, wherein the second MPM list includes a plurality of intra prediction modes other than the planar mode.

[0557] 3. The method according to Configuration 1, wherein when the reference samples are configured based on one of a plurality of reference sample lines other than the reference sample line adjacent to the current block, the first MPM information is not encoded in the bitstream.

[0558] 4. An image encoding method, comprising:

[0559] Derive first MPM information, wherein the first MPM information indicates whether the planar mode in the first MPM list is applied to the current block;

[0560] In response to the first MPM information indicating that the planar mode in the first MPM list is applied to the current block, derive the intra prediction mode of the current block as the planar mode;

[0561] In response to the first MPM information indicating that the planar mode in the first MPM list is not applied to the current block, derive second MPM information and derive the intra prediction mode of the current block in the second MPM list based on the second MPM information, wherein the second MPM information indicates the intra prediction mode of the current block in the second MPM list;

[0562] Configure reference samples for intra prediction of the current block; and

[0563] Perform intra prediction for the current block based on the intra prediction mode and the reference samples.

[0564] 5. A non-transitory computer-readable recording medium storing a bitstream generated by an image encoding method, wherein the image encoding method includes:

[0565] Derive first MPM information, wherein the first MPM information indicates whether the planar mode in the first MPM list is applied to the current block;

[0566] In response to the first MPM information indicating that the planar mode in the first MPM list is applied to the current block, derive the intra prediction mode of the current block as the planar mode;

[0567] In response to the first MPM information indicating that the planar mode in the first MPM list is not applied to the current block, derive second MPM information and derive the intra prediction mode of the current block in the second MPM list based on the second MPM information, wherein the second MPM information indicates the intra prediction mode of the current block in the second MPM list;

[0568] Reference samples configured for intra prediction of the current block; and

[0569] Perform intra prediction for the current block based on the intra prediction mode and the reference samples.

[0570] 6. An image decoding method performed by an image decoding device, the method comprising:

[0571] Determine whether a combination of intra prediction and inter prediction is used for prediction of the current block;

[0572] Generate an intra prediction block of the current block by performing intra prediction for the current block using an intra prediction mode;

[0573] Generate an inter prediction block of the current block by performing inter prediction for the current block;

[0574] Generate a prediction block of the current block based on a weighted sum of the intra prediction block and the inter prediction block; and

[0575] Generate a reconstructed block of the current block based on the prediction block,

[0576] wherein, in response to a combination of intra prediction and inter prediction being used for prediction of the current block, the intra prediction mode is fixed to a planar mode, and decoding processing of intra prediction mode information of the current block is skipped, and

[0577] wherein, in response to a combination of intra prediction and inter prediction being used for prediction of the current block, the inter prediction mode is fixed to a merge mode.

[0578] 7. An image encoding method performed by an image encoding device, the method comprising:

[0579] Determine whether a combination of intra prediction and inter prediction is used for prediction of the current block;

[0580] Generate an intra prediction block of the current block by performing intra prediction for the current block using an intra prediction mode;

[0581] Generate an inter prediction block of the current block by performing inter prediction for the current block;

[0582] Generate a prediction block of the current block based on a weighted sum of the intra prediction block and the inter prediction block; and

[0583] Generate a reconstructed block of the current block based on the prediction block,

[0584] Among them, in response to a combination of intra prediction and inter prediction being used for predicting a current block, the intra prediction mode is fixed to a planar mode, and encoding processing of intra prediction mode information of the current block is skipped, and

[0585] Among them, in response to a combination of intra prediction and inter prediction being used for predicting a current block, the inter prediction mode is fixed to a merge mode.

[0586] 8. A non-transitory computer-readable recording medium storing a bitstream generated by an image encoding method, wherein the image encoding method includes:

[0587] Determining whether a combination of intra prediction and inter prediction is used for predicting a current block;

[0588] Generating an intra prediction block of the current block by performing intra prediction on the current block using an intra prediction mode;

[0589] Generating an inter prediction block of the current block by performing inter prediction on the current block;

[0590] Generating a prediction block of the current block based on a weighted sum of the intra prediction block and the inter prediction block; and

[0591] Generating a reconstructed block of the current block based on the prediction block,

[0592] Among them, in response to a combination of intra prediction and inter prediction being used for predicting a current block, the intra prediction mode is fixed to a planar mode, and encoding processing of intra prediction mode information of the current block is skipped, and

[0593] Among them, in response to a combination of intra prediction and inter prediction being used for predicting a current block, the inter prediction mode is fixed to a merge mode.

[0594] 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. Instead, some steps may be executed simultaneously with other steps or in a different order. In addition, those of ordinary skill in the art should understand that the steps in the flowchart are not mutually exclusive, and other steps may be added to the flowchart or some steps may be deleted from the flowchart without affecting the scope of the present invention.

[0595] 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 substitutions, modifications, and changes within the scope of the claims.

[0596] Embodiments of the present invention may be implemented in the form of program instructions, where the program instructions may be executed by various computer components and recorded in a computer-readable recording medium. The computer-readable recording medium may separately include program instructions, data files, data structures, etc., 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 specifically designed and constructed for the present invention or may be well-known to those of ordinary skill in the computer software art. Examples of the computer-readable recording medium 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 optical disks); and hardware devices specifically configured 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 may be configured to be operated by one or more software modules or vice versa to perform the processing according to the present invention.

[0597] Although the present invention has been described in terms of specific items (such as detailed elements) and limited embodiments and drawings, they are provided only to assist in a more comprehensive understanding of the present invention, and the present invention is not limited to the above embodiments. Those skilled in the art to which the present invention pertains will understand that various modifications and changes can be made to the above description.

[0598] Therefore, the spirit of the present invention should not be limited to the above embodiments, and the entire scope of the appended claims and their equivalents will fall within the scope and spirit of the present invention.

[0599] Industrial Applicability

[0600] The present invention can be used for encoding / decoding images.

Claims

1. An image decoding method performed by an image decoding device, the method comprising: Determining whether a combination of intra prediction and inter prediction is used for predicting a current block; Performing intra prediction on the current block by using an intra prediction mode to generate an intra prediction block of the current block; Performing inter prediction on the current block to generate an inter prediction block of the current block; Generating a prediction block of the current block based on a weighted sum of the intra prediction block and the inter prediction block; and Generating a reconstructed block of the current block based on the prediction block, wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the intra prediction mode is fixed to a planar mode, and decoding processing of intra prediction mode information of the current block is skipped, and wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the inter prediction mode is fixed to a merge mode.

2. An image encoding method performed by an image encoding device, the method comprising: Determining whether a combination of intra prediction and inter prediction is used for predicting a current block; Performing intra prediction on the current block by using an intra prediction mode to generate an intra prediction block of the current block; Performing inter prediction on the current block to generate an inter prediction block of the current block; Generating a prediction block of the current block based on a weighted sum of the intra prediction block and the inter prediction block; and Encoding a bitstream generated based on the prediction block, wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the intra prediction mode is fixed to a planar mode, and encoding processing of intra prediction mode information of the current block is skipped, and wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the inter prediction mode is fixed to a merge mode.

3. A non-transitory computer-readable recording medium storing a bitstream generated by an image encoding method, Among them, the image encoding method comprising: Determining whether a combination of intra prediction and inter prediction is used for predicting a current block; Performing intra prediction on the current block by using an intra prediction mode to generate an intra prediction block of the current block; Performing inter prediction on the current block to generate an inter prediction block of the current block; Generating a prediction block of the current block based on a weighted sum of the intra prediction block and the inter prediction block; and Encoding a bitstream generated based on the prediction block, wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the intra prediction mode is fixed to a planar mode, and encoding processing of intra prediction mode information of the current block is skipped, and wherein, in response to the combination of intra prediction and inter prediction being used for predicting the current block, the inter prediction mode is fixed to a merge mode.

Citation Information

Patent Citations

  • Image encoding / decoding method and device, and recording medium storing bit stream

    CN115022632A