Method for encoding / decoding image and recording medium

By determining the reference area for intra prediction and using MPM candidate groups, the problem of low efficiency in intra prediction mode determination and block division in the prior art is solved, and the efficiency and accuracy of image encoding/decoding are improved, especially in high resolution Rate image processing.

CN118945319APending Publication Date: 2024-11-12INST OF IMAGE TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411273789.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2018-09-19
Filing Date
2019-09-06
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The prior art is difficult to effectively realize the determination of intra prediction mode and block division, resulting in low image encoding/decoding efficiency, especially in processing of high-resolution images.

Method used

By determining the reference area of ​​intra prediction and derive the intra prediction mode of the current block based on the predetermined MPM candidate group, and performing intra prediction according to the reference area and intra prediction mode, selective use of different predefined pixel rows and The mode combination is adaptively divided into the size and shape of the block.

Benefits of technology

The accuracy and efficiency of intra prediction are improved, the inter prediction efficiency based on inter-component reference is enhanced, and a more efficient image encoding/decoding process is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945319A_ABST
    Figure CN118945319A_ABST
Patent Text Reader

Abstract

Disclosed are a method for encoding / decoding an image and a recording medium. The method for decoding an image includes: deriving an intra prediction mode of a current chroma block based on a predetermined candidate intra prediction mode group; and performing intra prediction on the current chroma block based on the intra prediction mode, in which the predetermined candidate intra prediction mode group is divided into a first group and a second group, in which the first group includes at least one inter-component prediction mode, and the second group includes an intra prediction mode for a luma block corresponding to the current chroma block, wherein the intra prediction mode of the current chroma block is selected by selecting the first group or the second group.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of an invention patent application with an application date of September 6, 2019, application number 201980058354.2, and invention name “Method and device for encoding / decoding images using intra-frame prediction”. Technical Field

[0002] The invention relates to an image encoding / decoding method and device. Background Art

[0003] Recently, demands for high-resolution and high-quality images such as high-definition (HD) images and ultra-high-definition (UHD) images are increasing in various application fields, and thus, efficient image compression technology is being discussed.

[0004] There are various techniques, such as an inter-frame prediction technique that predicts a pixel value included in a current picture based on a picture before or after the current picture using a video compression technique, an intra-frame prediction technique that predicts a pixel value included in the current picture by using pixel information in the current picture, and an entropy coding technique that assigns a short code to a value with a high frequency of occurrence and assigns a long code to a value with a low frequency of occurrence. Image data can be efficiently compressed, transmitted, or stored by using such an image compression technique. Summary of the invention

[0005] Technical issues

[0006] An object of the present invention is to provide a method and apparatus for deriving an intra-frame prediction mode.

[0007] An object of the present invention is to provide a method and apparatus for intra-frame prediction according to component types.

[0008] The object of the present invention is to provide a block partitioning method and device for intra-frame prediction.

[0009] Technical Solutions

[0010] The image encoding / decoding method and apparatus of the present invention can: determine a reference area for intra-frame prediction of a current block; derive an intra-frame prediction mode of the current block based on a predetermined MPM candidate group; and perform intra-frame prediction on the current block based on the reference area and the intra-frame prediction mode.

[0011] In the image encoding / decoding method and device of the present invention, the MPM candidate group can be divided into a first group and a second group, the first group may include a default mode predefined in the decoding device, and the second group may include intra-frame prediction modes of neighboring blocks adjacent to the current block.

[0012] In the image encoding / decoding method and apparatus of the present invention, the intra-frame prediction mode of the current block can be derived by selectively using one of the first group or the second group.

[0013] In the image encoding / decoding method and apparatus of the present invention, determining the reference area may include: selecting one pixel row from a plurality of pixel rows predefined in the decoding apparatus; and determining the selected pixel row as the reference area.

[0014] In the image encoding / decoding method and device of the present invention, the multiple predefined pixel rows may include at least one of the following: a first pixel row adjacent to the current block; a second pixel row adjacent to the first pixel row; a third pixel row adjacent to the second pixel row; or a fourth pixel row adjacent to the third pixel row.

[0015] In the image encoding / decoding method and apparatus of the present invention, the default mode may consist of only a non-directional mode, and the non-directional mode may include at least one of a planar mode or a DC mode.

[0016] In the image encoding / decoding method and apparatus of the present invention, the second group may further include a mode obtained by adding or subtracting an N value from an intra prediction mode of a neighboring block, and the N value may be 1, 2 or 3.

[0017] The image encoding / decoding method and apparatus of the present invention can obtain a first flag from a bit stream, and the first flag can indicate whether the intra prediction mode of the current block is derived from the first group.

[0018] In the image encoding / decoding method and device of the present invention, when the value of the first mark is a first value, the intra-frame prediction mode of the current block can be set to the MPM belonging to the first group, and when the value of the first mark is a second value, the intra-frame prediction mode of the current block can be derived based on the second group and the MPM index.

[0019] In the image encoding / decoding method and apparatus of the present invention, the first flag may be signaled only when the reference area of ​​the current block is determined to be the first pixel row.

[0020] The image encoding / decoding method and apparatus of the present invention can determine an intra-frame prediction mode of a current block, and perform intra-frame prediction on the current block based on the determined intra-frame prediction mode.

[0021] In the image encoding / decoding method and apparatus of the present invention, the intra-frame prediction mode of the current block can be obtained for the luminance block and the chrominance block respectively.

[0022] In the image encoding / decoding method and device of the present invention, the intra-frame prediction mode of the luminance block is derived based on the MPM list and the MPM index, and the MPM list may include at least one of the intra-frame prediction mode of the neighboring block (mode A), mode A+n, mode An or the default mode.

[0023] The image encoding / decoding method and apparatus of the present invention can: specify a luminance region for inter-component reference of a chrominance block; perform downsampling on the luminance region; derive parameters for inter-component reference of the chrominance block; and predict the chrominance block based on the downsampled luminance block and the parameters.

[0024] In the image encoding / decoding method and apparatus of the present invention, a current block is divided into a plurality of sub-blocks, and the division may be performed based on at least one of a size or a shape of the current block.

[0025] Beneficial effects

[0026] According to the present invention, prediction can be performed more accurately and efficiently through the intra prediction mode derived based on the MPM candidate group.

[0027] According to the present invention, the efficiency of inter-frame prediction based on inter-component reference can be improved.

[0028] The present invention can improve the efficiency of intra-frame prediction encoding / decoding through adaptive block partitioning. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 is a block diagram showing an image encoding apparatus according to an embodiment of the present invention.

[0030] Figure 2 is a block diagram illustrating an image decoding apparatus according to an exemplary embodiment of the present invention.

[0031] Figure 3 Block division types according to an embodiment to which the present invention is applied are shown.

[0032] Figure 4 A block partitioning method based on a tree structure is shown as an embodiment to which the present invention is applied.

[0033] Figure 5 is an exemplary diagram showing intra prediction modes predefined in an image encoding / decoding apparatus.

[0034] Figure 6 An intra prediction method according to an embodiment to which the present invention is applied is shown.

[0035] Figure 7 An intra prediction method in subblock units is described as an embodiment to which the present invention is applied.

[0036] Figure 8 A prediction method based on inter-component reference in an embodiment to which the present disclosure is applied is shown.

[0037] Figures 9 to 12 A method of determining a prediction method based on prediction method selection information is described as an embodiment to which the present invention is applied.

[0038] Best Mode for Carrying Out the Invention

[0039] The image encoding / decoding method and apparatus of the present invention can: determine a reference area for intra-frame prediction of a current block; derive an intra-frame prediction mode of the current block based on a predetermined MPM candidate group; and perform intra-frame prediction on the current block based on the reference area and the intra-frame prediction mode.

[0040] In the image encoding / decoding method and device of the present invention, the MPM candidate group can be divided into a first group and a second group, the first group may include a default mode predefined in the decoding device, and the second group may include intra-frame prediction modes of neighboring blocks adjacent to the current block.

[0041] In the image encoding / decoding method and apparatus of the present invention, the intra-frame prediction mode of the current block can be derived by selectively using one of the first group or the second group.

[0042] In the image encoding / decoding method and apparatus of the present invention, determining the reference area may include selecting one pixel row among a plurality of pixel rows predefined in the decoding apparatus, and determining the selected pixel row as the reference area.

[0043] In the image encoding / decoding method and device of the present invention, the multiple predefined pixel rows may include at least one of the following: a first pixel row adjacent to the current block; a second pixel row adjacent to the first pixel row; a third pixel row adjacent to the second pixel row; or a fourth pixel row adjacent to the third pixel row.

[0044] In the image encoding / decoding method and apparatus of the present invention, the default mode may consist of only the non-directional mode, and the non-directional mode may include at least one of the planar mode or the DC mode.

[0045] In the image encoding / decoding method and apparatus of the present invention, the second group may further include a mode obtained by adding or subtracting an N value from an intra prediction mode of a neighboring block, and the N value may be 1, 2 or 3.

[0046] The image encoding / decoding method and apparatus of the present invention can obtain a first flag from a bit stream, and the first flag can indicate whether the intra prediction mode of the current block is derived from the first group.

[0047] In the image encoding / decoding method and device of the present invention, when the value of the first tag is a first value, the intra-frame prediction mode of the current block can be set to the MPM belonging to the first group, and when the value of the first tag is a second value, the intra-frame prediction mode of the current block can be derived based on the second group and the MPM index.

[0048] In the image encoding / decoding method and apparatus of the present invention, the first flag may be signaled only when the reference area of ​​the current block is determined to be the first pixel row.

[0049] The image encoding / decoding method and apparatus of the present invention can determine an intra-frame prediction mode of a current block, and perform intra-frame prediction on the current block based on the determined intra-frame prediction mode.

[0050] In the image encoding / decoding method and apparatus of the present invention, the intra-frame prediction mode of the current block can be obtained for the luminance block and the chrominance block respectively.

[0051] In the image encoding / decoding method and device of the present invention, the intra-frame prediction mode of the luminance block is derived based on the MPM list and the MPM index, and the MPM list may include at least one of the intra-frame prediction mode of the neighboring block (mode A), mode A+n, mode An or the default mode.

[0052] The image encoding / decoding method and apparatus of the present invention can: specify a luminance region for inter-component reference of a chrominance block; perform downsampling on the luminance region; derive parameters for inter-component reference of the chrominance block; and predict the chrominance block based on the downsampled luminance block and the parameters.

[0053] In the image encoding / decoding method and apparatus of the present invention, a current block is divided into a plurality of sub-blocks, and the division may be performed based on at least one of a size or a shape of the current block. DETAILED DESCRIPTION

[0054] The present invention may be changed and modified in various ways and may be described with reference to different exemplary embodiments, some of which will be described and shown in the accompanying drawings. However, these embodiments are not intended to limit the present invention, but are to be understood as including all modifications, equivalents and alternatives that fall within the spirit and technical scope of the present invention. In the accompanying drawings, the same reference numerals always refer to the same elements.

[0055] Although the terms first, second, etc. can be used to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, without departing from the teachings of the present invention, the first element can be referred to as the second element, and similarly the second element can be referred to as the first element. The term "and / or" includes any and all combinations of multiple associated listed items.

[0056] It will be understood that when an element is referred to as being "connected to" or "coupled to" another element, the element may be directly connected or coupled to the other element or an intervening element. In contrast, when an element is referred to as being "directly connected to" or "directly coupled to" another element, there are no intervening elements.

