Image encoding / decoding method and image data transmission method

The image is encoded and decoded through intra-frame prediction technology, and the size and shape of the color component block are used for reconstruction, which solves the problem of low transmission and storage efficiency of high-resolution image data and achieves more efficient image compression and storage.

CN118741103APending Publication Date: 2024-10-01LX SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410979217.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2016-10-04
Filing Date
2017-09-22
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The cost of transmission and storage of high-resolution and high-quality image data increases, and it is difficult for existing technologies to effectively compress image data, resulting in low transmission and storage efficiency.

Method used

The image is encoded and decoded using intra prediction technology, the second color component block is predicted through the first color component block, reconstructed according to its size and shape, and the derived prediction parameters are used for image decoding, resulting in a bit stream stored in a recording medium.

Benefits of technology

It improves the compression efficiency of images, reduces transmission and storage costs, and achieves more efficient image encoding and decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118741103A_ABST
    Figure CN118741103A_ABST
Patent Text Reader

Abstract

Provided are an image encoding / decoding method and a transmission method of image data, which predict a second color component block by using a first color component block. The method for decoding an image according to the present invention comprises the steps of: deriving a prediction parameter using a first color component block; and predicting the second color component block using the derived prediction parameters.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application with the original application number 201780061828.X (International application number: PCT / KR2017 / 010469, application date: September 22, 2017, invention name: Method and device for image encoding / decoding and recording medium for storing bit stream). Technical Field

[0002] The present invention relates to a method and apparatus for encoding / decoding an image and a recording medium storing a bit stream. Specifically, the present invention relates to a method and apparatus for encoding / decoding an image using intra-frame prediction and a recording medium storing a bit stream generated by the image encoding method / apparatus of the present invention. Background Art

[0003] Recently, the demand for high-resolution and high-quality images such as high-definition (HD) images and ultra-high-definition (UHD) images has increased in various application fields. However, the data volume of higher-resolution and higher-quality image data increases compared to conventional image data. Therefore, when image data is transmitted by using a medium such as a conventional wired broadband network and a wireless broadband network, or when image data is stored by using a conventional storage medium, the cost of transmission and storage increases. In order to solve these problems arising as the resolution and quality of image data increase, an efficient image encoding / decoding technology is required for higher-resolution and higher-quality images.

[0004] Image compression technology includes various technologies, including: inter-frame prediction technology for predicting pixel values ​​included in a current picture from a previous picture or a subsequent picture of the current picture; intra-frame prediction technology for predicting pixel values ​​included in the current picture by using pixel information in the current picture; transform and quantization technology for compressing energy of a residual signal; entropy coding technology for assigning short codes to values ​​with high occurrence frequencies and assigning long codes to values ​​with low occurrence frequencies; etc. Image data can be effectively compressed by using such image compression technology and can be transmitted or stored. Summary of the invention

[0005] Technical issues

[0006] An object of the present invention is to provide a method and apparatus for encoding and decoding an image to improve compression efficiency.

[0007] Another object of the present invention is to provide a method and apparatus for encoding and decoding an image using intra-frame prediction to improve compression efficiency.

[0008] Another object of the present invention is to provide a recording medium storing a bit stream generated by the image encoding method / apparatus of the present invention.

[0009] Technical Solution

[0010] According to the present invention, an image decoding method for predicting a second color component block using a first color component block may include: deriving prediction parameters using the first color component block, and predicting the second color component block using the derived prediction parameters.

[0011] In the image decoding method of the present invention, the first color component block may be a luminance block, and the second color component block may be a chrominance block.

[0012] The image decoding method of the present invention may further include: determining whether to perform prediction on the second color component block using the first color component block based on the size or shape of the second color component block.

[0013] The image decoding method of the present invention may further include: reconstructing the first color component block based on the size of the first color component block and the size of the second color component block.

[0014] In the image decoding method of the present invention, when the first color component block has a size larger than that of the second color component block, the step of reconstructing the first color component block may include: down-sampling the first color component block.

[0015] In the image decoding method of the present invention, when the first color component block has a size smaller than that of the second color component block, the step of reconstructing the first color component block may include: up-sampling the first color component block.

[0016] In the image decoding method of the present invention, the step of reconstructing the first color component block may be performed based on whether a boundary of the first color component block or a boundary of the second color component block is a boundary of a predetermined image area.

[0017] In the image decoding method of the present invention, the predetermined image area may be at least any one of a picture, a slice, a tile, a CTU and a CU.

[0018] In the image decoding method of the present invention, when the boundary of the first color component block or the boundary of the second color component block is the boundary of the predetermined image area, the number of upper reference sample lines and the number of left reference sample lines used to reconstruct the first color component block may be different.

[0019] In the image decoding method of the present invention, the reference samples used to reconstruct the first color component block may be determined based on the intra prediction mode of the first color component block.

[0020] In the image decoding method of the present invention, reference samples used to reconstruct the first color component block may be determined based on quantization parameters of neighboring blocks of the first color component block.

[0021] In the image decoding method of the present invention, when the first color component block has a square shape and the second color component block has a rectangular shape, the reference samples used to reconstruct the first color component block may be reference samples located around the square first color component block.

[0022] In the image decoding method of the present invention, the step of deriving the prediction parameter may be performed by using at least any one of the reference samples of the first color component block and the reference samples of the second color component block.

[0023] In the image decoding method of the present invention, the reference samples used in the step of deriving the prediction parameters may be determined based on the intra prediction mode of the first color component block.

[0024] In the image decoding method of the present invention, the reference samples used in the step of deriving the prediction parameters may be determined based on the size or shape of the first color component block or the second color component block.

[0025] In the image decoding method of the present invention, the step of deriving prediction parameters may be performed based on at least any one of the following items: correlation, variation, average value and distribution between reference samples of the first color component block and reference samples of the second color component block.

[0026] An image decoding device according to the present invention may include an intra prediction unit for predicting a second color component block using a first color component block. The intra prediction unit may perform derivation of prediction parameters using the first color component block and predict the second color component block using the derived prediction parameters.

[0027] According to the present invention, an image encoding method for predicting a second color component block using a first color component block may include: deriving prediction parameters using the first color component block, and predicting the second color component block using the derived prediction parameters.

[0028] An image encoding device according to the present invention may include an intra prediction unit for predicting a second color component block using a first color component block. The intra prediction unit may perform derivation of prediction parameters using the first color component block and predict the second color component block using the derived prediction parameters.

[0029] A recording medium according to the present invention can store a bit stream generated by the image encoding method according to the present invention.

[0030] Beneficial Effects

[0031] According to the present invention, a method and apparatus for encoding and decoding an image to improve compression efficiency can be provided.

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

[0033] According to the present invention, there can be provided a recording medium storing a bit stream generated by the image encoding method / apparatus of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

[0037] Figure 4 is a diagram for explaining an embodiment of a process of intra prediction.

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

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

[0040] Figure 7 is a diagram illustrating a DC prediction process performed according to the size and / or shape of a current block.

[0041] Figure 8 is a diagram illustrating an intra prediction process between color components.

[0042] Fig. 9 is an exemplary diagram illustrating a process of reconstructing a color component block.

[0043] Fig.10 is a diagram illustrating an embodiment in which reconstruction is performed by using a plurality of upper reference sample point lines and / or a plurality of left reference sample point lines.

[0044] Fig.11 is an exemplary diagram showing reference samples used for reconstruction according to an intra prediction mode or encoding parameters of a corresponding block.

[0045] Fig.12is a diagram illustrating an exemplary reconstructed first color component corresponding block when the second color component prediction target block is a 4×4 block.

[0046] Fig.13 is a diagram showing samples of a first color component and samples of a second color component. DETAILED DESCRIPTION

[0047] Various modifications may be made to the present invention, and there are various embodiments of the present invention, and examples of various embodiments of the present invention will now be provided and described in detail with reference to the accompanying drawings. However, the present invention is not limited thereto, although the exemplary embodiments may be interpreted as including all modifications, equivalents or alternative forms within the technical concept and technical scope of the present invention. Similar reference numerals indicate the same or similar functions in various aspects. In the accompanying 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 accompanying drawings showing specific embodiments in which the present invention can be implemented by way of illustration. These embodiments are described in sufficient detail to enable those skilled in the art to implement the present disclosure. It should be understood that, although the various embodiments of the present disclosure are different, they 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 conjunction with one embodiment may 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 in each disclosed embodiment may be modified. Therefore, the following detailed description should not be regarded as having a limiting meaning, and the scope of the present disclosure is limited only by the appended claims (when properly interpreted, together with the full range of equivalents claimed by the claims).

[0048] The terms "first", "second", etc. used in the specification may be used to describe various components, but these components should not be interpreted as being limited to these terms. These terms are only used to distinguish one component from other components. For example, without departing from the scope of the present invention, a "first" component may be named a "second" component, and a "second" component may also be similarly named a "first" component. The term "and / or" includes a combination of multiple items or any one of the multiple items.

[0049] It will be understood that in this specification, when an element is simply referred to as being “connected to” or “coupled to” another element rather than being “directly connected to” or “directly coupled to” another element, it can be “directly connected to” or “directly coupled to” another element, or connected to or coupled to another element with other elements interposed therebetween. Conversely, it should be understood that when an element is referred to as being “directly coupled to” or “directly connected to” another element, there are no intervening elements.

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