[0057] The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used herein, unless the context clearly indicates otherwise, the singular form ("a", "an" and "the") is also intended to include the plural form. It will also be understood that when used in this specification, the terms "including" and / or "having" specify the presence of stated features, numbers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, numbers, steps, operations, elements, parts and / or their groups.

[0058] Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals refer to the same elements throughout, and redundant descriptions of the same elements will be omitted herein.

[0059] Figure 1 is a block diagram showing an image encoding apparatus according to an embodiment of the present invention.

[0060] Reference Figure 1 , the image encoding device 100 includes a picture division unit 110, prediction units 120 and 125, a transform unit 130, a quantization unit 135, a rearrangement unit 160, an entropy encoding unit 165, an inverse quantization unit 140, an inverse transform unit 145, a filter unit 150 and a memory 155.

[0061] Figure 1 Each of the elements shown in the figure is shown independently to represent different characteristic functions in the encoding device, but it is not intended that each element is composed of a separate hardware or a software element. That is, for ease of description, the elements are arranged independently, wherein at least two elements can be combined into a single element, or a single element can be divided into multiple elements to perform functions. It should be noted that embodiments in which some elements are integrated into a combined element and / or elements are divided into multiple separate elements without departing from the spirit of the present invention are included within the scope of the present invention.

[0062] Some elements are not essential to the substantial functions of the present invention, but may be optional constituent elements that are only used to improve performance. The present invention may be implemented by including only constituent elements that are essential to the embodiments of the present invention (but not including constituent parts that are only used to improve performance). Structures that include only essential constituent elements (but not including optional constituent elements that are only used to improve performance) belong to the scope of the present invention.

[0063] The picture division unit 110 may divide the input picture into at least one processing unit. In this case, the processing unit may be a prediction unit (PU), a transform unit (TU), or a coding unit (CU). The picture division unit 110 may divide a picture into a plurality of combinations of coding units, prediction units, and transform units, and select a combination of coding units, prediction units, and transform units based on a predetermined criterion (e.g., a cost function) to encode the picture.

[0064] For example, a picture can be divided into multiple coding units. In order to divide a picture into coding units, a recursive tree structure such as a quadtree structure can be used. An image or the largest coding block (maximum coding unit) as a root can be divided into other coding units, and can be divided into as many child nodes as the number of divided coding units. Coding units that are no longer divided according to certain restrictions become leaf nodes. That is, when it is assumed that only square division is possible for a coding unit, a coding unit can be divided into up to four different coding units.

[0065] In the embodiments of the present invention, a coding unit may be used to refer not only to a coding unit but also to a decoding unit.

[0066] The prediction unit may be a block divided in a shape such as at least one square or rectangle having the same size within one coding unit, or one prediction unit among the prediction units divided within one coding unit may have a different shape and / or size from another prediction unit.

[0067] When a prediction unit on which intra prediction is performed based on a coding unit is not a minimum coding unit, intra prediction may be performed without being split into a plurality of prediction units N×N.

[0068] The prediction units 120 and 125 may include an inter-frame prediction unit 120 for performing inter-frame prediction and an intra-frame prediction unit 125 for performing intra-frame prediction. The prediction units 120 and 125 may determine which of the inter-frame prediction and the intra-frame prediction is performed on the prediction unit, and may determine specific information of the determined prediction method (e.g., intra-frame prediction mode, motion vector, and reference picture). Here, the processing unit on which the prediction is performed may be different from the processing unit on which the prediction method and specific information are determined. For example, the prediction method and the prediction mode may be determined for each prediction unit, and the prediction may be performed for each transform unit. The residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 130. In addition, the prediction mode information, motion vector information, etc. used for prediction may be encoded by the entropy encoding unit 165 together with the residual value and sent to the decoding device. When a specific encoding mode is used, the original block may be encoded and sent to the decoding device without generating the prediction block by the prediction units 120 and 125.

[0069] The inter-frame prediction unit 120 may predict a prediction unit based on information about at least one of a previous picture of the current picture and a subsequent picture of the current picture. In some cases, the inter-frame prediction unit 120 may predict a prediction unit based on information about a partial coding region in the current picture. The inter-frame prediction unit 120 may include a reference picture interpolation unit, a motion prediction unit, and a motion compensation unit.

[0070] The reference picture interpolation unit may be provided with reference picture information from the memory 155, and the reference picture interpolation unit may generate pixel information less than or equal to an integer pixel on the reference picture. In the case of luma pixels, an 8-tap interpolation filter based on DCT with a variable filter coefficient may be used to generate pixel information less than or equal to an integer pixel in units of 1 / 4 pixels. In the case of chroma pixels, a 4-tap interpolation filter based on DCT with a variable filter coefficient may be used to generate pixel information less than or equal to an integer pixel in units of 1 / 8 pixels.

[0071] The motion prediction unit may perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. Various methods (e.g., full search based block matching algorithm (FBMA), three-step search (TSS) algorithm, and new three-step search (NTS) algorithm) may be used to calculate the motion vector. Based on the interpolated pixel, the motion vector has a motion vector value in units of 1 / 2 or 1 / 4 pixel. The motion prediction unit may use different motion prediction methods to predict the current prediction unit. Various methods such as skip mode, merge mode, advanced motion vector prediction (AMVP) mode, intra-block copy mode, etc. may be used as motion prediction methods.

[0072] The intra prediction unit 125 may generate a prediction unit based on information about reference pixels adjacent to the current block. When the reference pixel is a pixel on which inter prediction has been performed because the block adjacent to the current prediction unit is a block on which inter prediction has been performed, information about the reference pixel in the block on which inter prediction has been performed may be replaced with information about the reference pixel in the block on which intra prediction has been performed. That is, when the reference pixel is unavailable, information about the unavailable reference pixel may be replaced with information about at least one reference pixel among available reference pixels.

[0073] The prediction mode of intra prediction includes a directional prediction mode using reference pixel information according to a prediction direction and a non-directional prediction mode that does not use information about a direction when performing prediction. The mode for predicting luminance information and the mode for predicting chrominance information may be different from each other. In addition, chrominance information may be predicted using intra prediction mode information for predicting luminance information or predicted luminance signal information.

[0074] When the size of the prediction unit is the same as the size of the transform unit when performing intra prediction, intra prediction of the prediction unit can be performed based on the pixels on the left, the pixels on the upper left, and the pixels on the top of the prediction unit. However, when the size of the prediction unit is different from the size of the transform unit when performing intra prediction, intra prediction can be performed using reference pixels determined based on the transform unit. In addition, intra prediction using N×N partitioning can be used for only the minimum coding unit.

[0075] In the intra prediction method, a prediction block may be generated by applying an adaptive intra smoothing (AIS) filter to reference pixels according to a prediction mode. Different types of AIS filters may be applied to reference pixels. In the intra prediction method, an intra prediction mode of a current prediction unit may be predicted based on an intra prediction mode of a prediction unit adjacent to the current prediction unit. When the prediction mode of the current prediction unit is predicted using mode information predicted based on adjacent prediction units, when the current prediction unit has the same intra prediction mode as the adjacent prediction unit, predetermined flag information may be used to send information indicating that the current prediction unit has the same prediction mode as the adjacent prediction unit. When the current prediction unit has different prediction modes from the adjacent prediction unit, information about the prediction mode of the current block may be encoded by entropy coding.

[0076] A residual block including residual information may be generated. The residual information is a difference between the prediction unit generated by the prediction units 120 and 125 and the original block of the prediction unit. The generated residual block may be input to the transform unit 130.

[0077] The transform unit 130 may transform the residual block including residual information between the prediction unit generated by the prediction units 120 and 125 and the original block by using a transform type such as DCT (Discrete Cosine Transform), DST (Discrete Sine Transform), or KLT. Whether to apply DCT, DST, or KLT to transform the residual block may be determined based on intra prediction mode information of the prediction unit used to generate the residual block.

[0078] The quantization unit 135 may quantize the value transformed to the frequency domain by the transformation unit 130. The quantization coefficient may be changed depending on the importance or block of the image. The value output from the quantization unit 135 may be provided to the inverse quantization unit 140 and the rearrangement unit 160.

[0079] The rearrangement unit 160 may perform rearrangement on coefficient values ​​of the quantized residual.

[0080] The rearrangement unit 160 may convert the coefficients of the two-dimensional (2D) block into coefficients of a one-dimensional (1D) vector by a coefficient scanning method. For example, the rearrangement unit 160 may scan the DC coefficient into coefficients in a high frequency region using a Z-shaped scanning method and convert it into a one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, a vertical scan that scans the two-dimensional block shape coefficients in the column direction and a horizontal scan that scans the two-dimensional block shape coefficients in the row direction may be used instead of the Z-shaped scan. That is, depending on the size of the transform unit and the intra-frame prediction mode, it may be determined which of the Z-shaped scan, the vertical direction scan, and the horizontal direction scan to use.

[0081] The entropy encoding unit 165 may perform entropy encoding based on the value obtained by the rearrangement unit 160. For entropy encoding, various encoding methods such as exponential Golomb coding, context-adaptive variable length coding (CAVLC), or context-adaptive binary arithmetic coding (CABAC) may be used.

[0082] The entropy coding unit 165 may encode various information from the rearrangement unit 160 and the prediction units 120 and 125, such as residual coefficient information and block type information of the coding unit, prediction mode information, partition unit information, prediction unit information, transmission unit information, motion vector information, reference frame information, block interpolation information, and filtering information.

[0083] The entropy encoding unit 165 may entropy encode the coefficients of the coding unit input from the rearrangement unit 160 .

[0084] The inverse quantization unit 140 and the inverse transform unit 145 dequantize the value quantized by the quantization unit 135 and inversely transform the value transformed by the transform unit 130. A reconstructed block may be generated by adding a residual value to the predicted prediction unit. The residual value may be generated by the inverse quantization unit 140 and the inverse transform unit 145. The predicted prediction unit may be predicted by a motion vector prediction unit, a motion compensation unit, and an intra prediction unit of the prediction units 120 and 125.

[0085] The filter unit 150 may include at least one of a deblocking filter, an offset unit, and an adaptive loop filter (ALF).

[0086] The deblocking filter can remove block distortion generated by the boundaries between blocks in the reconstructed picture. It can be determined whether to apply the deblocking filter to the current block based on the pixels included in several rows or columns of the block. When the deblocking filter is applied to the block, a strong filter or a weak filter can be applied according to the required deblocking filter strength. When horizontal filtering and vertical filtering are performed when applying the deblocking filter, horizontal filtering and vertical filtering can be performed in parallel.

[0087] The offset unit may apply an offset to the deblocking filtered image relative to the original image in units of pixels. The region to which the offset may be applied may be determined after dividing the pixels of the picture into a predetermined number of regions. The offset may be applied to the determined region in consideration of edge information about each pixel or a method of applying the offset to the determined region.

[0088] ALF can perform filtering based on the comparison result of the filtered reconstructed image with the original image. The pixels included in the image can be divided into predetermined groups, the filter to be applied to each group can be determined, and differential filtering can be performed for each group. Information on whether ALF is applied can be transmitted by each coding unit (CU), and the shape and filter coefficient of ALF to be applied to each block can vary. In addition, ALF having the same form (fixed form) can be applied to the block regardless of the characteristics of the block.

[0089] The memory 155 may store the reconstructed block or the reconstructed picture output from the filter unit 150 , and when inter prediction is performed, may provide the stored reconstructed block or the reconstructed picture to the prediction units 120 and 125 .

[0090] Figure 2 is a block diagram illustrating an image decoding apparatus according to an exemplary embodiment of the present invention.