[0051] The terms used in this specification are only used to describe specific embodiments and are not intended to limit the present invention. Unless there is a clear different meaning in the context, the expression used in the singular includes the expression of the plural number. In this specification, it should be understood that terms such as "including", "having" are intended to indicate the existence of features, numbers, steps, actions, elements, parts or combinations thereof disclosed in the specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, actions, elements, parts or combinations thereof may exist or may be added. In other words, when a particular element is referred to as "included", the elements outside the corresponding element are not excluded, but other elements may also be included in the embodiments of the present invention or within the scope of the present invention.

[0052] In addition, some components may not be indispensable components for performing the basic functions of the present invention, but selective components that only improve the performance thereof. The present invention may be implemented by including only indispensable components for realizing the essence of the present invention without including components for improving performance. Structures that include only indispensable components without including selective components that only improve performance are also included in the scope of the present invention.

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

[0054] In addition, hereinafter, an image may mean a picture constituting a video, or may mean a video itself. For example, "encode or decode an image, or both" may mean "encode or decode a video, or both", and may mean "encode or decode one image among a plurality of images of a video, or both". Here, a picture and an image may have the same meaning.

[0055] Description of terms

[0056] Encoder: Means a device that performs encoding.

[0057] Decoder: Means a device that performs decoding.

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

[0059] Sample: It is the basic unit of a block. Samples can be divided into different types according to bit depth (B d ) is represented as 0 to 2 Bd In the present invention, a sample point may be used as the meaning of a pixel.

[0060] Unit: refers to a coding and decoding unit. When encoding and decoding an image, a unit may be an area generated by partitioning a single image. In addition, a unit may mean a sub-division unit when a single image is partitioned into sub-division units during encoding or decoding. When encoding and decoding an image, a predetermined process for each unit may be performed. A single unit may be partitioned into sub-units having a size smaller than the unit size. Depending on the function, a unit may mean a block, a macroblock, a coding tree unit, a coding tree block, a coding unit, a coding 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 between a unit and a block, a unit may include a luminance component block, a chrominance component block associated with the luminance component block, and a syntax element for each color component block. A unit may have various sizes and shapes, and specifically, the shape of a unit may be a two-dimensional geometric figure such as a rectangle, a square, a trapezoid, a triangle, a pentagon, etc. In addition, the unit information may include at least one of a unit type (indicating a coding unit, a prediction unit, a transform unit, etc.), a unit size, a unit depth, an order in which the unit is encoded and decoded, and the like.

[0061] Coding tree unit: A single coding tree block configured with a luminance component Y and two coding tree blocks associated with chrominance components Cb and Cr. In addition, the coding tree unit may mean a block including a syntax element of each block. Each coding tree unit may be partitioned by using at least one partitioning method of a quadtree partitioning method and a binary tree partitioning method to construct subordinate units such as coding units, prediction units, transform units, etc. The coding tree unit may be used as a term for indicating a pixel block that becomes a processing unit when encoding / decoding an image as an input image.

[0062] Coding tree block: may be used as a term used to indicate any one of a Y coding tree block, a Cb coding tree block, and a Cr coding tree block.

[0063] Neighboring block: means a block adjacent to the current block. The block adjacent to the current block may mean a block touching the boundary of the current block, or a block located within a predetermined distance from the current block. The neighboring block may mean a block adjacent to a vertex of the current block. Here, the block adjacent to a vertex of the current block may mean a block vertically adjacent to a neighboring block horizontally adjacent to the current block, or a block horizontally adjacent to a neighboring block vertically adjacent to the current block.

[0064] Reconstructed neighboring block: means a neighboring block that is adjacent to the current block and has been encoded or decoded in space / time. Here, reconstructed neighboring block may mean reconstructed neighboring unit. Reconstructed spatial neighboring block may be a block that has been reconstructed by encoding or decoding or both encoding and decoding in the current picture. Reconstructed temporal neighboring block is a block in the reference picture at the same position as the current block of the current picture or its neighboring block.

[0065] Unit depth: refers to the degree to which a unit is partitioned. In a tree structure, a root node may be the highest node and a leaf node may be the lowest node. In addition, when a unit is represented as a tree structure, the level at which the unit is located may be referred to as the unit depth.

[0066] Bitstream: means a stream of bits that includes coded image information.

[0067] Parameter set: corresponds to the header information in the structure within the bitstream. The parameter set may include at least one of a video parameter set, a sequence parameter set, a picture parameter set, and an adaptation parameter set. In addition, the parameter set may include slice header information and tile header information, etc.

[0068] Parsing: may mean determining the value of a syntax element by performing entropy decoding, or may mean the entropy decoding itself.

[0069] Symbol: can mean at least one of the syntax element, coding parameter, and transform coefficient value of the encoding / decoding target unit. In addition, the symbol can mean the entropy encoding target or the entropy decoding result.

[0070] Prediction unit: means a basic unit when performing prediction such as inter prediction, intra prediction, inter compensation, intra compensation, and motion compensation. A single prediction unit may be partitioned into a plurality of partitions having a small size or may be partitioned into lower prediction units.

[0071] Prediction unit partition: means the shape obtained by partitioning the prediction unit.

[0072] Transform unit: means a basic unit when encoding / decoding (such as transformation, inverse transformation, quantization, inverse quantization, and transform coefficient encoding / decoding) is performed on a residual signal. A single transform unit may be partitioned into a plurality of transform units having a small size.

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

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

[0075] Reference Figure 1 , the encoding device 100 may include a motion prediction unit 111, a motion compensation unit 112, an intra-frame prediction unit 120, a switch 115, a subtractor 125, a transform unit 130, a quantization unit 140, an entropy encoding unit 150, an inverse quantization unit 160, an inverse transform unit 170, an adder 175, a filter unit 180 and a reference picture buffer 190.

[0076] The encoding device 100 may perform encoding on the input image by using an intra mode or an inter mode or both the intra mode and the inter mode. In addition, the encoding device 100 may generate a bit stream by encoding the input image, and may output the generated bit stream. The generated bit stream may be stored in a computer-readable recording medium, or may be streamed through a wired / wireless transmission medium. When the intra mode is used as a prediction mode, the switch 115 may switch to the intra mode. Alternatively, when the inter mode is used as a prediction mode, the switch 115 may switch to the inter mode. Here, the intra mode may mean an intra prediction mode, and the inter mode may mean an inter prediction mode. The encoding device 100 may generate a prediction block for an input block of the input image. In addition, after generating the prediction block, the encoding device 100 may encode the residual of the input block and the prediction block. The input image may be referred to as a current image as a current encoding target. The input block may be referred to as a current block as a current encoding target or may be referred to as an encoding target block.

[0077] When the prediction mode is the intra mode, the intra prediction unit 120 may use the pixel value of the block adjacent to the current block and already encoded / decoded as the reference pixel. The intra prediction unit 120 may perform spatial prediction by using the reference pixel, or may generate a prediction sample of the input block by performing spatial prediction. Here, intra prediction may mean intra-prediction.

[0078] When the prediction mode is the inter mode, the motion prediction unit 111 may search for an area that best matches the input block from a reference image when performing motion prediction and derive a motion vector by using the searched area. The reference image may be stored in the reference picture buffer 190.

[0079] The motion compensation unit 112 may generate a prediction block by performing motion compensation using a motion vector. Here, inter prediction may mean prediction or motion compensation between frames.

[0080] The subtractor 125 may generate a residual block by using the residual of the input block and the prediction block. The residual block may be referred to as a residual signal. The residual signal may mean the difference between the original signal and the prediction signal. In addition, the residual signal may be a signal generated by transforming or quantizing the difference between the original signal and the prediction signal, or transforming and quantizing. The residual block may be a residual signal of a block unit.

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

[0082] The quantization level may be generated by applying quantization to the transform coefficient or the residual signal. Hereinafter, the quantization level may also be referred to as the transform coefficient in the embodiments.

[0083] The quantization unit 140 may generate a quantization level by quantizing the transform coefficient or the residual signal according to the parameter, and may output the generated quantization level. Here, the quantization unit 140 may quantize the transform coefficient by using a quantization matrix.

[0084] The entropy encoding unit 150 may generate a bitstream by performing entropy encoding on the value calculated by the quantization unit 140 or the encoding parameter value calculated when encoding is performed according to the probability distribution, and may output the generated bitstream. The entropy encoding unit 150 may perform entropy encoding on pixel information of an image and information for decoding the image. For example, the information for decoding the image may include a syntax element.

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

[0086] In order to encode the transformation coefficient levels, the entropy encoding unit 150 may change the coefficients in a two-dimensional block form into a one-dimensional vector form by using a transformation coefficient scanning method.