[0091] Reference Figure 2, the image decoding device 200 may include an entropy decoding unit 210 , a rearrangement unit 215 , a dequantization unit 220 , an inverse transform unit 225 , prediction units 230 and 235 , a filter unit 240 , and a memory 245 .

[0092] When an image bit stream is input from the image encoding device, the input bit stream may be decoded in a process opposite to that of the image encoding device.

[0093] The entropy decoding unit 210 may perform entropy decoding in a process opposite to the process of performing entropy encoding in the entropy encoding unit of the image encoding device. For example, various methods such as exponential Golomb coding, CAVLC, or CABAC may be applied corresponding to the method performed by the image encoding device.

[0094] The entropy decoding unit 210 may decode information associated with intra prediction and inter prediction performed by the encoding device.

[0095] The rearrangement unit 215 may perform rearrangement of the bitstream entropy-decoded by the entropy decoding unit 210 based on the rearrangement method of the encoding device. The rearrangement unit 215 may reconstruct the coefficients of the 1D vector into coefficients of the 2D block and rearrange. Information about the coefficient scanning performed by the encoding device may be provided to the rearrangement unit 215, and the rearrangement unit 215 may perform rearrangement using a method of inversely scanning the coefficients based on the scanning order performed by the encoding device.

[0096] The dequantization unit 220 may perform dequantization based on a quantization parameter provided by the encoding device and a rearrangement coefficient of the block.

[0097] The inverse transform unit 225 may perform inverse transforms, i.e., inverse DCT, inverse DST, and inverse KLT, relative to the transforms (i.e., DCT, DST, and KLT) performed by the transform unit on the quantization result performed by the image encoding device. The inverse transform may be performed based on the transmission unit determined by the image encoding device. The inverse transform unit 225 of the image decoding device may selectively perform transform techniques (e.g., DCT, DST, KLT) according to multiple pieces of information such as a prediction method, a size of a current block, and a prediction direction.

[0098] The prediction units 230 and 235 may generate a prediction block based on the provided information for generating the prediction block and information about a previously decoded block or picture. The information for generating the prediction block may be provided by the entropy decoding unit 210. The information about the previously decoded block or picture may be provided by the memory 245.

[0099] As described above, when intra prediction is performed in the same manner as the operation of the image encoding device, if the size of the prediction unit is the same as the size of the transform unit, intra prediction of the prediction unit can be performed based on the pixels on the left, the pixels on the upper left, and the pixels on the top of the prediction unit. However, when intra prediction is performed, if the size of the prediction unit is different from the size of the transform unit, intra prediction of the prediction unit can be performed using reference pixels determined based on the transform unit. In addition, intra prediction using N×N partitioning can be used for only the minimum coding unit.

[0100] The prediction units 230 and 235 may include a prediction unit determination unit, an inter-frame prediction unit, and an intra-frame prediction unit. The prediction unit determination unit may receive various information such as prediction unit information, prediction mode information of an intra-frame prediction method, and motion prediction related information of an inter-frame prediction method from the entropy decoding unit 210, and may determine the prediction unit of the current coding unit. The prediction unit determination unit may determine which of inter-frame prediction and intra-frame prediction is performed on the prediction unit. The inter-frame prediction unit 230 may perform inter-frame prediction on the current prediction unit based on information about at least one of the previous picture and the subsequent picture of the current picture including the current prediction unit. In this article, the inter-frame prediction unit 230 may use the information required for the inter-frame prediction of the current prediction unit provided from the image encoding device. Inter-frame prediction may be performed based on information of a pre-reconstructed partial area in the current picture including the current prediction unit.

[0101] In order to perform inter prediction, whether a motion prediction method of a prediction unit included in a coding unit is a skip mode, a merge mode, an AMVP mode, or an intra block copy mode may be determined in units of coding units.

[0102] The intra prediction unit 235 can generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit on which intra prediction is performed, intra prediction can be performed based on intra prediction mode information about the prediction unit provided from the image encoding device. The intra prediction unit 235 may include an AIS (adaptive intra smoothing) filter, a reference pixel interpolation unit, and a DC filter. The AIS filter performs filtering on the reference pixels of the current block. The AIS filter can determine whether to apply the filter based on the prediction mode of the current prediction unit. AIS filtering can be performed on the reference pixels of the current block using information about the AIS filter provided from the image encoding device and the prediction mode of the prediction unit. When the prediction mode of the current block is a mode in which AIS filtering is not performed, the AIS filter may not be applied.

[0103] When the prediction mode of the prediction unit indicates a prediction mode for performing intra-frame prediction based on a pixel value obtained by interpolating the reference pixel, the reference pixel interpolation unit may generate the reference pixel by interpolating the reference pixel in units of fractional pixels smaller than an integer pixel (i.e., a full pixel). When the prediction mode of the current prediction unit indicates a prediction mode for generating a prediction block without interpolating the reference pixel, the reference pixel may not be interpolated. When the prediction mode of the current block is a DC mode, the DC filter may generate a prediction block by filtering.

[0104] The reconstructed block or the reconstructed picture may be provided to the filter unit 240. The filter unit 240 includes a deblocking filter, an offset unit, and an ALF.

[0105] The image encoding device may provide information about whether to apply a deblocking filter to a corresponding block or picture and information about which of a strong filter and a weak filter to apply when using the deblocking filter. The deblocking filter of the image decoding device may be provided with information about the deblocking filter from the image encoding device, and the deblocking filter may perform deblocking filtering on the corresponding block.

[0106] The offset unit may apply an offset to the reconstructed picture based on information about an offset type and an offset value applied to the picture during encoding.

[0107] ALF may be applied to the coding unit based on information on whether ALF is applied and ALF coefficient information, etc., provided from the encoding device. The ALF information may be included in a specific parameter set and provided in the specific parameter set.

[0108] The memory 245 may store a reconstructed picture or a reconstructed block used as a reference picture or a reference block, and may provide the reconstructed picture to the output unit.

[0109] As described above, in the embodiments of the present invention, for convenience of description, a coding unit is used as an encoding unit, but the coding unit may be a unit that performs not only encoding but also decoding.

[0110] Figure 3 Block partition types according to an embodiment to which the present invention is applied are shown.

[0111] One block (hereinafter referred to as a first block) may be divided into a plurality of sub-blocks (hereinafter referred to as a second block) by at least one of a vertical line or a horizontal line. The number of each of the vertical lines and the horizontal lines may be one, two or more. Here, the first block may be a coding block (CU) as a basic unit of image encoding / decoding, a prediction block (PU) as a basic unit of prediction encoding / decoding, or a transform block (TU) as a basic unit of transform encoding / decoding. The first block may be a square block or a non-square block.

[0112] The partitioning of the first block may be performed based on a quadtree, a binary tree, a ternary tree, etc., and the reference Figure 3 Describe in detail.

[0113] Figure 3 (a) shows a quadtree partition (QT). QT is a partition type in which a first block is partitioned into four second blocks. For example, when a 2N×2N first block is partitioned by QT, the first block may be partitioned into four second blocks having a size of N×N. QT may be limited to be applicable to only square blocks, but may also be applicable to non-square blocks.

[0114] Figure 3 (b) shows a horizontal binary tree (hereinafter referred to as horizontal BT) partition. Horizontal BT is a partition type in which a first block is divided into two second blocks by a horizontal line. The partition can be performed symmetrically or asymmetrically. For example, when a 2N×2N first block is divided based on horizontal BT, the first block can be divided into two second blocks with a height ratio of (a:b). Here, a and b can be the same value, and a can be greater than or less than b.

[0115] Figure 3 (c) shows a vertical binary tree (hereinafter referred to as vertical BT) partition. Vertical BT is a partition type in which a first block is divided into two second blocks by a vertical line. The partition can be performed symmetrically or asymmetrically. For example, when a 2N×2N first block is divided based on vertical BT, the first block can be divided into two second blocks with a width ratio of (a:b). Here, a and b can be the same value, and a can be greater than or less than b.

[0116] Figure 3 (d) shows a horizontal ternary tree (hereinafter referred to as horizontal TT) partition. Horizontal TT is a partition type in which a first block is divided into three second blocks by two horizontal lines. For example, when a 2N×2N first block is divided based on horizontal TT, the first block may be divided into three second blocks with a height ratio of (a:b:c). Here, a, b, and c may be the same value. Alternatively, a and c may be the same, and b may be greater than or less than a.

[0117] Figure 3 (e) shows a vertical ternary tree (hereinafter referred to as vertical TT) partition. Vertical TT is a partition type in which a first block is divided into three second blocks by two vertical lines. For example, when a 2N×2N first block is divided based on vertical TT, the first block can be divided into three second blocks with a width ratio of (a:b:c). Here, a, b, and c can be the same value or different values. Alternatively, a and c can be the same, and b can be greater than or less than a. Alternatively, a and b can be the same, and c can be greater than or less than a. Alternatively, b and c are the same, and a can be greater than or less than b.

[0118] The above-mentioned splitting may be performed based on splitting information signaled from the encoding device. The splitting information may include at least one of splitting type information, splitting direction information, or splitting ratio information.

[0119] The partition type information may specify any one of the partition types predefined in the encoding / decoding device. The predefined partition types may include at least one of QT, horizontal BT, vertical BT, horizontal TT, vertical TT, or non-partition mode (no split). Alternatively, the partition type information may mean information about whether QT, BT, or TT is applied, and may be encoded in the form of a tag or an index. In the case of BT or TT, the partition direction information may indicate whether it is horizontal partitioning or vertical partitioning. In the case of BT or TT, the partition ratio information may indicate the ratio of the width and / or height of the second block.

[0120] Figure 4 A tree-structure based block partitioning method according to an embodiment of the present invention is shown.

[0121] Figure 4 The block 400 shown is assumed to be a square block of size 8N×8N and a partition depth of k (hereinafter referred to as a first block). When the partition information of the first block indicates QT partitioning, the first block may be divided into four sub-blocks (hereinafter referred to as a second block). The size of the second block may be 4N×4N, and the partition depth may be (k+1).

[0122] The four second blocks may be divided again based on QT, BT, TT or non-division mode. For example, when the division information of the second block indicates a horizontal binary tree (horizontal BT), as Figure 4 In the second block 410, the second block is divided into two sub-blocks (hereinafter referred to as the third block). At this time, the size of the third block may be 4N×2N, and the division depth may be (k+2).

[0123] The third block may be further divided based on QT, BT, TT or non-division mode. For example, when the division information of the third block indicates a vertical binary tree (vertical BT), the third block is divided into two sub-blocks 411 and 412, as shown in FIG. Figure 4 As shown. At this time, the size of sub-blocks 411 and 412 may be 2N×2N and the division depth may be (k+3). Alternatively, when the division information of the third block indicates a horizontal binary tree (horizontal BT), the third block may be divided into two sub-blocks 413 and 414, as shown in FIG. Figure 4 In this case, the size of sub-blocks 413 and 414 may be 4N×N and the partition depth may be (k+3).

[0124] The partitioning may be performed independently or in parallel with adjacent blocks, or may be performed sequentially according to a predetermined priority order.

[0125] The division information of the current block can be determined based on at least one of the division information of the upper block of the current block or the division information of the adjacent block. For example, when the second block is divided based on the horizontal BT and the upper third block is divided based on the vertical BT, there is no need to divide the lower third block based on the vertical BT. If the lower third block is divided by the vertical BT, this is the same as the result of dividing the second block by QT. Therefore, the encoding of the division information of the lower third block (especially the division direction information) can be skipped, and the decoding device can be configured to divide the lower third block in the horizontal direction.