[0087] The coding parameters may include information (flags, indexes, etc.) such as syntax elements that are encoded at the encoder and sent to the decoder with a signal, and may include information derived when performing encoding or decoding. Coding parameters may mean information required when encoding or decoding an image. For example, at least one value or combination of the following items may be included in the coding parameters: block size, block depth, block partition information, unit size, unit depth, unit partition information, partition flag in quadtree form, partition flag in binary tree form, partition angle in binary tree form, intra-frame prediction mode, intra-frame prediction angle, reference sample filtering method, prediction block boundary filtering method, filter tap, filter coefficient, inter-frame prediction mode, motion information, motion vector, reference picture index, inter-frame prediction angle, inter-frame prediction indicator, reference picture list, motion vector predictor, motion vector candidate list, whether motion merge mode is used, motion merge candidate, motion merge candidate list, whether skip mode is used, interpolation filter type type, motion vector size, representation accuracy of motion vector, transform type, transform size, information on whether additional (secondary) transform is used, information on whether a residual signal exists, coding block pattern, coding block flag (CBF), quantization parameter, quantization matrix, in-loop filter information, information on whether the in-loop filter is applied, in-loop filter coefficient, binarization / debinarization method, context model, context binary bit, bypass binary bit, transform coefficient, transform coefficient level, transform coefficient level scanning method, 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, and information on luminance signal or chrominance signal.

[0088] Here, signaling a flag or an index may mean that the corresponding flag or index is entropy encoded by an encoder and included in a bitstream, and may mean that the corresponding flag or index is entropy decoded from the bitstream by a decoder.

[0089] When the encoding apparatus 100 performs encoding by inter-frame prediction, the encoded current image may be used as a reference image for another image to be processed subsequently. Therefore, the encoding apparatus 100 may reconstruct or decode the encoded current picture, or may store the reconstructed or decoded image as a reference image.

[0090] The quantization level may be dequantized in the dequantization unit 160, or the quantization level may be inversely transformed in the inverse transform unit 170. The dequantized coefficient or the inversely transformed coefficient or both may be added to the prediction block through the adder 175. By adding the dequantized coefficient or the inversely transformed coefficient or both to the prediction block, a reconstructed block may be generated. Here, the dequantized coefficient or the inversely transformed coefficient or both may mean a coefficient on which at least one of dequantization and inverse transformation is performed, and may mean a reconstructed residual block.

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

[0092] The deblocking filter can remove block distortion generated in the boundary between blocks. In order 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 pixels included in the number of rows or columns included in the block. When the deblocking filter is applied to the block, another filter can be applied according to the required deblocking filter strength.

[0093] In order to compensate for the coding error, a suitable offset value may be added to the pixel value by using sample adaptive offset. Sample adaptive offset may correct the offset between the deblocking filtered image and the original picture in pixel units. A method of applying the offset in consideration of edge information on each pixel may be used, or a method of partitioning the pixels of the image into a predetermined number of regions, determining the regions to which the offset is to be applied, and applying the offset to the determined regions may be used.

[0094] The adaptive loop filter may perform filtering based on a comparison result of the filtered reconstructed image with the original image. The pixels included in the image may be partitioned into predetermined groups, the filter applied to each group may be determined, and different filtering may be performed for each group. Information on whether ALF is applied may be signaled by a coding unit (CU), and the form and coefficient of ALF to be applied to each block may be changed.

[0095] The reconstructed block or the reconstructed image having passed through the filter unit 180 may be stored in the reference picture buffer 190 . Figure 2 is a block diagram showing a configuration of a decoding device according to an embodiment to which the present invention is applied.

[0096] The decoding device 200 may be a decoder, a video decoding device, or an image decoding device.

[0097] Reference Figure 2 , the decoding device 200 may include an entropy decoding unit 210, a dequantization unit 220, an inverse transform unit 230, an intra-frame prediction unit 240, a motion compensation unit 250, an adder 255, a filter unit 260 and a reference picture buffer 270.

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

[0099] When the prediction mode used in decoding is the intra mode, the switch may be switched to the intra mode. Alternatively, when the prediction mode used in decoding is the inter mode, the switch may be switched to the inter mode.

[0100] The decoding device 200 can obtain a reconstructed residual block by decoding the input bit stream and generate a prediction block. When the reconstructed residual block and the prediction block are obtained, the decoding device 200 can generate a reconstructed block that becomes a decoding target by adding the reconstructed residual block to the prediction block. The decoding target block may be referred to as a current block.

[0101] The entropy decoding unit 210 may generate symbols by entropy decoding the bit stream according to the probability distribution. The generated symbols may include symbols in the form of quantization levels. Here, the entropy decoding method may be an inverse process of the above-mentioned entropy encoding method.

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

[0103] The quantization level may be inversely quantized in the inverse quantization unit 220, or may be inversely transformed in the inverse transform unit 230. The quantization level may be a result of inverse quantization or inverse transformation or both, and may be generated as a reconstructed residual block. Here, the inverse quantization unit 220 may apply a quantization matrix to the quantization level.

[0104] When the intra mode is used, the intra prediction unit 240 may generate a prediction block by performing spatial prediction using pixel values ​​of already decoded blocks adjacent to the decoding target block.

[0105] When the inter mode is used, the motion compensation unit 250 may generate a prediction block by performing motion compensation using a motion vector and a reference image stored in the reference picture buffer 270 .

[0106] The adder 255 may generate a reconstructed block by adding the reconstructed residual block to the prediction block. The filter unit 260 may apply at least one of a deblocking filter, a sample adaptive offset, and an 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 when performing inter-frame prediction.

[0107] Figure 3 is a diagram schematically showing a partition structure of an image when the image is encoded and decoded. Figure 3 An embodiment of partitioning a single unit into a plurality of subordinate units is schematically shown.

[0108] In order to effectively partition an image, a coding unit (CU) may be used when encoding and decoding. A coding unit may be used as a basic unit when encoding / decoding an image. In addition, a coding unit may be used as a unit for distinguishing between intra mode and inter mode when encoding / decoding an image. A coding unit may be a basic unit for prediction, transformation, quantization, inverse transformation, inverse quantization, or encoding / decoding processing of a transform coefficient.

[0109] Reference Figure 3 , the image 300 is sequentially partitioned into maximum coding units (LCUs), and the LCUs are determined as a partition structure. Here, LCUs may be used in the same meaning as coding tree units (CTUs). Unit partitioning may mean partitioning blocks associated with the unit. Information about unit depth may be included in the block partition information. The depth information may indicate the number of times a unit is partitioned or the degree to which a unit is partitioned, or both. A single unit may be partitioned according to a layer associated with the depth information based on a tree structure. The subordinate units of each partition may have depth information. The depth information may be information indicating the size of a CU and may be stored in each CU.

[0110] The partition structure may mean the distribution of coding units (CUs) within the LCU 310. Such a distribution may be determined according to 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 CU generated by partitioning may be half of the horizontal size and vertical size of the CU before partitioning, respectively, or may have a smaller size than the horizontal size and vertical size before partitioning, respectively, according to the number of partitions. The CU may be recursively partitioned into multiple CUs. The partitioning of the CU may be recursively performed until a predetermined depth or a predetermined size. For example, the depth of the LCU may be 0, and the depth of the smallest coding unit (SCU) may be a predetermined maximum depth. Here, as described above, the LCU may be a coding unit with a maximum coding unit size, and the SCU may be a coding unit with a minimum coding unit size. Partitioning starts from the LCU 310, and as the horizontal size or vertical size or both of the CUs decrease through partitioning, the CU depth increases by 1.

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

[0112] Reference Figure 3 , an LCU with a depth of 0 may be a block of 64×64. 0 may be the minimum depth. An SCU with a depth of 3 may be a block of 8×8. 3 may be the maximum depth. A CU of a block of 32×32 and a CU of a block of 16×16 may be represented by a depth of 1 and a depth of 2, respectively.

[0113] 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 horizontal size and vertical size of the CU before partitioning. In one embodiment, when a coding unit of size 32×32 is partitioned into four coding units, each of the four partitioned coding units may have a size of 16×16. When a single coding unit is partitioned into four coding units, it can be said that the coding unit can be partitioned in a quadtree form.

[0114] For example, when a single coding unit is partitioned into two coding units, the horizontal size or vertical size of the two coding units may be half of the horizontal size or vertical size of the coding unit before partitioning. For example, when a coding unit of size 32×32 is partitioned in the vertical direction, each of the two partitioned coding units may have a size of 16×32. When a single coding unit is partitioned into two coding units, the coding unit may be partitioned in the form of a binary tree. Figure 3The LCU 320 is an example of an LCU to which both the partitioning in the quadtree form and the partitioning in the binary tree form are applied.

[0115] Figure 4 is a diagram illustrating an intra prediction process.

[0116] The intra prediction mode may be a non-angle mode or an angle mode. The non-angle mode may be a DC mode or a planar mode, and the angle mode may be a prediction mode with a specific direction or angle. The intra prediction mode may be represented by at least one of a mode number, a mode value, a mode number, and a mode angle. The number of intra predictions may be M including the non-angle mode and the angle mode, where M is equal to or greater than 1.

[0117] The number of intra prediction modes may be fixed to N regardless of the block size. Alternatively, the number of intra prediction modes may vary according to the block size or the color component type or both. For example, as the block size becomes larger, the number of intra prediction modes may increase. Alternatively, the number of intra prediction modes for a luma component block may be greater than the number of intra prediction modes for a chroma component block.

[0118] In order to perform intra prediction on the current block, a step of determining whether a sample included in the reconstructed neighboring block can be used as a reference sample of the current block may be performed. When there are samples that cannot be used as reference samples of the current block, a value obtained by copying or interpolating at least one sample value among the samples included in the reconstructed neighboring block, or performing both, may be used to replace the unavailable sample value of the sample, so that the replaced sample value is used as the reference sample of the current block.

[0119] When performing intra prediction, a filter may be applied to at least one of a reference sample and a prediction sample based on an intra prediction mode and a current block size.

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

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

[0122] Figure 5 is a diagram illustrating intra prediction according to the present invention.

[0123] The intra prediction of the current block may include the following steps: step S510, deriving an intra prediction mode; step S520, constructing reference samples; and / or step S530, performing intra prediction.

[0124] In step S510, an 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 an intra prediction mode of a neighboring block, a method entropy encoding / decoding an intra prediction mode of the current block from a bitstream, a method using encoding parameters of a neighboring block, or a method using an intra prediction mode of a color component. According to the method using an intra prediction mode of a neighboring block, the intra prediction mode of the current block may be derived by using at least one intra prediction mode derived by using an intra prediction mode of a neighboring block, a combination of at least one intra prediction mode of a neighboring block, and at least one MPM.

[0125] In step S520, reference samples may be constructed by performing at least one of reference sample selection and reference sample filtering.

[0126] In step S530, intra prediction may be performed by performing at least one of non-angular prediction, angular prediction, prediction based on position information, and inter-color component prediction. When angular prediction is performed, prediction having an angle that is different according to a predetermined unit including at least one sample of the current block may be performed. The predetermined unit may be, for example, at least one of a single sample, a sample group, a line, and a block. Inter-color component prediction may include reconstructing a color component block, deriving a prediction parameter, and / or performing inter-color component prediction. In step S530, filtering of the predicted sample may be additionally performed.

[0127] In order to derive the intra prediction mode of the current block, at least one reconstructed neighboring block may be used. The position of the reconstructed neighboring block may be a predefined fixed position, or may be a position derived by encoding / decoding. In the following, encoding / decoding may mean entropy encoding and entropy decoding. For example, when the coordinates of the upper left corner side sample point of the current block of size W×H are (0,0), the neighboring block may be a block adjacent to the coordinates (-1,H-1), (W-1,-1), (W,-1), (-1,H) and (-1,-1) and at least one of the neighboring blocks of the above blocks. Here, W and H may represent the length of the width (W) and height (H) of the current block or the number of samples.

[0128] The intra-frame prediction mode of an unavailable neighboring block can be replaced by a predetermined intra-frame prediction mode. The predetermined intra-frame prediction mode can be, for example, a DC mode, a plane mode, a vertical mode, a horizontal mode and / or a diagonal mode. For example, when the neighboring block is located outside the boundary of at least one predetermined unit among a picture, a slice, a parallel block and a coding tree unit, when the neighboring block is inter-predicted, or when the neighboring block is encoded in PCM mode, the corresponding block can be determined to be unavailable. Optionally, when the neighboring block is unavailable, the intra-frame prediction mode of the corresponding block is not replaced and is not used.

[0129] The intra prediction mode of the current block may be derived as a statistical value of the intra prediction mode of a neighboring block at a predetermined position or the intra prediction mode of at least two neighboring blocks. In this specification, the statistical value may mean at least one of an average value, a maximum value, a minimum value, a mode, a median value, a weighted average value, and an interpolation value.

[0130] Alternatively, the intra prediction mode of the current block may be derived based on the size of the neighboring block. For example, the intra prediction mode of the neighboring block with a relatively large size may be derived as the intra prediction mode of the current block. Alternatively, the statistical value may be calculated by assigning a large weight to the intra prediction mode of the block with a relatively large size.

[0131] Alternatively, whether the intra prediction mode of the neighboring block is an angle mode may be considered. For example, when the intra prediction mode of the neighboring block is a non-angle mode, the non-angle mode may be derived as the intra prediction mode of the current block. Alternatively, the intra prediction modes of other neighboring blocks other than the non-angle mode may be derived as the intra prediction mode of the current block.

[0132] In order to derive the intra prediction mode of the current block, one or more most probable mode (MPM) lists may be constructed 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 of the current block or both. The MPM list may be constructed to exclude overlapping modes. When the number of available candidate modes is less than N, a predetermined candidate mode in the available candidate modes (e.g., a mode obtained by adding a predetermined offset to an angle mode or subtracting a predetermined offset from an angle mode) may be added to the one or more MPM lists. Optionally, at least one of a horizontal mode, a vertical mode, a 45-degree angle mode, a 135-degree angle mode, a 225-degree angle mode, and a non-angle mode may be added to the MPM list. The predetermined offset may be 1, 2, 3, 4, or a positive integer.

[0133] The MPM list may be constructed in a predetermined order based on the positions of the neighboring blocks. For example, the predetermined order may be the order of a block adjacent to the left side of the current block, a block adjacent to the top side of the current block, a block adjacent to the lower left corner side of the current block, a block adjacent to the upper right corner side of the current block, and a block adjacent to the upper left corner side of the current block. The non-angle mode may be included at any position in the MPM list. For example, the non-angle mode may be added to the next intra-frame prediction mode of the block adjacent to the left and top sides.

[0134] As another embodiment, the intra prediction mode of the current block may be derived by using the intra prediction mode derived by using the MPM list and the intra prediction mode of the neighboring block. For example, when the intra prediction mode derived by using the MPM list is Pred_mpm, Pred_mpm may be changed by using the intra prediction mode of the neighboring block. For example, when Pred_mpm is greater than the intra prediction mode of the neighboring block (or greater than the statistical value of at least two intra prediction modes), Pred_mpm may be increased by n, otherwise, Pred_mpm may be reduced by n. Here, n may be a predetermined integer such as +1, +2, +3, 0, -1, -2, -3, etc. The intra prediction mode of the current block may be derived as the changed Pred_mpm. Optionally, when at least one of the intra prediction modes of Pred_mpm and the neighboring block is a non-angle mode, the intra prediction mode of the current block may be derived as a non-angle mode. Optionally, the intra prediction mode of the current block may be derived as an angle mode.

[0135] According to another embodiment of the method for deriving an intra-frame prediction mode of the present invention, the intra-frame prediction mode of the current block can be derived by using the intra-frame prediction modes of different color components. For example, when the current block is a chrominance block, the intra-frame prediction mode of the luminance block corresponding to the chrominance block can be used to derive the intra-frame prediction mode of the chrominance block. As the luminance block corresponding to the chrominance block, there may be one or more luminance blocks. The corresponding luminance block can be determined according to at least any one of the size, shape and encoding parameters of the chrominance block. Optionally, the corresponding luminance block can be determined according to at least any one of the size, shape and encoding parameters of the luminance block.

[0136] The luminance block corresponding to the chrominance block may be composed of multiple partitions. All or part of the multiple partitions may have different intra-frame prediction modes. The intra-frame prediction mode of the chrominance block may be derived based on all or part of the multiple partitions included in the corresponding luminance block. In this case, some partitions (all or part of the multiple partitions) may be selectively used, wherein the partitions used 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. A partition in the luminance block at a position corresponding to a predetermined position in the chrominance block may be selectively used. The predetermined position may refer to a corner sample point (e.g., an upper left sample point) position in the chrominance block or a center sample point position in the chrominance block.