[0126] The upper block may mean a block having a smaller partition depth than the partition depth of the current block. For example, when the partition depth of the current block is (k+2), the partition depth of the upper block may be (k+1). The neighboring block may be a block adjacent to the top or left side of the current block. The neighboring block may be a block having the same partition depth as the current block.

[0127] The above division can be performed repeatedly until the minimum unit of encoding / decoding. When divided into the minimum unit, the division information of the block is no longer notified by signal from the encoding device. The information about the minimum unit may include at least one of the size or shape of the minimum unit. The size of the minimum unit may be represented by width, height, minimum or maximum value of width and height, sum of width and height, number of pixels or division depth. The information about the minimum unit may be notified by signal in at least one of a video sequence, a picture, a slice or a block unit. Alternatively, the information about the minimum unit may be a value predefined in the encoding / decoding device. Information about the minimum unit may be notified by signal for each of CU, PU and TU. Information about a minimum unit may be equally applied to CU, PU and TU.

[0128] Figure 5is an exemplary diagram showing intra prediction modes predefined in an image encoding / decoding apparatus.

[0129] Reference Figure 5 , the predefined intra prediction mode may be defined as a prediction mode candidate group consisting of 67 modes, and may include 65 directional modes (No. 2 to No. 66) and 2 non-directional modes (DC, plane). In this case, the directional mode may be classified by slope (e.g., dy / dx) or angle information (degrees). All or some of the intra prediction modes described in the above examples may be included in the prediction mode candidate group of the luminance component or the chrominance component, and other additional modes may be included in the prediction mode candidate group.

[0130] In addition, a reconstructed block of another color space that has been encoded / decoded using the correlation between color spaces may be used for prediction of the current block, and a prediction mode supporting the reconstructed block may be included. For example, in the case of a chrominance component, a prediction block of the current block may be generated by using a reconstructed block of a luminance component corresponding to the current block. That is, a prediction block may be generated based on the reconstructed block in consideration of the correlation between color spaces.

[0131] The prediction mode candidate groups may be adaptively determined according to encoding / decoding settings. The number of candidate groups may be increased to improve the accuracy of prediction, and may be reduced to reduce the number of bits according to the prediction mode.

[0132] For example, one of candidate group A (67: 65 directional modes and 2 non-directional modes), candidate group B (35: 33 directional modes and 2 non-directional modes), candidate group C (18: 17 directional modes and 1 non-directional mode), etc. may be selected. The candidate group may be selected or determined according to the size and shape of the block.

[0133] In addition, depending on the encoding / decoding settings, there may be various configurations of the prediction mode candidate group. Figure 5 As shown, the prediction mode candidate groups can be evenly allocated between the modes, or Figure 5 , the number of modes between modes 18 and 34 may be greater than the number of modes between modes 2 and 18. Alternatively, the opposite is also possible. The candidate group may be adaptively configured according to the shape of the block (i.e., square, non-square in which the width is greater than the height, non-square in which the height is greater than the width, etc.).

[0134] For example, when the width of the current block is greater than the height, all or some of the intra prediction modes belonging to 2 to 15 may not be used and may be replaced by all or some of the intra prediction modes belonging to 67 to 80. On the other hand, when the width of the current block is less than the height, all or some of the intra prediction modes belonging to 53 to 66 may not be used and may be replaced by all or some of the intra prediction modes belonging to -14 to -1.

[0135] In the present invention, unless otherwise specified, it is assumed that intra prediction is performed using one preset prediction mode candidate group (Candidate A) with equal mode intervals, but the main elements of the present invention may be changed and applied to an adaptive intra prediction setting as described above.

[0136] Figure 6 An intra prediction method according to an embodiment to which the present invention is applied is shown.

[0137] Reference Figure 6 , a reference area for intra prediction of a current block may be determined ( S600 ).

[0138] The encoding / decoding device may define a plurality of pixel rows that may be used for intra prediction. The plurality of pixel rows may include at least one of: a first pixel row adjacent to the current block, a second pixel row adjacent to the first pixel row, a third pixel row adjacent to the second pixel row, or a fourth pixel row adjacent to the third pixel row.

[0139] For example, depending on the encoding / decoding settings, the plurality of pixel rows may include all of the first to fourth pixel rows, or may include only the remaining pixel rows except the third pixel row. Alternatively, the plurality of pixel rows may include only the first and fourth pixel rows.

[0140] The current block may select one or more pixel rows from a plurality of pixel rows and use them as a reference area. In this case, the selection may be performed based on an index (refIdx) signaled by the encoding device. Alternatively, the selection may be performed based on predetermined encoding information of the current block. Here, the encoding information may include at least one of the following: size, shape, partition type, whether the intra-frame prediction mode is a non-directional mode, whether the intra-frame prediction mode has horizontal directivity, the angle of the intra-frame prediction mode, or the component type. For example, when the intra-frame prediction mode is a plane mode or a DC mode, only the first pixel row may be used. Alternatively, when the size of the current block is less than or equal to a predetermined threshold, only the first pixel row may be used. Here, the size may be expressed as any one of the following: the width or height (e.g., maximum value, minimum value, etc.) of the current block, the sum of the width and height, or the number of samples belonging to the current block. Alternatively, when the intra-frame prediction mode is greater than a predetermined threshold angle (or less than a predetermined threshold angle), only the first pixel row may be used. The threshold angle may be the angle of the intra-frame prediction mode corresponding to mode 2 or mode 66 in the above-mentioned prediction mode candidate group.

[0141] Reference Figure 6 , the intra prediction mode of the current block can be determined (S610).

[0142] The current block is a concept including a luminance block and a chrominance block, and an intra prediction mode may be determined for each of the luminance block and the chrominance block. Hereinafter, it is assumed that the intra prediction modes predefined in the decoding apparatus include a non-directional mode (planar mode, DC mode) and 65 directional modes.

[0143] The above-mentioned predefined intra prediction modes can be divided into an MPM candidate group and a non-MPM candidate group. The intra prediction mode of the current block can be derived by selectively using one of the MPM candidate group or the non-MPM candidate group. To this end, a mark indicating whether the intra prediction mode of the current block is derived from the MPM candidate group can be used. For example, when the mark is a first value, the MPM candidate group can be used, and when the mark is a second value, the non-MPM candidate group can be used. The mark can be encoded by the encoding device and the mark can be notified by a signal. Alternatively, the mark can be derived from the decoding device based on predetermined encoding information. The encoding information is the same as above, and redundant descriptions will be omitted.

[0144] When the flag is the first value, the intra prediction mode of the current block can be derived based on the MPM candidate group and the MPM index. The MPM candidate group includes one or more MPMs, and one or more MPMs can be determined based on the intra prediction mode of the neighboring blocks of the current block. The number of MPMs is r, and r can be an integer of 1, 2, 3, 4, 5, 6 or more. The number of MPMs can be a fixed value submitted in advance to the encoding / decoding device, or the number of MPMs can be variably determined based on the above-mentioned encoding information.

[0145] For example, the MPM candidate group may include at least one of the intra prediction mode (mode A), mode An, mode A+n, or default mode of the neighboring block. The n value may be an integer of 1, 2, 3, 4, or more. The neighboring block may mean a block adjacent to the left and / or top of the current block. However, the present invention is not limited thereto, and the neighboring block may include at least one of the upper left neighboring block, the lower left neighboring block, or the upper right neighboring block. The default mode may be at least one of a plane mode, a DC mode, or a predetermined direction mode. The predetermined direction mode may include at least one of a horizontal mode (mode V), a vertical mode (mode H), a mode Vk, a mode V+k, a mode Hk, or a mode H+k.

[0146] The MPM index may specify the same MPM as the intra prediction mode of the current block among the MPMs of the MPM candidate group. That is, the MPM specified by the MPM index may be set as the intra prediction mode of the current block.

[0147] Alternatively, the MPM candidate group may be divided into a plurality of groups. For example, it is assumed that the MPM candidate group is divided into a first group and a second group. The first group may be configured with at least one of the above-mentioned default modes. For example, the first group may be configured with only a non-directional mode, or may be configured with only a predetermined directional mode. Alternatively, the first group may be configured with only a plane mode having only a non-directional mode, or may be configured with only a DC mode. The second group may include at least one of the intra prediction mode (mode A), mode An, mode A+n, or a default mode of the neighboring block. The n value may be an integer of 1, 2, 3, 4, or more. The neighboring block may mean a block adjacent to the left and / or top of the current block. However, the present invention is not limited thereto, and the neighboring block may include at least one of the upper left neighboring block, the lower left neighboring block, or the upper right neighboring block. The default mode may be at least one of a plane mode, a DC mode, or a predetermined directional mode. The predetermined directional mode may include at least one of a horizontal mode (mode V), a vertical mode (mode H), a mode Vk, a mode V+k, a mode Hk, or a mode H+k. However, the second group may be set to not include the MPM belonging to the first group.

[0148] The intra prediction mode of the current block can be derived by selectively using one of the first group or the second group. To this end, a flag indicating whether the intra prediction mode of the current block is derived from the first group can be used. For example, when the flag is a first value, the intra prediction mode of the current block can be set to the MPM belonging to the first group. On the other hand, when the flag is a second value, the intra prediction mode of the current block can be derived based on the second group and the MPM index. Here, the MPM index is the same as above, and the detailed description will be omitted.

[0149] The flag may be encoded by an encoding device and signaled. However, the flag may be adaptively signaled in consideration of predetermined encoding information of the current block. Here, the encoding information may include at least one of a size, a shape, a partition type, or a reference area. Here, the partition type may mean a quadtree, a binary tree, a ternary tree, or whether intra prediction is performed in units of subblocks.

[0150] For example, the flag may be signaled only when the reference area of ​​the current block is the first pixel row (implementation mode 1). If the reference area of ​​the current block is not the first pixel row, the flag may not be signaled, and the flag may be set to the second value in the decoding device. In this way, when the current block does not refer to the first pixel row, the introduction of the intra prediction mode based on the first group may be limited.

[0151] In addition, only when the current block does not perform intra-frame prediction in units of sub-blocks, the flag can be notified by signal (implementation method 2). On the contrary, when the current block performs intra-frame prediction in units of sub-blocks, the flag may not be notified by signal, and the flag may be set to a second value in the decoding device.

[0152] When one of the conditions in the above-mentioned Embodiment 1 or 2 is satisfied, the flag may be signaled, or when both Embodiments 1 and 2 are satisfied, the flag may be set to be signaled.

[0153] Reference Figure 6 , intra prediction may be performed on the current block based on the reference area for intra prediction and the intra prediction mode (S620).

[0154] Intra-frame prediction can be performed in units of sub-blocks of the current block. To this end, the current block can be divided into a plurality of sub-blocks. Figure 7 Describe the partitioning method in detail.

[0155] Figure 7 An intra prediction method in subblock units is shown as an embodiment to which the present invention is applied.

[0156] As described above, the current block may be divided into a plurality of sub-blocks. In this case, the current block may correspond to a leaf node. A leaf node may mean a coding block that is no longer divided into smaller coding blocks. That is, a leaf node may mean a coding block that is no longer divided by the above-mentioned tree-based block partitioning.

[0157] The splitting may be performed based on the size of the current block (Implementation 1).

[0158] Reference Figure 7 When the size of the current block 700 is smaller than a predetermined threshold size, the current block may be divided vertically or horizontally into two. Conversely, when the size of the current block 710 is greater than or equal to the threshold size, the current block may be divided vertically or horizontally into four.

[0159] The threshold size may be signaled by the encoding device, or may be a fixed value predefined in the decoding device. For example, the threshold size is represented as N×M, and N and M may be 4, 8, 16 or more. N and M may be the same, or may be set differently from each other.

[0160] Alternatively, if the size of the current block is smaller than a predetermined threshold size, the current block may not be divided (not split), otherwise, the current block may be divided into two or four.

[0161] The division may be performed based on the shape of the current block (embodiment 2).

[0162] If the shape of the current block is a square, the current block can be divided into four, otherwise, the current block can be divided into two. On the contrary, when the shape of the current block is a square, the current block can be divided into two, otherwise, the current block can be divided into four.

[0163] Alternatively, if the shape of the current block is a square, the current block is divided into two or four, otherwise, the current block may not be divided. On the contrary, if the shape of the current block is a square, the current block may not be divided, otherwise, the current block may be divided into two or four.

[0164] The division may be performed by selectively applying any one of the above-described Embodiment Mode 1 or Embodiment Mode 2, or may be performed based on a combination of Embodiment Mode 1 and Embodiment Mode 2.

[0165] 2-division is division into two in the vertical or horizontal direction, and 4-division may include division into four in the vertical or horizontal direction, or division into four in the vertical and horizontal directions.

[0166] In the above embodiments, 2-partition or 4-partition is described, but the present invention is not limited thereto, and the current block may be divided into three in the vertical or horizontal direction. In this case, the ratio of width or height may be (1:1:2), (1:2:1) or (2:1:1).

[0167] Information about whether to be divided into sub-block units, whether to be divided into four, and the number of divisions may be notified by the encoding device with a signal, or may be variably determined by the decoding device based on a predetermined encoding parameter. Here, the encoding parameter represents block size / shape, division type (4-division, 2-division, 3-division), intra-frame prediction mode, range / position of neighboring pixels for intra-frame prediction and component type (e.g., luminance and chrominance), maximum / minimum size of transform block, transform type (e.g., transform skip, DCT2, DST7, DCT8), etc.

[0168] Figure 8 A prediction method based on inter-component reference in an embodiment to which the present disclosure is applied is shown.

[0169] According to the component type, the current block can be divided into a luminance block and a chrominance block. The chrominance block can be predicted using the pixels of the reconstructed luminance block. This is called inter-component reference. In this embodiment, it is assumed that the size of the chrominance block is (nTbW×nTbH), and the size of the luminance block corresponding to the chrominance block is (2*nTbW×2*nTbH). This assumes the case where the length ratio of the width and height between the luminance block and the chrominance block is 2:1, but even if one of the width and height is 1:1 and the other is 2:1, or both are 1:1, the examples described below can be applied identically or similarly.

[0170] Reference Figure 8 , the intra prediction mode of the chrominance block may be determined (S800).

[0171] Specifically, the predefined intra prediction modes for the chrominance block may be divided into a first group and a second group. Here, the first group may be configured as a prediction mode based on an inter-component reference, and the second group may be configured as a predefined intra prediction mode for a luminance block. The encoding / decoding apparatus may define at least one of INTRA_LT_CCLM, INTRA_L_CCLM, or INTRA_T_CCLM as a prediction mode based on an inter-component reference.

[0172] The intra prediction mode of the chroma block can be obtained by selectively using one of the first group or the second group. The selection can be performed based on a predetermined first flag. The first flag can indicate that the intra prediction mode of the chroma block is obtained based on the first group or the second group.

[0173] For example, when the first flag is a first value, the intra prediction mode of the chroma block can be determined as one of one or more inter-component reference-based prediction modes belonging to the first group. To this end, an index specifying any one of the inter-component reference-based prediction modes belonging to the first group can be used. The inter-component reference-based prediction modes belonging to the first group and the index assigned to each prediction mode are shown in Table 1 below.

[0174] [Table 1]

[0175] Idx Prediction mode based on inter-component reference 0 INTRA_LT_CCLM 1 INTRA_L_CCLM 2 INTRA_T_CCLM

[0176] Table 1 is only an example of the index assigned to each prediction mode, and is not limited thereto. That is, as shown in Table 1, the index may be assigned in the priority order of INTRA_LT_CCLM, INTRA_L_CCLM, INTRA_T_CCLM, or the index may be assigned in the priority order of INTRA_LT_CCLM, INTRA_T_CCLM, INTRA_L_CCLM. Alternatively, INTRA_LT_CCLM may have a lower priority order than INTRA_T_CCLM or INTRA_L_CCLM.

[0177] The first flag may be selectively signaled based on the information indicating whether inter-component reference is allowed. For example, if the value of the information is 1, the first flag may be signaled, otherwise, the first flag may not be signaled. Here, the information may be determined to be 0 or 1 based on a predetermined condition to be described later.

[0178] (Condition 1) When the second flag indicating whether prediction based on inter-component reference is allowed is 0, the information may be set to 0. The second flag may be signaled in at least one of a video parameter set (VPS), a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header.

[0179] (Condition 2) When at least one of the following sub-conditions is satisfied, the information can be set to 1.

[0180] -qtbtt_dual_tree_intra_flag has a value of 0

[0181] - Slice type is not an I slice

[0182] - The size of the coding tree block is less than 64×64

[0183] In condition 2, qtbtt_dual_tree_intra_flag may indicate whether the coding tree block is implicitly divided into 64×64 coding blocks and the 64×64 coding blocks are divided based on a dual tree. The dual tree may refer to a method in which the luminance component and the chrominance component are divided in an independent partitioning structure. The size (CtbLog2Size) of the coding tree block may be a predefined size (e.g., 64×64, 128×128, 256×256) in the encoding / decoding device, or may be encoded by the encoding device and signaled.

[0184] (Condition 3) This information can be set to 1 when at least one of the following sub-conditions is satisfied.

[0185] - The width and height of the first upper block is 64

[0186] - The depth of the first upper block is the same as (CtbLog2Size-6), the first upper block is divided based on the horizontal BT, and the second upper block is 64×32

[0187] - The depth of the first upper block is greater than (CtbLog2Size-6)

[0188] - The depth of the first upper block is the same as (CtbLog2Size-6), the first upper block is divided based on the horizontal BT, and the second upper block is divided based on the vertical BT

[0189] In condition 3, the first upper block may be a block including the current chroma block as a lower block. For example, when the depth of the current chroma block is k, the depth of the first upper block is (kn), and n may be 1, 2, 3, 4 or more. The depth of the first upper block may only mean the depth according to the partition based on the quadtree, or may mean the depth according to the partition of at least one of the quadtree, the binary tree or the ternary tree. The second upper block is a lower block belonging to the first upper block, and may have a depth less than the current chroma block and a depth greater than the first upper block. For example, when the depth of the current chroma block is k, the depth of the second upper block is (km), and m may be a natural number less than n.

[0190] When all of the above conditions 1 to 3 are not met, the information can be set to 0.

[0191] However, even in the case where at least one of the conditions 1 to 3 is satisfied, the information may be reset to 0 when at least one of the following sub-conditions is satisfied.

[0192] -The first upper block is 64×64, and the above sub-block unit prediction is performed

[0193] - At least one of the width or height of the first upper block is less than 64, and the depth of the first upper block is equal to (CtbLog2Size-6)

[0194] On the other hand, when the flag is the second value, the intra prediction mode (intra_chroma_pred_mode) of the chroma block can be obtained based on information signaled by the encoding device as shown in Table 2 below.

[0195] [Table 2]

[0196]

[0197] According to Table 2, the intra prediction mode of the chroma block may be determined based on the information notified by the signal and the intra prediction mode of the luma block. In Table 2, mode 66 may mean a diagonal mode in the upper right direction, mode 50 may mean a vertical mode, mode 18 may mean a horizontal mode, and mode 1 may mean a DC mode. For example, when the value of the signaled information intra_chroma_pred_mode is 4, the intra prediction mode of the chroma block may be set to be the same as the intra prediction mode of the luma block. When the intra prediction mode of the chroma block is obtained from the second group, the intra prediction mode of the chroma block may be determined based on the information notified by the signal. Figure 6 The intra-frame prediction method is used to predict the chrominance block, and the detailed description will be omitted. Figure 8 , a luma region for inter-component reference of a chroma block may be specified (S810).

[0198] The luminance region may include at least one of a luminance block or a neighboring region adjacent to the luminance block. Here, a luminance block may be defined as a region including pixels pY[x][y] (x=0..nTbW*2-1, y=0..nTbH*2-1). A pixel may mean a reconstructed value before applying an in-loop filter.

[0199] The neighboring area may include at least one of a left neighboring area, an upper neighboring area, or an upper left neighboring area. The left neighboring area may be set to an area including pixels pY[x][y] (x=-1..-3, y=0..2*numSampL-1). This setting can be performed only when the value of numSampL is greater than 0. The upper neighboring area may be set to an area including pixels pY[x][y] (x=0..2*numSampT-1, y=-1..-3). This setting can be performed only when the value of numSampT is greater than 0. The upper left neighboring area may be set to an area including pixels pY[x][y] (x=-1, y=-1, -2). This setting can be performed only when the upper left area of ​​the luminance block is available.

[0200] The above-mentioned numSampL and numSampT may be determined based on the intra prediction mode of the current block, where the current block may mean a chroma block.

[0201] For example, when the intra prediction mode of the current block is INTRA_LT_CCLM, numSampL and numSampT may be derived based on Equation 1. Here, INTRA_LT_CCLM may mean a mode of performing inter-component referencing based on a left neighboring region and an upper neighboring region of the current block.

[0202] [Equation 1]

[0203] numSampT=availT?nTbW:0

[0204] numSampL=availL?nTbH:0

[0205] According to Equation 1, when the upper neighboring area of ​​the current block is available, numSampT is derived as nTbW. Otherwise, numSampT may be derived as 0. Similarly, when the left neighboring area of ​​the current block is available, numSampL is derived as nTbH. Otherwise, numSampT may be derived as 0.

[0206] On the contrary, when the intra prediction mode of the current block is not INTRA_LT_CCLM, numSampL and numSampT may be derived based on Equation 2 below.

[0207] [Equation 2]

[0208] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)? (nTbW+numTopRight):0

[0209] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)? (nTbH+numLeftBelow):0

[0210] In Equation 2, INTRA_T_CCLM may refer to a mode for performing inter-component reference based on the upper neighboring area of ​​the current block. INTRA_L_CCLM may mean a mode for performing inter-component reference based on the left neighboring area of ​​the current block. numTopRight may mean the number of all or some pixels belonging to the upper right neighboring area of ​​the chroma block. Some pixels may refer to available pixels in the pixels of the lowest pixel row belonging to the corresponding area. In the availability determination, it may be determined sequentially in the left-to-right direction whether the pixel is available. The process may be performed until an unavailable pixel is found. numLeftBelow may mean the number of all or some pixels belonging to the lower left neighboring area of ​​the chroma block. Some pixels may refer to available pixels in the pixels of the rightmost pixel row (column) belonging to the corresponding area. In the availability determination, it may be determined sequentially in the top-to-bottom direction whether the pixel is available. The process may be performed until an unavailable pixel is found.

[0211] Reference Figure 8 , downsampling may be performed on the brightness region specified in S810 ( S820 ).

[0212] Downsampling may include at least one of the following: 1. Downsampling of the luminance block; 2. Downsampling of the left neighboring area of ​​the luminance block; or 3. Downsampling of the upper neighboring area of ​​the luminance block. This will be described in detail below.

[0213] 1. Downsampling of Luma Blocks

[0214] (Implementation Method 1)