[0137] The method for deriving the intra prediction mode of a color component block using the intra prediction modes of different color component blocks according to the present invention (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 can be derived by using or sharing at least any one of the MPM list and the MPM index mpm_idx of the luminance block corresponding to the chrominance block.

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

[0139] exist Figure 6 In the example shown in , the sampling ratio of the color components is 4:2:0, and at least one of the luminance block A, the luminance block B, the luminance block C, and the luminance block D corresponds to one chrominance block.

[0140] Reference Figure 6, the intra prediction mode of this chrominance block can be derived by using the intra prediction mode of the luminance block A corresponding to the sample at the upper left position (0,0) in the 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.

[0141] The predetermined position may be selected based on the shape of the chroma block. For example, in the case where the chroma block has a square shape, the predetermined position may be a center sample point position. In the case where the chroma block has a rectangular shape, the predetermined position may be an upper left sample point position. Alternatively, the predetermined position may be a position of an upper left sample point in a chroma block having a square shape, or a position of a center sample point in a chroma block having a rectangular shape.

[0142] According to another embodiment, the intra prediction mode of the chroma block may be derived by using statistics of one or more intra prediction modes of a luma block having the same size as the chroma block.

[0143] exist Figure 6 In the example shown, a mode corresponding to an average value of intra-prediction modes of luminance blocks A and D or a mode corresponding to an average value of intra-prediction modes of luminance blocks A, B, C, and D may be derived as an intra-prediction mode of a chrominance block, wherein luminance blocks A, B, C, and D have the same size as the chrominance blocks.

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

[0145] For example, the size of the luminance block A corresponding to the upper left sample position (0,0) in the chrominance block and the size of the luminance block D corresponding to the center sample position (nS / 2,nS / 2) in the chrominance block are compared, and the intra-frame prediction mode of the luminance block D having a larger size can be used to derive the intra-frame prediction mode of the chrominance block.

[0146] Optionally, when the size of the luminance block corresponding to the predetermined position in the chrominance block is equal to or larger than the size of the chrominance block, the intra-prediction mode of the chrominance block is derived by using the intra-prediction mode of the luminance block.

[0147] Optionally, when the size of the chroma block is within a predetermined range, the intra prediction mode of the chroma block is derived by using the intra prediction mode of the luminance block corresponding to the upper left sample point position (0, 0) in the chroma block.

[0148] Optionally, when the size of the chroma block is within a predetermined range, the size of the luminance block corresponding to a predetermined position (0,0) of the chroma block is compared with the size of the luminance block arranged at another predetermined position (nS / 2,nS / 2) of the chroma block, and the intra-frame prediction mode of the chroma block is derived by using the intra-frame prediction mode of the luminance block having a larger size.

[0149] The predetermined range may be derived from at least any one of information signaled through a bitstream, information of a size (and / or depth) of a block (chroma block, luminance block, or both), and information predefined in an encoder or a decoder.

[0150] Alternatively, when the chroma block has a rectangular shape, the intra prediction mode of the chroma block may be derived by using the intra prediction mode of the luma block corresponding to the center sample position (nS / 2, nS / 2) in the chroma block.

[0151] Among the multiple partitions of the luma block, a partition having the same shape as the chroma block may be used. For example, when the chroma block has a square shape or a non-square shape, a partition having a square shape or a non-square shape selected from the multiple partitions of the luma block may be used.

[0152] In reference Figure 6 In the described example, the method of deriving the intra-frame prediction mode of the chroma block using the intra-frame prediction mode of the luminance block is also applicable to the case where the intra-frame prediction mode of the luminance block is used as the intra-frame prediction mode of the chroma block as it is. The method of deriving the intra-frame prediction mode of the chroma block is not limited to the method using the intra-frame prediction mode of the corresponding luminance block. For example, the intra-frame prediction mode of the chroma block can be derived from information including the MPM list and the MPM index mpm_idx, where the information is used to derive the intra-frame prediction mode of the luminance block.

[0153] Optionally, the MPM list of the chroma block may be constructed using the intra prediction mode of the luminance block corresponding to the sample at a predetermined position in the chroma block. In this case, the mpm-idx information of the chroma block may be encoded and sent with a signal. The MPM list of the chroma block may be constructed in a manner similar to the construction of the MPM list of the luminance block. The MPM candidates of the chroma block may include the intra prediction mode of the adjacent chroma block and / or the intra prediction mode of the luminance block corresponding to the chroma block.

[0154] When the MPM flag is 0, a second MPM list including at least one intra prediction mode may be constructed, and the intra prediction mode of the current block may be derived by using the second MPM index (2nd_mpm_idx). Here, a second indicator (e.g., a second MPM flag) indicating whether the intra prediction mode of the current block is included in the second MPM list may be encoded / decoded. Similar to the first MPM list, the second MPM list may be constructed by using the intra prediction mode of the neighboring block. Here, the intra prediction mode included in the first MPM list may not be included in the second MPM list. The number of MPM lists is not limited to 1 or 2, and N MPM lists may be used.

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

[0156] When the current block is partitioned into a plurality of subblocks, in order to derive the intra prediction mode of each subblock, at least one of the described methods may be applied.

[0157] The size or shape of the sub-block or both may be a predetermined size or block or both (e.g., 4×4), or may be determined according to the size or shape or both of the current block. Alternatively, the size of the sub-block may be determined based on whether the neighboring blocks of the current block are partitioned, or the size of the sub-block may be determined based on the intra-prediction mode of the neighboring blocks of the current block. For example, the current block may be partitioned based on the boundary where the intra-prediction modes of the neighboring blocks are different. Alternatively, the current block may be partitioned based on whether the neighboring blocks are intra-coded blocks or inter-coded blocks.

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

[0159] Whether the size of the current block corresponds to the predetermined size may be determined 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 the predetermined size.

[0160] When the current block is partitioned into a plurality of sub-blocks, the intra prediction modes of the plurality of sub-blocks may be derived in a zig-zag order or the intra prediction modes of the plurality of sub-blocks may be derived in parallel. The intra prediction mode of the sub-block may be derived by at least one of the methods for deriving the intra prediction mode of the current block. Here, the neighboring blocks of the current block may be used as the neighboring blocks of each sub-block. Alternatively, the sub-blocks within the current block may be used as the neighboring blocks of each sub-block.

[0161] The intra prediction mode of the subblock included in the current block may be derived by using the intra prediction mode of the current block and the average value of the intra prediction modes of the blocks adjacent to the left and upper sides of the sample point located at (0,0) of each subblock. For example, when the intra prediction mode of the current block is greater than the above average value, half of the above average value may be subtracted from the derived intra prediction mode. When the intra prediction mode of the current block is equal to or less than the above average value, half of the above average value may be added to the derived intra prediction mode.

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

[0163] A reference sample for intra prediction may be constructed based on the derived intra prediction mode. In the following description, the current block may mean a prediction block or a subblock having a size / shape smaller than that of the prediction block. The reference sample may be constructed by using at least one sample reconstructed adjacent to the current block or by using a combination of samples. In addition, filtering may be applied to the constructed reference sample.

[0164] The number or position of the reconstruction sample lines used to construct the reference sample, or both, may vary according to the position of the current block within the coding tree block. Each reconstruction sample on the plurality of reconstruction sample lines may be used as a reference sample as is. Optionally, a predetermined filter may be applied to the reconstruction samples, and the reference sample may be generated by using the filtered reconstruction samples. The reconstruction samples to which the filter is applied may be included in the same reconstruction sample line or in different reconstruction sample lines.

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

[0166] In order to construct reference samples, it may be determined whether neighboring reconstruction samples are available. When a neighboring reconstruction sample is located outside at least one region of a picture, a slice, a tile, and a CTU, it may be determined to be unavailable. Alternatively, when constrained intra prediction is performed on the current block, the neighboring reconstruction sample may be determined to be unavailable when the neighboring reconstruction sample is located in a block that is inter-coded / decoded.

[0167] When the adjacent reconstruction sample points are determined to be unavailable, the unavailable sample points may be replaced by using the adjacent available reconstruction sample points. For example, the unavailable sample points may be replaced by using the adjacent available sample points starting from the lower left sample point position. Alternatively, the unavailable sample points may be replaced by combining the available sample points. For example, the unavailable sample points may be replaced by using the average value of the available sample points located at both ends of the unavailable sample points.

[0168] Alternatively, the unavailable sample may be replaced by using information of the available reference sample. Here, the unavailable sample may be replaced by an arbitrary value that is not a value of the neighboring available sample. The arbitrary value may be an average value of the available sample values, or a value that takes into account the gradient of the available sample values. Alternatively, both the average value and the gradient may be used. The gradient may be determined based on the residual values ​​of the neighboring available sample. Alternatively, the gradient may be determined based on the average value and the residual value of the available sample values. In addition to the average value, the maximum value, the minimum value, the median value, or a weighted sum using an arbitrary weight may be used. The arbitrary weight may be determined based on the distance between the available sample and the unavailable sample.

[0169] The above method may be applied to all upper and left reference samples, or may be applied to any angle. In addition, when the reference sample line of the current block is constructed by using a plurality of reconstruction sample lines, the above method may be applied.

[0170] Whether to apply filtering to the at least one reference sample constructed as above may be determined based on at least one of the intra prediction mode and block size / shape of the current block. When applying a filter, the filtering type may vary according to at least one of the intra prediction mode, size, and shape of the current block.

[0171] Intra prediction for the current block may be performed based on the derived intra prediction mode and the reference samples.

[0172] In the case of the DC mode, an average value of at least one of the constructed reference samples may be used. Here, filtering may be applied to at least one prediction sample located at a boundary of the current block. The DC prediction may be performed differently according to at least any one of the size and shape of the current block. The range of the reference samples used in the DC mode may be determined according to the size and / or shape of the current block.

[0173] Figure 7is a diagram illustrating a DC prediction process performed according to the size and / or shape of a current block.

[0174] like Figure 7 As shown in (a) of FIG. 8 , when the current block has a square shape, DC prediction may be performed by using an average value of reference samples on the upper and left sides of the current block.

[0175] When the current block has a non-square shape, neighboring samples adjacent to the left boundary or the upper boundary of the current block are selectively used as reference samples for DC prediction. Figure 7 As shown in (b) of FIG. 2 , when the current block has a rectangular shape, DC prediction is performed by using an average value of reference samples adjacent to a longer boundary (vertical boundary or horizontal boundary) of the current block.

[0176] When the current block has a predetermined size or has a size within a predetermined size range, some reference samples are selected from the reference samples located on the upper side or the left side of the current block, and DC prediction is performed using the average value of the selected reference samples. The predetermined size may refer to a fixed size N×M predefined in an encoder or a decoder. N and M are positive integers greater than 0. N and M may be equal to or different from each other. The predetermined size range may refer to a critical value for selecting a reference sample for the current block. The critical value may be at least any one of a maximum value and a minimum value. The maximum value and / or the minimum value may be a fixed value preset in the encoder or the decoder, or a variable value encoded by the encoder and sent with a signal.

[0177] As described above, the average value of one or more reference samples can be used for DC prediction. To obtain the average value, a division operation is performed using the number of reference samples. When the number of reference samples is 2 n (n is a positive integer), a binary shift is performed instead of a division operation. In the case where the current block has a non-square shape, when all reference samples on the upper and left sides of the current block are used, the number of reference samples may not be 2. n In this case, the shift operation cannot be used instead of the division operation. Therefore, as described in the present embodiment, the current block can be divided by using 2 n Reference samples are used to replace division operations with shift operations.

[0178] In case of the planar mode, a weighted sum may be used, wherein the weighted sum takes into account a distance from at least one reference sample constructed according to a position of a sample that is a target of intra prediction of a current block.

[0179] In case of the angle mode, at least one reference sample located at a predetermined angle and existing adjacent to the position of the intra prediction target sample may be used.

[0180] In the case of intra prediction mode based on position information, the reconstructed sample block generated based on the encoded / decoded or derived position information can be used as the intra prediction block of the current block. Alternatively, the decoder can derive by retrieving the reconstructed sample block to be used as the intra prediction block of the current block.

[0181] Intra-prediction of a chrominance signal may be performed by using a reconstructed luminance signal of a current block. In addition, intra-prediction of other chrominance signals Cr may be performed by using a single reconstructed chrominance signal Cb of a current block or using a residual signal of Cb.

[0182] Intra-frame prediction may be performed by combining at least one of the above-mentioned prediction methods. For example, an intra-frame prediction block of a current block may be constructed by using a weighted sum of a prediction block using a predetermined non-angle intra-frame prediction mode and a prediction block using a predetermined angle intra-frame prediction mode. Here, the weights may be applied differently according to at least one of the intra-frame prediction mode, the block size, and the sample point position. Optionally, in the case of a chroma block, an intra-frame prediction block for a chroma block may be obtained by using a weighted sum of a prediction block predicted based on a predetermined intra-frame prediction mode and a prediction block predicted based on a reconstructed signal of a luminance block. In this case, the predetermined intra-frame prediction mode may be any one of a plurality of modes that can be used to derive an intra-frame prediction mode for a chroma block. In the case of a chroma block, a determination as to whether a weighted sum of two prediction blocks as described above is used to construct a final prediction block is signaled in the format of encoded information.

[0183] In the case of the angle mode, the constructed reference samples may be reconstructed based on the angle prediction mode. For example, when the angle prediction mode is a mode using all left reference samples and upper reference samples, a one-dimensional array may be constructed for the left reference samples or the upper reference samples. Alternatively, the upper reference samples may be constructed by shifting the left reference samples, or the upper reference samples may be constructed by using a weighted sum of at least one left reference sample.

[0184] Intra-frame prediction of predetermined sample group units of the current block having different angles from each other may be performed. The predetermined sample group unit may be a block, a sub-block, a line, or a single sample.

[0185] According to another embodiment of the present invention, inter-color component intra prediction may be performed. Figure 8is a diagram illustrating an intra prediction process between color components. The intra prediction between color components includes a color component block reconstruction step S810, a prediction parameter derivation step S820 and / or an inter-color component prediction execution step S830. The term "color component" may refer to at least any one of a luminance signal, a chrominance signal, red, green, blue, Y, Cb, and Cr. The prediction of a first color component may 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 may include at least any one of an original signal, a reconstructed signal, a residual signal, and a prediction signal.

[0186] When performing intra-frame prediction for the second color component target block, the following samples may be used: samples of the corresponding block of the first color component block corresponding to the second color component target block, samples of the neighboring blocks of the corresponding block of the first color component, or both of the samples. For example, when performing intra-frame prediction on the chrominance component block Cb or the chrominance component block Cr, the reconstructed luminance component block Y corresponding to the chrominance component block Cb or the chrominance component block Cr may be used. Alternatively, when performing intra-frame prediction on the chrominance component block Cr, the chrominance component block Cb may be used. Alternatively, when performing intra-frame prediction on the fourth color component block, at least one of the first color component block, the second color component block, and the third color component block, all corresponding to the fourth color component block, may be used.

[0187] Whether to perform intra-frame 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 the coding tree unit (CTU), is greater than a predetermined size, or is within a predetermined size range, intra-frame prediction between color components of the target block may be performed. Alternatively, when the shape of the target block is a predetermined shape, intra-frame prediction between color components of the target block may be performed. The predetermined shape may be a square shape. In this case, when the target block has a rectangular shape, intra-frame prediction between color components of the target block may not be performed. At the same time, when the predetermined shape is a rectangular shape, the above embodiment operates in reverse.

[0188] Alternatively, it may be determined whether to perform intra-frame prediction between color components for the prediction target block based on the encoding 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 is predicted by the intra-frame prediction method in a constrained intra-frame prediction (CIP) environment, intra-frame prediction between color components for the prediction target block may not be performed. Alternatively, when the intra-frame prediction mode of the corresponding block is a predetermined mode, intra-frame prediction between color components for the prediction target block may be performed. Furthermore, it may be determined whether to perform intra-frame prediction between color components based on at least any one of the CBF information of the corresponding block and the CBF information of its neighboring blocks. The encoding parameters are not limited to the prediction mode of the block, but various parameters that can be used for encoding / decoding may be used.

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

[0190] When a second color component block is predicted 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 when a sampling ratio of a color component 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 a second color component block is predicted using a first color component block having a different size from that of the second color component block, the first color component block may be reconstructed so that the block size of the first color component and the block size of the second color component are equal. The reconstructed block may include at least any one of the following samples: a sample in the first color component block as a corresponding block and a sample in a neighboring block of the first color component block. Fig. 9 is an exemplary diagram illustrating a process of reconstructing a color component block.

[0191] exist Fig. 9 In (a), p1[x, y] represents the sample point at the position (x, y) in the first color component block. Fig. 9 In (b), p1'[x, y] represents a sample at a position (x, y) in a reconstructed block generated by reconstructing the first color component block.

[0192] When the first color component block has a larger size than the second color component block, the first color component block is downsampled to have a size equal to the size of the second color component block. Downsampling can be performed by applying an N-tap filter to one or more samples (N is an integer equal to or greater than 1). For downsampling, at least any one of Equations 1 to 5 can be used. In the case of selectively using any one of the various downsampling methods, the encoder can select a downsampling method as a predetermined downsampling method. For example, the encoder can select a downsampling method with the best effect. The selected downsampling method is encoded and sent to the decoder with a signal. The information sent with the signal can be index information indicating the downsampling method.

[0193] [Equation 1]

[0194] p1'[x,y]=(p1[2x,2y]+p1[2x,2y+1]+1)>>1

[0195] [Equation 2]

[0196] p1'[x,y]=(p1[2x+1,2y]+p1[2x+1,2y+1]+1)>>1

[0197] [Equation 3]

[0198] p1'[x,y]=(p1[2x-1,2y]+2*p1[2x,2y]+p1[2x+1,2y]+2)>>2

[0199] [Equation 4]

[0200] p1'[x,y]=(p1[2x-1,2y+1]+2*p1[2x,2y+1]+p1[2x+1,2y+1]+2)>>2

[0201] [Equation 5]

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

[0203] The downsampling method performed on two or more samples is not limited to any one of the examples of Equations 1 to 5. For example, two or more samples used to calculate the downsampled value p1'[x, y] may be selected from a sample group consisting of a sample p1[2x, 2y] and its neighboring samples. The neighboring samples may be samples selected from p1[2x-1, 2y-1], p[2x-1, 2y], p1[2x-1, 2y+1], p1[2x, 2y-1], p1[2x, 2y+1], p1[2x+1, 2y-1], p1[2x+1, 2y], and p1[2x+1, 2y+1]. Downsampling may be performed by calculating an average or weighted average of two or more samples.

[0204] Alternatively, downsampling may be performed in a manner of selecting a specific sample point among one or more sample points. In this case, at least any one of the following multiple equations (Equation 6 to Equation 9) may be used for downsampling.

[0205] [Equation 6]

[0206] p1'[x,y]=p1[2x,2y]

[0207] [Equation 7]

[0208] p1'[x,y]=p1[2x,2y+1]

[0209] [Equation 8]

[0210] p1'[x,y]=p1[2x+1,2y]

[0211] [Equation 9]

[0212] p1'[x,y]=p1[2x+1,2y+1]

[0213] When the first color component block has a smaller size than the second color component block, the first color component block is up-sampled to be reconstructed so that the sizes of the first color component block and the second color component block are equal. In this case, upscaling is performed according to Equation 10.

[0214] [Equation 10]

[0215] p1'[2x,2y]=p1[x,y],

[0216] p1'[2x+1,2y]=(p1[x,y]+p1[x+1,y]+1)>>1,

[0217] p1'[2x,2y+1]=(p1[x,y]+p1[x,y+1]+1)>>1,

[0218] p1'[2x+1,2y+1]=(p1[x+1,y]+p1[x,y+1]+1)>>1

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

[0220] In the reference sample reconstruction step, an indicator corresponding to a predetermined reference sample line among the plurality of reference sample lines may be signaled. In this case, in the reconstruction process, reconstruction is performed using the predetermined reference sample line corresponding to the signaled indicator.

[0221] In the reconstruction process, when a boundary of the second color component block (target block) or a boundary of the first color component block (corresponding block) is a boundary of a predetermined area, reference samples for reconstruction may be selected differently. In this case, the number of reference sample lines on the upper side may be different from the number of reference sample lines on the left side. The predetermined area may be at least any one of a picture, a slice, a tile, a CTU, and a CU.

[0222] For example, when the upper boundary of the block corresponding to the first color component is the boundary of the predetermined area, the reference sample points on the upper side may not be used for reconstruction, and only the reference sample points on the left side may be used for reconstruction. When the left boundary of the block corresponding to the first color component is the boundary of the predetermined area, the reference sample points on the left side may not be used for reconstruction, and only the reference sample points on the upper side may be used for reconstruction. Optionally, N reference sample point lines on the upper side and M reference sample point lines on the left side may be used for reconstruction, where N may be less than M. For example, when the upper boundary corresponds to the boundary of the predetermined area, N may be 1. Meanwhile, when the left boundary corresponds to the boundary of the predetermined area, M may be 1.

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

[0224] Fig.10 is a diagram illustrating an embodiment in which reconstruction is performed by using a plurality of upper reference sampling lines and / or a plurality of left reference sampling lines.

[0225] like Fig.10 As shown in (a), reconstruction can be performed using four upper reference sample point lines and four left reference sample point lines.

[0226] For example, when the upper boundary or the left boundary of the block corresponding to the first color component is the boundary of the predetermined area, the number of upper reference sample point lines and the number of left reference sample point lines used for reconstruction may be different from each other. Fig.10 (b) to Fig.10 As shown in (d), any of the following combinations can be used for reconstruction: two upper reference sample point lines and four left reference sample point lines, one upper reference sample point line and three left reference sample point lines, and one upper reference sample point line and two left reference sample point lines.

[0227] The number of reference sample lines used for reconstruction is not limited to the above combination. That is, N upper reference sample lines and M left reference sample lines may be used, where N and M are the same as or different from each other. When both the upper boundary and the left boundary of the corresponding block correspond to the boundary of the predetermined area, N and M may be equal to each other. That is, N and M may both be 1. Alternatively, in the same case, N may be set to be less than M. This is because the upper reference sample lines require more resources (memory) than the left reference sample lines.

[0228] Alternatively, if Fig.10 As shown in (e), one or more reference samples in an area whose vertical length and horizontal length are not greater than the vertical length and horizontal length of the block corresponding to the first color component can be used for reconstruction.

[0229] When performing reconstruction processing, the reference sample points of the block corresponding to the first color component can be set differently according to any one of the block size, block shape and encoding parameters of at least any one block selected from the block corresponding to the first color component, the neighboring block of the block corresponding to the first color component, the second color component target block and the neighboring block of the second color component target block.

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

[0231] Fig.11 is an exemplary diagram showing reference samples used for reconstruction according to an intra prediction mode or coding parameters of a corresponding block. Reconstruction of reference samples of a first color component block may be performed differently according to an intra prediction mode of a first color component corresponding block. Fig.11 As shown in (a) of FIG. 1 , when the intra prediction mode of the corresponding block is a non-angular mode (such as a DC mode and a planar mode) or an angular mode (in which both the upper reference sample and the left reference sample are used), at least one sample group of the upper reference sample and the left reference sample is used for reconstruction. Optionally, as Fig.11As shown in (b) of FIG. 1 , when the intra prediction mode of the corresponding block is an angle mode (in which both the upper reference sample and the left reference sample of the corresponding block are used), reconstruction of the corresponding block is performed using at least one sample group of the upper reference sample and the left reference sample. Optionally, as Fig.11 As shown in (c), when the intra prediction mode of the corresponding block is an angle mode (in which both the left reference samples and the upper reference samples are used), the corresponding block can be reconstructed using at least any one sample group of the left reference samples and the lower left reference samples.

[0232] Optionally, the reference samples used to reconstruct the block corresponding to the first color component are selected differently according to the quantization parameter of at least one of the block corresponding to the first color component and its neighboring blocks. Fig.11 As shown in (d), the reference samples in such an upper block are used for reconstruction of the corresponding block: the upper block is located on the upper side of the corresponding block and the neighboring blocks of the upper block have a relatively small quantization parameter value QP.

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

[0234] Optionally, when the second color component target block is partitioned into two sub-blocks (e.g., two 16×8-sized sub-blocks), and when the first color component corresponding block is a 32×16-sized block, reference samples located around the 32×32-sized block are used for reconstruction of the corresponding block. In this case, as reference samples of the first color component block corresponding to the second 16×8-sized sub-block located on the lower side of the partitioned two sub-blocks of the second color component corresponding block, reference samples around the reconstructed 32×32-sized block may be shared.

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

[0236] The prediction parameters may be derived using at least any one of the reference samples of the reconstructed first color component corresponding block and the reference samples of the second color component prediction target block. In the following, the terms "first color component" and "first color component block" may refer to the reconstructed first color component and the reconstructed first color component block, respectively.

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

[0238] like Fig.12As shown in (a), the prediction parameters can be derived using reference samples located on the upper and left sides of the reconstructed first color component corresponding block or the second color component prediction target block.

[0239] For example, based on the intra prediction mode of the block corresponding to the first color component, the reference samples of the reconstructed first color component may be adaptively used to derive the prediction parameters. In this case, the reference samples of the second color component may be adaptively used based on the intra prediction mode of the block corresponding to the first color component.

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

[0241] like Fig.12 (b) or Fig.12 As shown in (c), when the intra prediction mode of the block corresponding to the first color component is a non-angular mode using an upper reference sample, the upper reference sample of the block corresponding to the first color component may be used.

[0242] like Fig.12 (d) or Fig.12 As shown in (e), when the intra prediction mode of the block corresponding to the first color component is an angle mode using the left reference sample, the reference sample on the left side of the block corresponding to the first color component may be used.

[0243] Optionally, when the intra prediction mode of the block corresponding to the first color component is an angular mode, the reference samples used in each prediction mode can be used as the reference samples of the first color component. For example, when the intra prediction mode is a vertical mode, the reference samples can be used. Fig.12 When the intra prediction mode is the horizontal mode, the reference sample shown in (b) of Fig.12 When the intra prediction mode is the upper right diagonal mode, the reference sample shown in (d) of Fig.12 When the intra prediction mode is the lower left diagonal mode, the reference sample shown in (c) of Fig.12 When the intra prediction mode is between the vertical mode and the upper right diagonal mode, the reference sample shown in (e) of FIG. Fig.12 When the intra prediction mode is an angle mode of 45° diagonal direction, the following is used: Fig.12 The upper right reference sample, or the lower left reference sample, or both of them shown in (g) of FIG. The reference samples selected differently for each intra prediction mode are stored in a lookup table format for easy use.

[0244] The prediction parameter may be derived by adaptively using reference samples of the first color component or the second color component according to the size and / or shape of the first color component block and / or the second color component block.

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

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

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

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

[0249] When the prediction parameter is derived by the LMS method, the prediction parameter may be a and b, α and β, or both. The prediction parameter that can minimize the error between the reference sample of the first color component and the reference sample of the second color component may be derived by Equation 11.

[0250] [Equation 11]

[0251]

[0252] In Equation 11, p2 n Represents the reference sample of the second color component, p1' n represents the reference sample for reconstructing the first color component. N is the number of used reference samples arranged in the vertical direction or the horizontal direction, and a and b represent prediction parameters.

[0253] In this case, the correlation between the reference samples can be calculated by Equation 12.

[0254] [Equation 12]

[0255] k=Max(0,BitDepth+log2(N)-15)

[0256]

[0257] In Equation 12, BitDepth represents a bit depth, p1' represents a sample of a reconstructed first color component, and p2 represents a sample of a second color component. Fig.13 is a diagram showing samples of a first color component and samples of a second color component.

[0258] When there is an area without reference samples in the process of deriving prediction parameters, the prediction parameters may be derived using only existing samples.

[0259] One or more prediction parameters may be derived. For example, a first prediction parameter may be derived from a reference sample having a value satisfying a specific requirement among reference samples used to derive the prediction parameter. In addition, a second prediction parameter may be derived from a reference sample having a value not satisfying the specific requirement. The specific requirement may be a condition that the value of the reference sample is less than a statistical number (e.g., an average value).

[0260] According to another embodiment of the present invention, basic prediction parameters (default parameters) may be used instead of deriving prediction parameters from the values ​​of reference samples. Default parameters may be predefined in the encoder and decoder. For example, the predetermined parameters a and b may be 1 and 0, respectively.

[0261] Optionally, when the prediction parameters are derived from the reference samples, the derived prediction parameters may be encoded and decoded.

[0262] When inter-color component prediction is performed between color component Y, color component Cb, and color component Cr, prediction parameters for predicting color component Cb and color component Cr may be derived from color component Y. Prediction parameters for predicting color component Cr may be derived from color component Cb. Alternatively, prediction parameters for predicting color component Cb, which have been derived from color component Y, may be used as they are as prediction parameters for predicting color component Cr, rather than deriving new prediction parameters for prediction of color component Cr.

[0263] Hereinafter, the inter-color component prediction performing step S830 will be described.

[0264] As described above, after the prediction parameters are derived, inter-color component intra prediction may be performed using at least any one of the derived prediction parameters.

[0265] For example, according to Equation 13, prediction of the second color component target block may be performed by applying the derived prediction parameter to the reconstructed signal for reconstructing the first color component.

[0266] [Equation 13]

[0267] p2[x,y]=a×p1′[x,y]+b

[0268] In Equation 13, p2[x,y] represents a predicted block of a second color component target block. p1'[x,y] represents a first color component block or a reconstructed first color component block.

[0269] Alternatively, according to Equation 14, prediction of the second color component target block may be performed by applying the derived prediction parameter to a residual signal for reconstructing the first color component.

[0270] [Equation 14]

[0271] p2[x,y]=p2_pred[x,y]+a×p1′_residual[x,y]

[0272] In Equation 14, p1′_residual represents a residual signal of a first color component, and p2_pred represents a prediction signal obtained by performing intra prediction on a second color component target block.

[0273] When the number of derived prediction parameters is one or more, the one or more prediction parameters may be applied to the reconstructed samples of the first color component. For example, when the reconstructed samples of the first color component meet a specific requirement, the inter-color component intra-frame prediction may be performed by applying the first prediction parameter derived from the reference samples meeting the specific requirement. Meanwhile, when the reconstructed samples of the first color component do not meet the specific requirement, the inter-color component intra-frame prediction may be performed by applying the second prediction parameter derived from the reference samples not meeting the specific requirement. The specific requirement refers to a condition that the value of the reference sample is less than a statistical number (e.g., an average value) of the reference samples of the first color component.

[0274] The color component inter-prediction method can also be applied to the inter-frame prediction mode. For example, when the current block is predicted by the inter-frame prediction method, inter-frame prediction can be performed for the first color component, and inter-color component prediction can be performed for the second color component. In this case, the first color component may be a luminance component, and the second color component may be a chrominance component. Inter-color component prediction can be adaptively performed according to the encoding parameters of the first color component. For example, it can be determined whether to perform inter-color component prediction based on the CBF information of the first color component. The CBF information may be information indicating the presence or absence of a residual signal. That is, when the CBF of the first color component is 1, inter-color component prediction for the second color component can be performed. At the same time, when the CBF of the first color component is 0, inter-color component prediction for the second color component is not performed, but inter-frame prediction for the second color component is performed. Optionally, a flag indicating whether to perform inter-color component prediction can be sent by a signal.

[0275] The above-described embodiments may be performed in the same manner in an encoder and a decoder.

[0276] The order in which the above-described embodiments are applied may be different between an encoder and a decoder, or the order in which the above-described embodiments are applied may be the same in the encoder and the decoder.

[0277] The above-described embodiments may be performed on each of the luminance signal and the chrominance signal, or may be performed identically on the luminance signal and the chrominance signal.

[0278] The shape of the block to which the above-described embodiment of the present invention is applied may have a square shape or a non-square shape.

[0279] The above-mentioned embodiments of the present invention may be applied according to the size of at least one of a coding block, a prediction block, a transform block, a block, a current block, a coding unit, a prediction unit, a transform unit, a unit, and a current unit. Here, the size may be defined as a minimum size or a maximum size or both in order to apply the above-mentioned embodiments, or may be defined as a fixed size to which the above-mentioned embodiments are applied. In addition, in the above-mentioned embodiments, the first embodiment may be applied to a first size, and the second embodiment may be applied to a second size. In other words, the above-mentioned embodiments may be applied in combination according to the size. In addition, the above-mentioned embodiments may be applied when the size is equal to or greater than the minimum size and equal to or less than the maximum size. In other words, the above-mentioned embodiments may be applied when the block size is included in a specific range.

[0280] For example, when the size of the current block is 8×8 or larger, the above embodiment may be applied. For example, when the size of the current block is 4×4 or larger, the above embodiment may be applied. For example, when the size of the current block is 16×16 or smaller, the above embodiment may be applied. For example, when the size of the current block is equal to or larger than 16×16 and equal to or smaller than 64×64, the above embodiment may be applied.

[0281] The above-described embodiments of the present invention may be applied according to time layers. In order to identify the time layers to which the above-described embodiments may be applied, additional identifiers may be signaled, and the above-described embodiments may be applied to the specified time layers identified by the corresponding identifiers. Here, the identifiers may be defined to indicate the lowest layer or the highest layer or both to which the above-described embodiments may be applied, or may be defined to indicate a specific layer to which the embodiments may be applied. In addition, fixed time layers to which the embodiments may be applied may be defined.

[0282] For example, when the temporal layer of the current image is the lowest layer, the above embodiment may be applied. For example, when the temporal layer identifier of the current image is 1, the above embodiment may be applied. For example, when the temporal layer of the current image is the highest layer, the above embodiment may be applied.

[0283] The stripe types to which the above-described embodiments of the present invention are applied may be defined, and the above-described embodiments may be applied according to the corresponding stripe types.

[0284] In the above-mentioned embodiment, the method is described based on a flow chart with a series of steps or units, but the present invention is not limited to the order of the steps, but some steps can be performed simultaneously with other steps, or can be performed in a different order from other steps. In addition, it should be understood by those of ordinary skill in the art that the steps in the flow chart are not mutually exclusive, and other steps can be added to the flow chart, or some steps can be deleted from the flow chart without affecting the scope of the present invention.

[0285] Embodiments include various aspects of examples. All possible combinations of 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 alternatives, modifications and changes within the scope of the claims.

[0286] Embodiments of the present invention may be implemented in the form of program instructions, which may be executed by various computer components and recorded on a computer-readable recording medium. A computer-readable recording medium may include a separate program instruction, a data file, a data structure, etc., or a combination of a program instruction, a data file, a data structure, etc. The program instructions recorded in the computer-readable recording medium may be specially designed and constructed for the present invention, or may be known to a person of ordinary skill in the field of computer software technology. Examples of computer-readable recording media include: magnetic recording media (such as hard disks, floppy disks, and magnetic tapes); optical data storage media (such as CD-ROMs or DVD-ROMs); magneto-optical media (such as floppy disks); and hardware devices (such as read-only memory (ROM), random access memory (RAM), flash memory, etc.) specially constructed to store and implement program instructions. Examples of program instructions include not only machine language codes formed by a compiler, but also high-level language codes that can be implemented by a computer using an interpreter. A hardware device may be configured to be operated by one or more software modules to perform processing according to the present invention, or vice versa.

[0287] Although the present invention has been described according to specific terms (such as detailed elements) and limited embodiments and drawings, they are only provided to help more popularly understand the present invention, and the present invention is not limited to the above embodiments. It will be appreciated by those skilled in the art that various modifications and changes can be made from the above description.

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

[0289] Industrial availability

[0290] The present invention can be used to encode / decode images.

Claims

1. A method for decoding an image, the method comprising the following steps: deriving an intra prediction mode for the current block; deriving reference samples for intra prediction of the current block; as well as generating a prediction block by performing the intra prediction on the current block based on the intra prediction mode and the reference sample, wherein, in the step of deriving the intra prediction mode of the current block, a chroma intra prediction mode of the current block as a chroma block is derived, wherein the chroma intra prediction mode of the current block is derived based on the size of the current block, wherein the chrominance intra prediction mode of the current block is derived by using the luma intra prediction mode of a corresponding luma block corresponding to a predetermined position of the current block, The current block is in a rectangular shape. wherein the predetermined position is determined based on the shape of the current block, and The predetermined position is equal to the center lower right sample point position among the four center sample point positions of the current block.

2. A method for encoding an image, comprising the following steps: Derivation of intra prediction mode for current block; Derivation of reference samples for intra prediction of the current block; as well as generating a prediction block by performing the intra prediction on the current block based on the intra prediction mode and the reference sample, wherein, in the step of deriving the intra prediction mode of the current block, a chroma intra prediction mode of the current block as a chroma block is derived, wherein the chroma intra prediction mode of the current block is derived based on the size of the current block, wherein the chrominance intra prediction mode of the current block is derived by using the luma intra prediction mode of a corresponding luma block corresponding to a predetermined position of the current block, The current block is in a rectangular shape. wherein the predetermined position is determined based on the shape of the current block, and The predetermined position is equal to the center lower right sample point position among the four center sample point positions of the current block.

3. A method for sending image data, the sending method comprising the following steps: Obtaining a bit stream of encoded image information generated by an image encoding method, the image encoding method comprising the steps of: deriving an intra-frame prediction mode of a current block; deriving a reference sample for intra-frame prediction of the current block; and generating a prediction block by performing the intra-frame prediction on the current block based on the intra-frame prediction mode and the reference sample; and sending said image data including said bitstream, wherein, in the step of deriving the intra prediction mode of the current block, a chroma intra prediction mode of the current block as a chroma block is derived, wherein the chroma intra prediction mode of the current block is derived based on the size of the current block, wherein the chrominance intra prediction mode of the current block is derived by using the luma intra prediction mode of a corresponding luma block corresponding to a predetermined position of the current block, The current block is in a rectangular shape. wherein the predetermined position is determined based on the shape of the current block, and The predetermined position is equal to the center lower right sample point position among the four center sample point positions of the current block.