[0215] The pixel pDsY[x][y] (x=0..nTbW-1, y=0..nTbH-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[2*x][2*y] of the luminance block and the neighboring pixel. The neighboring pixel may mean at least one of the left neighboring pixel, the right neighboring pixel, the upper neighboring pixel, or the lower neighboring pixel of the corresponding pixel. For example, the pixel pDsY[x][y] can be derived based on the following equation 3.

[0216] [Equation 3]

[0217] pDsY[x][y]=(pY[2*x][2*y-1]+pY[2*x-1][2*y]+4*pY[2*x][2*y]+pY[2*x+1][2*y]+pY[2*x][2*y+1]+4)>>3

[0218] However, there may be a situation where the left neighboring area / upper neighboring area of ​​the current block is not available. When the left neighboring area of ​​the current block is not available, the pixel pDsY[0][y] (y=1..nTbH-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[0][2*y] of the luminance block and the neighboring pixel of the corresponding pixel. The neighboring pixel may mean at least one of the upper neighboring pixel or the lower neighboring pixel of the corresponding pixel. For example, the pixel pDsY[0][y] (y=1..nTbH-1) can be derived based on the following equation 4.

[0219] [Equation 4]

[0220] pDsY[0][y]=(pY[0][2*y-1]+2*pY[0][2*y]+pY[0][2*y+1]+2)>>2

[0221] When the upper neighboring area of ​​the current block is not available, the pixel pDsY[x][0] (x=1..nTbW-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[2*x][0] of the luminance block and the neighboring pixel of the corresponding pixel. The neighboring pixel may mean at least one of the left neighboring pixel or the right neighboring pixel of the corresponding pixel. For example, the pixel pDsY[x][0] (x=1..nTbW-1) can be derived based on the following equation 5.

[0222] [Equation 5]

[0223] pDsY[x][0]=(pY[2*x-1][0]+2*pY[2*x][0]+pY[2*x+1][0]+2)>>2

[0224] The pixel pDsY[0][0] of the downsampled luma block may be derived based on the corresponding pixel pY[0][0] of the luma block and / or the neighboring pixels of the corresponding pixel. The position of the neighboring pixels may vary depending on whether the left neighboring area / upper neighboring area of ​​the current block is available.

[0225] For example, when the left neighboring area is available and the upper neighboring area is not available, pDsY[0][0] may be derived based on the following Equation 6.

[0226] [Equation 6]

[0227] pDsY[0][0]=(pY[-1][0]+2*pY[0][0]+pY[1][0]+2)>>2

[0228] On the contrary, when the left neighboring area is unavailable and the upper neighboring area is available, pDsY[0][0] can be derived based on the following Equation 7.

[0229] [Equation 7]

[0230] pDsY[0][0]=(pY[0][-1]+2*pY[0][0]+pY[0][1]+2)>>2

[0231] In another example, when both the left neighboring area and the upper neighboring area are unavailable, pDsY[0][0] may be set to the corresponding pixel pY[0][0] of the luma block.

[0232] (Implementation Method 2)

[0233] The pixel pDsY[x][y] (x=0..nTbW-1, y=0..nTbH-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[2*x][2*y] of the luminance block and the neighboring pixel of the corresponding pixel. The neighboring pixel may mean at least one of the lower neighboring pixel, the left neighboring pixel, the right neighboring pixel, the lower left neighboring pixel, or the lower right neighboring pixel of the corresponding pixel. For example, the pixel pDsY[x][y] can be derived based on the following equation 8.

[0234] [Equation 8]

[0235] pDsY[x][y]=(pY[2*x-1][2*y]+pY[2*x-1][2*y+1]+2*pY[2*x][2*y]+2*pY[2*x][2*y+1]+pY[2*x+1][2*y]+pY[2*x+1][2*y+1]+4)>>3

[0236] However, when the left neighboring area of ​​the current block is not available, the pixel pDsY[0][y] (y=0..nTbH-1) of the downsampled luminance block can be derived based on the corresponding pixel pY[0][2*y] of the luminance block and the lower neighboring pixel of the corresponding pixel. For example, the pixel pDsY[0][y] (y=0..nTbH-1) can be derived based on the following equation 9.

[0237] [Equation 9]

[0238] pDsY[0][y]=(pY[0][2*y]+pY[0][2*y+1]+1)>>1

[0239] Downsampling of the luminance block may be performed based on one of the embodiments 1 and 2 as described above. Here, one of the embodiments 1 and 2 may be selected based on a predetermined flag. The flag may indicate whether the downsampled luminance pixel has the same position as the original luminance pixel. For example, when the flag is a first value, the downsampled luminance pixel has the same position as the original luminance pixel. On the contrary, when the flag is a second value, the downsampled luminance pixel has the same position as the original luminance pixel in the horizontal direction, but has a position offset by half a pixel in the vertical direction.

[0240] 2. Downsampling of the left neighboring area of ​​the luminance block

[0241] (Implementation Method 1)

[0242] The pixel pLeftDsY[y] (y=0..numSampL-1) of the downsampled left neighboring area can be derived based on the corresponding pixel pY[-2][2*y] of the left neighboring area and the neighboring pixel of the corresponding pixel. The neighboring pixel may mean at least one of the left neighboring pixel, the right neighboring pixel, the upper neighboring pixel, or the lower neighboring pixel of the corresponding pixel. For example, the pixel pLeftDsY[y] can be derived based on the following equation 10.

[0243] [Equation 10]

[0244] pLeftDsY[y]=(pY[-2][2*y-1]+pY[-3][2*y]+4*pY[-2][2*y]+pY[-1][2*y]+pY[-2][2*y+1]+4)>>3

[0245] However, when the upper left neighboring area of ​​the current block is not available, the pixel pLeftDsY[0] of the downsampled left neighboring area can be derived based on the corresponding pixel pY[-2][0] of the left neighboring area and the neighboring pixel of the corresponding pixel. The neighboring pixel may mean at least one of the left neighboring pixel or the right neighboring pixel of the corresponding pixel. For example, the pixel pLeftDsY[0] can be derived based on the following equation 11.

[0246] [Equation 11]

[0247] pLeftDsY[0]=(pY[-3][0]+2*pY[-2][0]+pY[-1][0]+2)>>2

[0248] (Implementation Method 2)

[0249] The pixel pLeftDsY[y] (y=0..numSampL-1) of the downsampled left neighboring area can be derived based on the corresponding pixel pY[-2][2*y] of the left neighboring area and the neighboring pixels around the corresponding pixel. The neighboring pixel may mean at least one of the lower neighboring pixel, the left neighboring pixel, the right neighboring pixel, the lower left neighboring pixel, or the lower right neighboring pixel of the corresponding pixel. For example, the pixel pLeftDsY[y] can be derived based on the following equation 12.

[0250] [Equation 12]

[0251] pLeftDsY[y]=(pY[-1][2*y]+pY[-1][2*y+1]+2*pY[-2][2*y]+2*pY[-2][2*y+1]+pY[-3][2*y]+pY[-3][2*y+1]+4)>>3

[0252] Similarly, downsampling of the left neighboring area may be performed based on one of Embodiments 1 and 2 as described above. Here, one of Embodiments 1 and 2 may be selected based on a predetermined flag. The flag indicates whether the downsampled luminance pixel has the same position as the original luminance pixel. This is the same as described above.

[0253] Downsampling of the left neighboring area may be performed only when the numSampL value is greater than 0. When the numSampL value is greater than 0, this may mean that the left neighboring area of ​​the current block is available, and the intra prediction mode of the current block is INTRA_LT_CCLM or INTRA_L_CCLM.

[0254] 3. Downsampling of the upper neighboring area of ​​the luminance block

[0255] (Implementation Method 1)

[0256] The pixel pTopDsY[x] (x=0..numSampT-1) of the downsampled upper neighboring area may be derived by considering whether the upper neighboring area belongs to a CTU different from the CTU to which the luma block belongs.

[0257] When the upper neighboring area belongs to the same CTU as the luminance block, the pixel pTopDsY[x] of the downsampled upper neighboring area can be obtained based on the corresponding pixel pY[2*x][-2] of the upper neighboring area and the neighboring pixel of the corresponding pixel. The neighboring pixel may mean at least one of the left neighboring pixel, the right neighboring pixel, the upper neighboring pixel, or the lower neighboring pixel of the corresponding pixel. For example, the pixel pTopDsY[x] can be obtained based on the following equation 13.

[0258] [Equation 13]

[0259] pTopDsY[x]=(pY[2*x][-3]+pY[2*x-1][-2]+4*pY[2*x][-2]+pY[2*x+1][-2]+pY[2*x][-1]+4)>>3

[0260] On the contrary, when the upper neighboring area belongs to a CTU different from the luminance block, the pixel pTopDsY[x] of the downsampled upper neighboring area can be obtained based on the corresponding pixel pY[2*x][-1] of the upper neighboring area and the neighboring pixel of the corresponding pixel. The neighboring pixel may mean at least one of the left neighboring pixel or the right neighboring pixel of the corresponding pixel. For example, the pixel pTopDsY[x] can be obtained based on the following equation 14.

[0261] [Equation 14]

[0262] pTopDsY[x]=(pY[2*x-1][-1]+2*pY[2*x][-1]+pY[2*x+1][-1]+2)>>2

[0263] Alternatively, when the upper left neighboring area of ​​the current block is not available, the neighboring pixel may mean at least one of the upper neighboring pixel or the lower neighboring pixel of the corresponding pixel. For example, the pixel pTopDsY[0] may be derived based on the following Equation 15.

[0264] [Equation 15]

[0265] pTopDsY[0]=(pY[0][-3]+2*pY[0][-2]+pY[0][-1]+2)>>2

[0266] Alternatively, when the upper left neighboring area of ​​the current block is not available and the upper neighboring area belongs to a different CTU from the luma block, the pixel pTopDsY[0] may be set to the pixel pY[0][-1] of the upper neighboring area.

[0267] (Implementation Method 2)

[0268] The pixel pTopDsY[x] (x=0..numSampT-1) of the downsampled upper neighboring area may be derived considering whether the upper neighboring area belongs to a different CTU from the luma block.

[0269] When the upper neighboring area belongs to the same CTU as the luminance block, the pixel pTopDsY[x] of the downsampled upper neighboring area can be obtained based on the corresponding pixel pY[2*x][-2] of the upper neighboring area and the neighboring pixel of the corresponding pixel. The neighboring pixel may mean at least one of the lower neighboring pixel, the left neighboring pixel, the right neighboring pixel, the lower left neighboring pixel, or the lower right neighboring pixel of the corresponding pixel. For example, the pixel pTopDsY[x] can be obtained based on the following equation 16.

[0270] [Equation 16]

[0271] pTopDsY[x]=(pY[2*x-1][-2]+pY[2*x-1][-1]+2*pY[2*x][-2]+2*pY[2*x][-1]+pY[2*x+1][-2]+pY[2*x+1][-1]+4)>>3

[0272] On the contrary, when the upper neighboring area belongs to a CTU different from the luminance block, the pixel pTopDsY[x] of the downsampled upper neighboring area can be obtained based on the corresponding pixel pY[2*x][-1] of the upper neighboring area and the neighboring pixel of the corresponding pixel. The neighboring pixel may mean at least one of the left neighboring pixel or the right neighboring pixel of the corresponding pixel. For example, the pixel pTopDsY[x] can be obtained based on the following equation 17.

[0273] [Equation 17]

[0274] pTopDsY[x]=(pY[2*x-1][-1]+2*pY[2*x][-1]+pY[2*x+1][-1]+2)>>2

[0275] Alternatively, when the upper left neighboring area of ​​the current block is not available, the neighboring pixel may mean at least one of the upper neighboring pixel or the lower neighboring pixel of the corresponding pixel. For example, the pixel pTopDsY[0] may be derived based on the following Equation 18.

[0276] [Equation 18]

[0277] pTopDsY[0]=(pY[0][-2]+pY[0][-1]+1)>>1

[0278] Alternatively, when the upper left neighboring area of ​​the current block is not available and the upper neighboring area belongs to a different CTU from the luma block, the pixel pTopDsY[0] may be set to the pixel pY[0][-1] of the upper neighboring area.

[0279] In a similar manner, downsampling of the upper neighboring area may be performed based on one of Embodiments 1 and 2 as described above. Here, one of Embodiments 1 and 2 may be selected based on a predetermined flag. The flag indicates whether the downsampled luminance pixel has the same position as the original luminance pixel. This is the same as described above.

[0280] In one example, downsampling of the upper neighboring area may be performed only when the numSampT value is greater than 0. When the numSampT value is greater than 0, this may mean that the upper neighboring area of ​​the current block is available, and the intra prediction mode of the current block is INTRA_LT_CCLM or INTRA_T_CCLM.

[0281] Reference Figure 8 , parameters for inter-component reference of the chroma block can be derived (S830).

[0282] The parameter may include at least one of a weight or an offset. The parameter may be determined considering the intra prediction mode of the current block. The parameter may be derived using at least one of the pixels of the luminance region of the chrominance block or the pixels of the upper neighboring region / left neighboring region. Here, the luminance region may include at least one of the luminance block or the upper neighboring region / left neighboring region of the luminance block. The luminance region may mean a region to which the above-mentioned downsampling is applied.

[0283] All pixels or some pixels belonging to the neighborhood of the luminance block and the chrominance block may be used to derive the parameters.

[0284] Some pixels in the luminance area can be specified, and some pixels in the chrominance block can be determined as pixels at positions corresponding to some pixels in the specified luminance area (implementation mode 1). Some pixels in the luminance area can be extracted from the upper adjacent area and the left adjacent area of ​​the luminance block, respectively. The number of some pixels extracted from the upper adjacent area (numSampT) can be equal to the number of some pixels extracted from the left adjacent area (numSampL), or can be different from each other according to the size / shape of the luminance block. For example, in an N*M luminance block, when N is greater than M, numSampT is greater than numSampL, and when N is less than M, numSampT can be set to be less than numSampL. Alternatively, when the size of the luminance block is less than a predetermined threshold size, at least one of numSampT or numSampL is determined to be i, and i can be a natural number of 2, 3, 4 or more. On the contrary, when the size of the luminance block is greater than a predetermined threshold size, at least one of numSampT or numSampL is determined to be j, and j can be a natural number greater than i (for example, 3, 4, 5). Alternatively, some pixels may be extracted only from the upper adjacent area of ​​the luminance block, or may be extracted only from the left adjacent area. Even in this case, as described above, numSampT or numSampL may be determined according to the size / shape of the luminance block. The positions of some of the pixels may be positions submitted to the encoding / decoding device in advance. For example, when the upper adjacent area of ​​the luminance block consists of 8 pixels, some pixels may be determined as at least one of four odd-numbered pixels from left to right, or at least one of four even-numbered pixels. Alternatively, some pixels may include at least one of two odd-numbered pixels from left to right, and at least one of two even-numbered pixels from right to left. When each of the upper adjacent areas / left adjacent areas of the luminance block consists of four pixels, some pixels may extract one or two pixels from the upper adjacent area / left adjacent area, respectively. In this case, in the upper adjacent area, it may be determined as at least one of two odd-numbered pixels or at least one of two even-numbered pixels. Alternatively, in the upper adjacent area, it may be determined as at least one of the first two pixels and the last two pixels. Some pixels in the left neighboring area can be extracted in the same way.

[0285] Alternatively, on the contrary, some pixels in the neighboring area of ​​the chrominance block may be specified, and some pixels in the luminance area may be determined as pixels at positions corresponding to some pixels in the neighboring area of ​​the chrominance block (Implementation 2). Here, some pixels in the neighboring area of ​​the chrominance block may be determined according to the method for determining some pixels in the luminance area described above, and redundant description will be omitted.

[0286] The maximum and minimum values ​​from the extracted pixels can be calculated for the luminance region and the chrominance region, respectively. The maximum and minimum values ​​can be determined as the maximum and minimum values ​​from the plurality of pixels, respectively. Alternatively, the plurality of pixels can be arranged in descending order by size comparison between the plurality of pixels. In this case, the average value between the higher t pixels can be set as the maximum value, and the average value between the lower t pixels can be set as the minimum value. t can be a natural number of 1, 2, 3 or more.

[0287] Based on the calculated maximum and minimum values, weights and / or offsets for the parameters may be derived.

[0288] The chroma block may be predicted based on the downsampled luma block and the parameters (S840).

[0289] The chrominance block may be predicted by applying at least one of pre-derived weights or offsets to the pixels of the downsampled luma block.

[0290] There may be various methods of performing prediction, and a method of performing prediction based on spatial correlation or temporal correlation may be an example.

[0291] As an example based on spatial correlation, methods such as extrapolation, interpolation, averaging and replication can be used using pre-encoded / decoded pixels in an area adjacent to the target block. Alternatively, methods such as block matching or template matching can be used in a reference area that has already been encoded / decoded. In this case, the reference area can be limited to the current picture.

[0292] As an example based on temporal correlation, a block matching or template matching method may be used in a pre-encoded / decoded reference region. In this case, the reference region may be limited to other pictures.

[0293] Generally, prediction can be performed based on correlation, but in the case of the above example, prediction can be classified according to the reference area (current picture / other picture). In this way, prediction can be distinguished not only by reference area but also by various factors. For example, reference area, reference position and prediction method can be examples.

[0294] A case where predictions as one or more candidates are defined by the above various factors and prediction is performed based on the predictions will be described.

[0295] The following describes a case where the prediction is divided into multiple candidates by different factors when the reference area is limited (in this example, the current picture). In detail, it is assumed that the prediction is performed based on spatial correlation and the following two are classified as candidates according to the prediction method. Of course, the present invention is not limited to this, and modified examples in which additional candidates are supported or elements for classifying predictions are configured differently are also possible.

[0296] 1) Perform predictions by extrapolating, interpolating, or averaging data from neighboring regions

[0297] 2) Prediction is performed by block matching in the pre-encoding / decoding region

[0298] Here, in method 1, a predetermined directional mode, a non-directional mode, etc. may be configured as a prediction mode candidate group, and at least one of them may be selected to represent prediction mode information. In method 2, prediction mode information may be represented by motion vector information, reference picture information, etc.

[0299] Each of the prediction methods may be activated by information indicating whether it is explicitly supported, or may be implicitly determined whether it is supported. In this example, it is assumed that method 1 is implicitly activated (supported), and method 2 is explicitly activated by information indicating whether it is supported.

[0300] In order to predict the target block, one of the prediction methods may be used to perform prediction, and selection information may be generated. In addition, according to the selected prediction method, subsequent prediction information (e.g., prediction mode information) may be generated, and various tags (syntaxes) may be configured for this purpose. Figures 9 to 12 A method of determining a prediction method is described in detail. A unit (current block) to which the examples described below are applied may be one of a coding unit, a prediction unit, or a transform unit.

[0301] Reference Fig. 9 , when the prediction method selection information (prediction_mode_flag) is checked and when one of method 1 or method 2 is selected accordingly, the prediction mode information (intra_mode_information or motion_information) is checked accordingly, and prediction can be performed based on the prediction method and the prediction mode information.

[0302] Intra_mode_information refers to a prediction mode of extrapolation, interpolation, and averaging. Like intra_prediction_mode, the entire prediction mode can be configured as a candidate group and a selection can be made therein. Alternatively, the entire prediction mode can be configured into multiple candidate groups by classification according to predetermined criteria such as mpm_flag, mpm_idx, remaining_mode, etc. The selection of the candidate group and the selection in the selected candidate group may be available. Since the selection of the candidate group and the selection in the selected candidate group can be derived from the examples described above, the detailed description thereof will be omitted.

[0303] Motion_information may include at least one of the following: motion prediction mode (skip / merge / adaptive motion vector prediction (AMVP)), motion vector prediction information, motion difference information, reference area selection information, motion model selection information, prediction direction information, or motion vector accuracy (or motion vector difference accuracy) information.

[0304] The motion vector prediction can be predicted from the motion vectors of the blocks closest to the current block in the left, top, upper left, upper right and lower left directions in the current picture. The present invention is not limited to this, and the motion vectors of blocks separated by a predetermined distance (m, n) in the horizontal direction or vertical direction can also be used as prediction values. Here, m and n can be integers of 4, 8, 16 or more, and m and n can be greater than or equal to the width and height of the minimum prediction unit (or coding unit, transformation unit, etc.). That is, prediction can be made based on the motion vector of the block pre-encoded / decoded before the current block. In this case, the motion vector of the block that is not the closest can be managed in a FIFO scheme according to the coding order based on the current block.

[0305] In addition, in another picture, prediction may be made from the motion vectors of blocks located to the left, right, top, bottom, top left, top right, bottom left, bottom right, and center of the block corresponding to the current block. Alternatively, (c, d) having a default value may be used as a prediction value of the motion vector and may have a value of (0, 0), but is not limited thereto.

[0306] In the case of the motion model selection information, the candidate may be configured as a translational motion model or a non-translational motion model, and the candidate may be classified based on the number of motion vectors representing the motion of the current block (1, 2, 3 or a greater integer), but is not limited thereto. In addition, the motion vector accuracy may be a power of 2, such as 1 / 4, 1 / 2, 1, 2, 4, etc., where the exponent may be an integer (1, 2 or greater) including 0 with a positive or negative sign.

[0307] Here, the prediction method selection information may be classified according to the prediction method. When the block matching method (method 2) is selected, information related to general block matching (motion_information) may be generated. Here, in order to check what the reference area (reference picture) is, the reference area may be configured to include the current picture in the reference picture list. That is, information such as ref_idx is generated as before, but the current picture may be included in the list as a candidate group of ref_idx.

[0308] The above description may be a description applied to a P picture or a B picture type and may be similarly applied to an I picture type, but the above description may be omitted because information about the reference region may be implicitly determined in the case of the I picture type. For this reason, since the reference region belongs only to the current picture, information such as ref_idx may be omitted and information identical to or similar to general block matching may be generated.

[0309] The prediction method selection information can be generated regardless of the picture type. That is, in the case of an I picture type, the prediction method selection information can also be generated. That is, in the case of an I picture type, block matching (ibc, intra block copy) can also be supported.

[0310] Reference Fig.10 , the prediction method selection information (prediction_mode_flag_A) may be checked, and accordingly, whether to refer to the current picture or to another picture may be determined. If it is determined to refer to another picture (prediction_mode_flag_A is yes, i.e., 1), the corresponding prediction mode information (motion_info_A) is checked. If it is determined to refer to the current picture (prediction_mode_flag_A is no, i.e., 0), one of method 1 or method 2 may be selected. Depending on the selected candidate, the prediction mode information (intra-mode_info or motion_info_B) may be checked accordingly. Prediction may be performed based on the prediction method and the prediction mode information.

[0311] Here, the prediction method selection information may consist of multiple tags (conditional). In this example, one tag (prediction_mode_tag_A) may be used to identify the reference region, and another tag (prediction_mode_tag_B) may be used to identify the prediction method (when the reference region is limited to the current picture). Here, the prediction method selection information for another tag (prediction_mode_tag_B) may be conditionally generated.

[0312] The above description may be a description applied to a P picture type or a B picture type, and since the reference area is limited to the current picture in the case of an I picture type, the process of checking prediction_mode_flag_A may be omitted and the process of checking prediction_mode_flag_B may be started immediately.

[0313] Here, in the configuration of the information about the reference area, motion_information_A and motion_information_B may have a difference, and other configurations except for information to be described later may be the same or similar.

[0314] For example, in motion_info_A, the reference picture list is configured to have a picture different from the current picture to process reference picture information, while in motion_info_B, information about the reference picture may be omitted.

[0315] Alternatively, in motion_information_A, the forward direction or the backward direction may be configured as a candidate for the prediction direction information, and the prediction direction information may be omitted in motion_information_B.

[0316] Alternatively, as the configuration of the block of reference for motion vector prediction, motion_info_A may target a spatially adjacent block and a temporally adjacent block, and motion_info_B may target a spatially adjacent block, and the detailed configurations of the spatially adjacent blocks may be the same or may be different. In addition, the default value for motion vector prediction may be configured to be the same or different.

[0317] Alternatively, as a candidate configuration for motion model selection information, motion_information_A has a motion model using 1 to 3 motion vectors as a candidate group, and motion_information_B has a motion model using one motion vector as a candidate group.

[0318] Alternatively, as a candidate configuration for the motion vector accuracy information, the range of the index in motion_info_A may be an integer with a positive or negative sign including 0, and the range of the index in motion_info_B may be an integer with a positive sign including 0.

[0319] The above example describes a case where some prediction method selection information is prioritized but the order can be changed. That is, after determining which method of method 1 or method 2 is used for prediction (prediction_mode_flag_B), if method 2 is selected in method 1 and method 2, it can be determined whether to use the current picture or a different picture as a reference area (prediction_mode_flag_A). In the P picture type or the B picture type, the order can be changed, and in the I picture type, the part of selecting the reference area can be omitted.

[0320] Reference Fig.11, the prediction method selection information (prediction_mode_flag_A, prediction_mode_flag_B) may be checked, the reference area may be determined to be one of the current picture or another picture (prediction_mode_flag_A), and one of method 1 or method 2 may be determined for prediction (prediction_mode_flag_B). In the case of the previous example, the prediction method selection information is conditionally checked, and in this example, all prediction method selection information may be checked differently.

[0321] When the reference region is the current picture and method 1 is selected according to the prediction method selection information, the prediction mode information (intra-frame_mode_information) corresponding to the reference region can be checked. If the reference region is the current picture and method 2 is selected, the prediction mode information (motion_information_B) corresponding to the reference region can be checked. If the reference region is a different picture and method 2 is selected, the prediction mode information (motion_information_A) corresponding to the reference region can be checked.

[0322] In this example, in the case of motion_information_A and motion_information_B, similar settings as in the previous example are possible.

[0323] The above description may be a description applied to a P picture type or a B picture type, and in an I picture type, prediction method selection information (prediction_mode_flag_A) for a reference area may be checked or described, excluding subsequent parts.

[0324] Reference Fig.12 , prediction method selection information (prediction_mode_flag) may be checked. If the value of prediction_mode_flag is 0, method 1 is selected, and prediction mode information (intra_mode_info) according to method 1 may be checked. If the value of prediction_mode_flag is 1, method 2 referring to the current picture is selected, and prediction mode information (motion_info_B) according to method 2 may be checked. If the value of prediction_mode_flag is 2, method 2 referring to another picture is selected, and prediction mode information (motion_info_A) according to method 2 may be checked.

[0325] In this example, the prediction method selection information is processed as one flag, but two or more indexes for the flag may be defined.

[0326] The above description may be a description applied to a P picture type or a B picture type, and may not be applied to an I picture type. That is, in an I picture type, the prediction method selection information may have a value of 0 or 1, and in a P picture type or a B picture type, the prediction method selection information may have a value of 0, 1, or 2. In this example, candidates referring to the current picture are first placed at 0 and 1, and candidates referring to another picture are placed at 2 to prevent index re-arrangement according to the picture type. However, the present invention is not limited thereto, and indexes may be assigned in a different order.

[0327] Block attributes may be considered to selectively signal all or some of the prediction method selection information described above. Here, the block attributes may include whether to apply a skip mode, an image type (slice type), a block size, a prediction type, or at least one of a partition type. Here, the prediction type may be classified into: a first prediction type, which includes intra prediction and / or a block matching mode (ibc mode); a second prediction type, which includes inter prediction; and a third prediction type, which includes intra prediction, a block matching mode, and an inter prediction. In the block matching mode, the current block is predicted based on a pre-coded / decoded area, and the pre-coded / decoded area may mean an area specified by a predetermined block vector. The pre-coded / decoded area may be an area belonging to the current picture to which the current block belongs. Inter prediction is similar to block matching mode in that inter prediction is performed based on a reference area specified by a motion vector, but inter prediction is different in that inter prediction references a picture located in a different time zone from the current block.

[0328] For example, prediction_mode_flag_A, which is one of the prediction method selection information, can be signaled only in at least one of the following cases: when the current block is not encoded in skip mode (condition 1); when the image type of the slice to which the current block belongs is not an I slice (condition 2); when the size of the current block is not 4×4 (condition 3); or when the prediction type is the third prediction type (condition 4).

[0329] However, if the above conditions are not met, prediction_mode_flag_A may not be signaled. In this case, prediction_mode_flag_A may be derived in the decoding device based on at least one of the block size, the prediction type, or the image type. For example, when the current block is 4×4, prediction_mode_flag_A may be derived as 1. Alternatively, when the prediction type for the current block is the first prediction type, prediction_mode_flag_A may be derived as 1. Alternatively, when the prediction type for the current block is the second prediction type, prediction_mode_flag_A may be derived as 0. Alternatively, if the image type of the slice to which the current block belongs is an I slice, prediction_mode_flag_A may be derived as 1, otherwise, prediction_mode_flag_A may be derived as 0.

[0330] Meanwhile, prediction_mode_flag_B, which is one of the prediction method selection information, may be signaled in consideration of whether at least one of a skip mode, a picture type, a block size, a prediction mode, a prediction type, or a partition type is applied.

[0331] For example, when the image type of the slice to which the current block belongs is an I slice and the current block is not encoded in skip mode, prediction_mode_mark_B may be signaled. Alternatively, when the image type of the slice to which the current block belongs is not an I slice and the prediction mode of the current block is not intra prediction, prediction_mode_mark_B may be signaled. Alternatively, when the image type of the slice to which the current block belongs is not an I slice, the current block is 4×4 and the current block is not encoded in skip mode, prediction_mode_mark_B may be signaled. Alternatively, prediction_mode_mark_B may be signaled only when at least one of the width or height of the current block is less than 64. Prediction_mode_mark_B may be signaled only when the prediction type for the current block is not the second prediction type.

[0332] Meanwhile, if the conditions described above are not satisfied, prediction_mode_flag_B may not be signaled. In this case, prediction_mode_flag_B may be derived in the decoding device based on at least one of the block size, the prediction type, or the image type. For example, when the current block is 128×128, prediction_mode_flag_B may be derived as 0. Alternatively, when the prediction type for the current block is the second prediction type, prediction_mode_flag_B may be derived as 0. Alternatively, if the image type of the slice to which the current block belongs is an I slice, prediction_mode_flag_B may be derived as 0 or 1, otherwise, prediction_mode_flag_B may be derived as 0. Here, when the image type of the slice to which the current block belongs is an I slice, prediction_mode_flag_B may be derived based on a flag indicating whether block matching is allowed. For example, prediction_mode_flag_B may be derived as the same value as the flag. The flag may be signaled in at least one of a video parameter set, a sequence parameter set, a picture parameter set, or a slice header.

[0333] Can be based on Figures 9 to 12 At least one of the embodiments shown in the embodiment is used to select a prediction method for the current block, and when the selected prediction method is intra-frame prediction, the following method can be performed: Figure 6 or Figure 8 Intra-frame prediction.

[0334] For clarity of description, the exemplary method of the present disclosure is represented as a series of operations, but it is not intended to limit the order in which the steps are performed, and if necessary, each step can be performed simultaneously or in a different order. To implement the method according to the present disclosure, the exemplary steps may include additional steps, may include other steps in addition to some steps, or may include additional other steps in addition to some steps.

[0335] The various embodiments of the present disclosure are not intended to list all possible combinations but are intended to describe representative aspects of the present disclosure, and the matters described in the various embodiments may be applied independently or may be applied in combination of two or more.

[0336] In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. For implementation by hardware, it may be implemented by one or more ASICs (application specific integrated circuits), DSPs (digital signal processors), DSPDs (digital signal processing devices), PLDs (programmable logic devices), FPGAs (field programmable gate arrays), general purpose processors, controllers, microcontrollers, microprocessors, and the like.

[0337] The scope of the present disclosure includes software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that enable operations according to methods of various embodiments to be performed on a device or computer, and non-transitory computer-readable media that stores such software or instructions, etc. and is executable on a device or computer.

[0338] Industrial Applicability

[0339] The present invention can be used for encoding / decoding video signals.

Claims

1. A method for decoding an image, comprising: deriving an intra prediction mode of a current chroma block based on a predetermined candidate intra prediction mode group; as well as Performing intra-frame prediction on the current chroma block based on the intra-frame prediction mode, wherein the predetermined candidate intra prediction mode group is divided into a first group and a second group, wherein the first group includes at least one inter-component prediction mode and the second group includes an intra-frame prediction mode for a luma block corresponding to the current chroma block, The intra prediction mode of the current chroma block is selected by selecting the first group or the second group.

2. The method of claim 1, wherein the first set includes three (3) inter-component prediction modes.

3. The method according to claim 1, further comprising: Get the first marker from the bitstream, and The intra prediction mode of the current chroma block is derived from one of the first group or the second group selected based on the first flag.

4. The method according to claim 3, wherein: When the value of the first flag is a first value, the intra prediction mode of the current chroma block is derived from the first group based on first index information obtained from the bitstream, and Wherein when the value of the first flag is a second value, the intra prediction mode of the current chroma block is derived from the second group based on second index information obtained from the bitstream.

5. The method according to claim 1, further comprising: When the intra prediction mode of the current chroma block is an inter-component prediction mode, obtaining a correlation between a chroma component and a luminance component; as well as Inter-component prediction is performed on the current chroma block based on the correlation. The method of claim 1 , wherein deriving the correlation comprises using a plurality of luma samples to derive a downsampled luma sample.

7. A method for encoding an image, comprising: deriving an intra prediction mode of a current chroma block based on a predetermined candidate intra prediction mode group; as well as Performing intra-frame prediction on the current chroma block based on the intra-frame prediction mode, wherein the predetermined candidate intra prediction mode group is divided into a first group and a second group, wherein the first group includes at least one inter-component prediction mode and the second group includes an intra-frame prediction mode for a luma block corresponding to the current chroma block, The intra prediction mode of the current chroma block is selected by selecting the first group or the second group.

8. A computer-readable recording medium storing a bit stream generated by a method for encoding an image, the method comprising: deriving an intra prediction mode of a current chroma block based on a predetermined candidate intra prediction mode group; as well as Performing intra-frame prediction on the current chroma block based on the intra-frame prediction mode, wherein the predetermined candidate intra prediction mode group is divided into a first group and a second group, wherein the first group includes at least one inter-component prediction mode and the second group includes an intra-frame prediction mode for a luma block corresponding to the current chroma block, The intra prediction mode of the current chroma block is selected by selecting the first group or the second group.