Method for encoding / decoding image and bit stream transmission method
By dividing the intra-frame prediction modes into multiple candidate groups and using adjacent block prediction modes and available pixels to replace unavailable pixels, the problem of inefficiency in high-resolution image compression is solved and the accuracy and efficiency of intra-frame prediction are improved.
Patent Information
- Application Number
- CN202511057245.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2018-12-29
- Filing Date
- 2019-12-30
- Publication Date
- 2025-10-03
AI Technical Summary
Existing video coding technologies are inefficient in compressing high-resolution and high-quality images, especially in the lack of effective methods for intra-frame prediction mode and reference area determination.
The intra prediction mode is divided into an MPM candidate group and a non-MPM candidate group, and the intra prediction mode of the current block is determined by using the prediction mode of the adjacent block and a predetermined offset, while using available pixels to replace unavailable pixels to improve the accuracy of the reference area.
Improved efficiency and accuracy of intra-frame prediction, especially in the case of chroma blocks, more efficient derivation of intra-frame prediction modes, and improved efficiency of inter-frame prediction.
Smart Images

Figure CN120751125A_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with the application date of December 30, 2019, application number 201980084021.7, and invention name “Video encoding / decoding method and device based on intra-frame prediction”. Technical Field
[0002] The present invention relates to a video 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 therefore, high-efficiency image compression technology is being discussed.
[0004] There are various techniques, such as an inter-frame prediction technique that uses a video compression technique to predict pixel values included in a current picture from pictures before or after the current picture, an intra-frame prediction technique that uses pixel information in the current picture to predict pixel values included in the current picture, and an entropy coding technique that assigns short codes to values with high frequency of occurrence and long codes to values with low frequency of occurrence. By using such image compression techniques, image data can be efficiently compressed and transmitted or stored. Summary of the Invention
[0005] Technical issues
[0006] The object of the present invention is to provide an efficient block partitioning method and device.
[0007] An object of the present invention is to provide a method and apparatus for deriving an intra-frame prediction mode.
[0008] An object of the present invention is to provide a method and apparatus for determining a reference region for intra prediction.
[0009] An object of the present invention is to provide a component-based intra-frame prediction method and apparatus.
[0010] Technical Solutions
[0011] The method and apparatus for encoding / decoding an image 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, and decode the current block based on the reference area and the intra-frame prediction mode.
[0012] In the method and apparatus for encoding / decoding an image of the present invention, the intra prediction modes predefined in the encoding / decoding apparatus may be divided into an MPM candidate group and a non-MPM candidate group, and the MPM candidate group may include at least one of a first candidate group or a second candidate group.
[0013] In the method and apparatus for encoding / decoding an image of the present invention, the intra prediction mode of the current block may be derived from the first candidate group or the second candidate group.
[0014] In the image encoding / decoding method and apparatus of the present invention, the first candidate group may be composed of a default mode predefined in the decoding apparatus, and the second candidate group may be composed of a plurality of MPM candidates.
[0015] In the method and apparatus for encoding / decoding an image of the present invention, the default mode may be at least one of a planar mode, a DC mode, a vertical mode, a horizontal mode, a vertical mode, or a diagonal mode.
[0016] In the method and apparatus for encoding / decoding an image of the present invention, the plurality of MPM candidates may include at least one of an intra prediction mode of a neighboring block, a mode obtained by subtracting a value of n from the intra prediction mode of the neighboring block, or a mode obtained by adding a value of n to the intra prediction mode of the neighboring block. Here, n may represent a natural number of 1, 2, or greater.
[0017] In the method and apparatus for encoding / decoding an image of the present invention, the plurality of MPM candidates may include at least one of a DC mode, a vertical mode, a horizontal mode, a mode obtained by subtracting or adding an m value from a vertical mode, or a mode obtained by subtracting or adding an m value from a horizontal mode. In this document, m may be a natural number of 1, 2, 3, 4, or more.
[0018] In the method and apparatus for encoding / decoding an image of the present invention, the encoding apparatus may determine a candidate group to which an intra-prediction mode of a current block belongs, encode a tag for identifying the candidate group, and the decoding apparatus may select one of a first candidate group or a second candidate group based on the tag notified from the encoding apparatus.
[0019] In the method and apparatus for encoding / decoding an image of the present invention, the derived intra prediction mode may be changed by applying a predetermined offset to the derived intra prediction mode.
[0020] In the method and apparatus for encoding / decoding an image of the present invention, applying of the offset may be selectively performed based on at least one of the size, shape, partition information, value of the intra prediction mode, or component type of the current block.
[0021] In the method and apparatus for encoding / decoding an image of the present invention, determining the reference area may include searching for unavailable pixels belonging to the reference area, and replacing the unavailable pixels with available pixels.
[0022] In the method and apparatus for encoding / decoding an image of the present invention, the available pixel may be determined based on a bit depth value, or may be a pixel adjacent to at least one of the left, right, above, or below an unavailable pixel.
[0023] Beneficial effects
[0024] The present invention can improve the efficiency of intra-frame prediction encoding / decoding through adaptive block partitioning.
[0025] According to the present invention, prediction can be performed more accurately and efficiently by deriving an intra prediction mode based on an MPM candidate group.
[0026] According to the present invention, in the case of chroma blocks, by defining prediction modes based on inter-component references as a separate group, intra prediction mode derivation for chroma blocks can be performed more efficiently.
[0027] According to the present invention, the accuracy and efficiency of intra prediction can be improved by replacing unavailable pixels in a reference area used for intra prediction with predetermined available pixels.
[0028] According to the present invention, the efficiency of inter-frame prediction can be improved based on inter-component reference. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a block diagram illustrating 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 embodiment of the present invention.
[0031] Figure 3 A method of dividing a picture into a plurality of segment regions is shown as an embodiment to which the present invention is applied.
[0032] Figure 4 FIG. 1 is an exemplary diagram showing intra prediction modes predefined in an image encoding / decoding apparatus as an embodiment to which the present invention is applied.
[0033] Figure 5 A method of decoding a current block based on intra-frame prediction is shown as an embodiment to which the present invention is applied.
[0034] Figure 6 A method of replacing unusable pixels in a reference area is shown as an embodiment to which the present invention is applied.
[0035] Figure 7 A method of changing / correcting an intra prediction mode is shown as an embodiment to which the present invention is applied.
[0036] Figure 8A prediction method based on inter-component reference is shown as an embodiment to which the present invention is applied.
[0037] Figure 9 A method of configuring a reference area is shown as an embodiment to which the present invention is applied.
[0038] Figure 10 is an exemplary diagram for gradually configuring intra prediction mode settings as an embodiment to which the present invention is applied.
[0039] Figure 11 A method of classifying intra prediction modes into a plurality of candidate groups is shown as an embodiment to which the present invention is applied.
[0040] Figure 12 is an exemplary diagram showing a current block and pixels adjacent thereto as an embodiment to which the present invention is applied.
[0041] Figure 13 A method of performing intra prediction step by step as an embodiment to which the present invention is applied is shown.
[0042] Figure 14 FIG. 1 is an exemplary diagram of arbitrary pixels used for intra prediction as an embodiment to which the present invention is applied.
[0043] Figure 15 FIG. 1 is an exemplary diagram of a method of dividing an arbitrary pixel into a plurality of sub-regions as an embodiment to which the present invention is applied.
[0044] Best Practice
[0045] The method and apparatus for encoding / decoding an image 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, and decode the current block based on the reference area and the intra-frame prediction mode.
[0046] In the method and apparatus for encoding / decoding an image of the present invention, the intra prediction modes predefined in the encoding / decoding apparatus may be divided into an MPM candidate group and a non-MPM candidate group, and the MPM candidate group may include at least one of a first candidate group or a second candidate group.
[0047] In the method and apparatus for encoding / decoding an image of the present invention, the intra prediction mode of the current block may be derived from the first candidate group or the second candidate group.
[0048] In the image encoding / decoding method and apparatus of the present invention, the first candidate group may be composed of a default mode predefined in the decoding apparatus, and the second candidate group may be composed of a plurality of MPM candidates.
[0049] In the method and apparatus for encoding / decoding an image of the present invention, the default mode may be at least one of a planar mode, a DC mode, a vertical mode, a horizontal mode, a vertical mode, or a diagonal mode.
[0050] In the method and apparatus for encoding / decoding an image of the present invention, the plurality of MPM candidates may include at least one of an intra prediction mode of a neighboring block, a mode obtained by subtracting a value of n from the intra prediction mode of the neighboring block, or a mode obtained by adding a value of n to the intra prediction mode of the neighboring block. Here, n may represent a natural number of 1, 2, or greater.
[0051] In the method and apparatus for encoding / decoding an image of the present invention, the plurality of MPM candidates may include at least one of a DC mode, a vertical mode, a horizontal mode, a mode obtained by subtracting or adding an m value from a vertical mode, or a mode obtained by subtracting or adding an m value from a horizontal mode. In this document, m may be a natural number of 1, 2, 3, 4, or more.
[0052] In the method and apparatus for encoding / decoding an image of the present invention, the encoding apparatus may determine a candidate group to which an intra-prediction mode of a current block belongs, encode a tag for identifying the candidate group, and the decoding apparatus may select one of a first candidate group or a second candidate group based on the tag signaled from the encoding apparatus.
[0053] In the method and apparatus for encoding / decoding an image of the present invention, the derived intra prediction mode may be changed by applying a predetermined offset to the derived intra prediction mode.
[0054] In the method and apparatus for encoding / decoding an image of the present invention, applying of the offset may be selectively performed based on at least one of the size, shape, partition information, value of the intra prediction mode, or component type of the current block.
[0055] In the method and apparatus for encoding / decoding an image of the present invention, determining the reference area may include searching for unavailable pixels belonging to the reference area, and replacing the unavailable pixels with available pixels.
[0056] In the method and apparatus for encoding / decoding an image of the present invention, the available pixel may be determined based on a bit depth value, or may be a pixel adjacent to at least one of the left, right, above, or below an unavailable pixel.
[0057] Modes for Carrying Out the Invention
[0058] The present invention may be varied and modified in various ways and will be described with reference to various exemplary embodiments, some of which will be described and illustrated in the accompanying drawings. However, these embodiments are not intended to limit the present invention, but are to be construed as encompassing all modifications, equivalents, and alternatives that fall within the spirit and technical scope of the present invention. Like reference numerals throughout the drawings designate like elements.
[0059] Although the terms first, second, etc. may 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. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element without departing from the teachings of the present invention. The term "and / or" includes any and all combinations of multiple associated listed items.
[0060] It will be understood that when an element is referred to as being “connected to” or “coupled to” another element, the element can be directly connected to or coupled to the other element or to intervening elements. In contrast, when an element is referred to as being “directly connected to” or “directly coupled to” another element, there are no intervening elements.
[0061] The terms used herein are for the purpose of describing particular embodiments only and are not intended to limit the present invention. As used herein, unless the context clearly indicates otherwise, the singular forms "a," "an," and "the" are intended to include the plural forms as well. It will also be understood that when used in this specification, the terms "include" and / or "have" specify the presence of stated features, monomers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, monomers, steps, operations, elements, components, and / or groups thereof.
[0062] Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. Like reference numerals refer to like elements throughout the drawings, and redundant descriptions of like elements will be omitted herein.
[0063] Figure 1 is a block diagram illustrating an image encoding apparatus according to an embodiment of the present invention.
[0064] 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.
[0065] Figure 1Each 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 consists of a separate hardware or 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 a function. It should be noted that, without departing from the spirit of the present invention, embodiments in which some elements are integrated into a combined element and / or elements are divided into multiple separate elements are included within the scope of the present invention.
[0066] Some elements are not essential to the essential functions of the present invention and may be optional components used only to improve performance. The present invention can be implemented by including only components that are essential for the implementation of the present invention, excluding components that are used only to improve performance. A structure that includes only essential components, excluding optical components that are used only to improve performance, falls within the scope of the present invention.
[0067] The picture division unit 110 may divide an input picture into at least one processing unit. In this case, a 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 multiple combinations of coding units, prediction units, and transform units, and select one combination of coding units, prediction units, and transform units based on a predetermined criterion (e.g., a cost function) to encode the picture.
[0068] 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, a maximum coding block (maximum coding unit), or a coding tree unit (CTU) 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 one coding unit, one coding unit can be divided into up to four different coding units.
[0069] 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.
[0070] 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.
[0071] 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.
[0072] The prediction units 120 and 125 may include an inter-prediction unit 120 for performing inter-frame prediction and an intra-prediction unit 125 for performing intra-frame prediction. The prediction units 120 and 125 may determine whether to perform inter-prediction or intra-prediction on a PU and may determine specific information about the determined prediction method (e.g., intra-prediction mode, motion vector, and reference picture). The processing unit that performs the prediction may be different from the processing unit that determines the prediction method and specific information. For example, the prediction method and prediction mode may be determined for each PU, while prediction may be performed for each TU. The residual value (residual block) between the generated prediction block and the original block may be input to the transform unit 130. Furthermore, the prediction mode information, motion vector information, and other information used for the prediction may be encoded by the entropy coding unit 165 along with the residual value and transmitted to the decoding device. When using a specific coding mode, the original block may be encoded and transmitted to the decoding device without the prediction units 120 and 125 generating a prediction block.
[0073] The inter-frame prediction unit 120 can predict a PU based on information about at least one picture in a previous picture and a subsequent picture of the current picture. In some cases, the inter-frame prediction unit 120 can predict a PU 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.
[0074] The reference picture interpolation unit may be provided with reference picture information from the memory 155, and may generate pixel information smaller 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 variable filter coefficients may be used to generate pixel information smaller 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 variable filter coefficients may be used to generate pixel information smaller than or equal to an integer pixel in units of 1 / 8 pixels.
[0075] The motion prediction unit can perform motion prediction based on the reference picture interpolated by the reference picture interpolation unit. Various methods can be used to calculate the motion vector, such as the full search based block matching algorithm (FBMA), the three-step search (TSS) algorithm, and the new three-step search (NTS) algorithm. Based on the interpolated pixels, the motion vector has a motion vector value in units of 1 / 2 or 1 / 4 pixels. The motion prediction unit can use different motion prediction methods to predict the current PU. Various methods such as skip mode, merge mode, advanced motion vector prediction (AMVP) mode, intra block copy mode, etc. can be used as motion prediction methods.
[0076] The intra-prediction unit 125 may generate a PU based on information about reference pixels adjacent to the current block. When the reference pixel is a pixel for which inter prediction has been performed because the block adjacent to the current PU is a block for which inter prediction has been performed, the information about the reference pixel in the block for which intra prediction has been performed may be replaced with information about the reference pixel in the block for which inter prediction has been performed. That is, when a reference pixel is unavailable, information about at least one reference pixel among available reference pixels may be replaced with information about the unavailable reference pixel.
[0077] Intra-frame prediction prediction modes include a directional prediction mode that uses reference pixel information according to the prediction direction, and a non-directional prediction mode that does not use information about the direction when performing prediction. The mode used to predict luma information and the mode used to predict chroma information can be different. In addition, chroma information can be predicted using intra-frame prediction mode information used to predict luma information or predicted luma signal information.
[0078] When performing intra prediction, 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 left pixel, the upper left pixel, and the upper pixel of the prediction unit. However, when performing intra prediction, if the size of the prediction unit is different from the size of the transform unit, 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 only for the minimum coding unit.
[0079] In the intra prediction method, a prediction block can be generated by applying an adaptive intra smoothing (AIS) filter to reference pixels according to a prediction mode. Different types of AIS filters can be applied to reference pixels. In the intra prediction method, the intra prediction mode of the current PU can be predicted based on the intra prediction modes of PUs adjacent to the current PU. In predicting the prediction mode of the current PU using mode information predicted based on adjacent PUs, when the current PU and the adjacent PU have the same intra prediction mode, predetermined flag information can be used to transmit information indicating that the current PU and the adjacent PU have the same prediction mode. When the current PU and the adjacent PU have different prediction modes, information about the prediction mode of the current block can be encoded through entropy coding.
[0080] 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.
[0081] 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 DCT, DST, or KLT is applied to transform the residual block may be determined based on intra prediction mode information of the prediction unit used to generate the residual block.
[0082] The quantization unit 135 may quantize the value transformed into the frequency domain by the transform 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.
[0083] The rearrangement unit 160 may perform rearrangement on coefficient values of the quantized residual.
[0084] The rearrangement unit 160 may convert the coefficients of a two-dimensional (2D) block into coefficients of a one-dimensional (1D) vector using a coefficient scanning method. For example, the rearrangement unit 160 may use a zigzag scanning method to scan the DC coefficient into coefficients in a high-frequency region and convert them into a one-dimensional vector form. Depending on the size of the transform unit and the intra-frame prediction mode, vertical scanning, which scans the coefficients in a two-dimensional block shape in the column direction, or horizontal scanning, which scans the coefficients in a two-dimensional block shape in the row direction, may be used instead of the zigzag scan. In other words, the size of the transform unit and the intra-frame prediction mode may determine which of the zigzag scan, vertical scanning, and horizontal scanning to use.
[0085] 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.
[0086] The entropy coding unit 165 can 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.
[0087] The entropy encoding unit 165 may entropy encode the coefficients of the CU input from the rearrangement unit 160 .
[0088] 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 can be generated by adding the residual value to the predicted PU. The residual value can be generated by the inverse quantization unit 140 and the inverse transform unit 145. The predicted PU can be predicted by the motion vector prediction unit, the motion compensation unit, and the intra prediction unit of the prediction units 120 and 125.
[0089] The filter unit 150 may include at least one of a deblocking filter, an offset unit, and an adaptive loop filter (ALF).
[0090] A deblocking filter can remove block distortion generated by boundaries between blocks in a reconstructed image. Whether to apply a deblocking filter to a current block can be determined based on the pixels included in a number of rows or columns of the block. When applying a deblocking filter to a block, a strong filter or a weak filter can be applied depending on the desired deblocking filter strength. When horizontal filtering and vertical filtering are performed when applying a deblocking filter, the horizontal filtering and vertical filtering can be performed in parallel.
[0091] The offset unit may apply an offset to the deblocking filtered image relative to the original image in units of pixels. The regions to which the offset may be applied may be determined after dividing the pixels of the image into a predetermined number of regions. The offset may be applied to the determined regions by considering edge information about each pixel or a method for applying the offset to the determined regions.
[0092] ALF can perform filtering based on the comparison results of the filtered reconstructed image and 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 to apply ALF can be transmitted by each coding unit, and the shape and filter coefficients of the ALF applied to each block can be varied. In addition, the ALF having the same form (fixed form) can be applied to all blocks regardless of their characteristics.
[0093] The memory 155 may store the reconstructed block or the reconstructed picture output from the filter unit 150 , and when inter prediction is performed, the stored reconstructed block or the reconstructed picture may be provided to the prediction units 120 and 125 .
[0094] Figure 2 is a block diagram illustrating an image decoding apparatus according to an exemplary embodiment of the present invention.
[0095] Reference Figure 2 , the image decoding apparatus 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 .
[0096] When an image bitstream is input from the image encoding device, the input bitstream may be decoded in a procedure reverse to that of the image encoding device.
[0097] The entropy decoding unit 210 may perform entropy decoding in a reverse process to the entropy encoding process performed 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.
[0098] The entropy decoding unit 210 may decode information associated with intra prediction and inter prediction performed by the encoding apparatus.
[0099] The rearrangement unit 215 may rearrange 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 and rearrange the coefficients of the 1D vector into coefficients of a 2D block. 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.
[0100] The dequantization unit 220 may perform dequantization based on a quantization parameter provided by the encoding apparatus and a rearranged coefficient of the block.
[0101] The inverse transform unit 225 may perform inverse transforms (i.e., inverse DCT, inverse DST, and inverse KLT) on the quantization results performed by the image encoding apparatus, i.e., DCT, DST, and KLT, performed by the transform unit. The inverse transform may be performed based on the transmission unit determined by the image encoding apparatus. The inverse transform unit 225 of the image decoding apparatus may selectively perform transform techniques (e.g., DCT, DST, KLT) based on various pieces of information, such as the prediction method, the size of the current block, and the prediction direction.
[0102] 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 from the memory 245.
[0103] As described above, when performing intra-frame prediction 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-frame prediction of the prediction unit can be performed based on the left pixel, the upper left pixel, and the upper pixel of the prediction unit. However, when performing intra-frame prediction, if the size of the prediction unit is different from the size of the transform unit, intra-frame prediction of the prediction unit can be performed using reference pixels determined based on the transform unit. In addition, intra-frame prediction using N×N partitioning can be used only for the minimum coding unit.
[0104] 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 whether to perform inter-frame prediction or intra-frame prediction 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 a previous picture and a subsequent picture of the current picture including the current prediction unit. In this article, the inter-frame prediction unit 230 may use information required for inter-frame prediction of the current prediction unit provided by 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.
[0105] 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.
[0106] The intra-frame prediction unit 235 can generate a prediction block based on pixel information in the current picture. When the prediction unit is a prediction unit for which intra-frame prediction is performed, intra-frame prediction can be performed based on intra-frame prediction mode information about the prediction unit provided from the image encoding device. The intra-frame 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 depending 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.
[0107] When the prediction mode of the prediction unit indicates a prediction mode for performing intra-frame prediction based on pixel values obtained by interpolating reference pixels, the reference pixel interpolation unit may generate reference pixels by interpolating the reference pixels in units of fractional pixels smaller than integer pixels (i.e., full pixels). When the prediction mode of the current prediction unit indicates a prediction mode for generating a prediction block without interpolating the reference pixels, the reference pixels may not be interpolated. When the prediction mode of the current block is the DC mode, the DC filter may generate the prediction block through filtering.
[0108] 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.
[0109] The image encoding device may provide information on whether a deblocking filter is applied to a corresponding block or picture and information on which of a strong filter and a weak filter is applied when the deblocking filter is used. The information on the deblocking filter from the image encoding device may be provided to the deblocking filter of the image decoding device, and the deblocking filter may perform deblocking filtering on the corresponding block.
[0110] 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.
[0111] 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.
[0112] 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.
[0113] In this specification, a coding unit, a coding block, a current block, etc. may be interpreted as having the same meaning. The embodiments to be described later may be performed by corresponding units of an image encoding device and / or an image decoding device.
[0114] Figure 3 A method of dividing a picture into a plurality of segment regions is shown as an embodiment to which the present invention is applied.
[0115] One picture may be divided into predetermined slice regions. The slice region according to the present invention may include at least one of a sub-picture, a slice, a tile, a coding tree unit (CTU), or a coding unit (CU).
[0116] Reference Figure 3 , the picture 300 may include one or more sub-pictures. That is, the picture may be composed of one sub-picture, or may be as follows Figure 3 The picture is divided into multiple sub-pictures.
[0117] In the case of sub-pictures, the division information can be configured differently depending on the encoding settings. (1) For example, sub-pictures can be obtained by a batch division method based on vertical or horizontal lines that intersect the picture. (2) Alternatively, sub-pictures can be obtained by a partial division method based on the feature information of each sub-picture (position, size, shape, etc., for the shape described later, assuming rectangular corners).
[0118] In the former case, the division information of the sub-picture may be configured based on a vertical line or a horizontal line dividing the sub-picture.
[0119] Line-based segmentation can use either uniform or non-uniform segmentation. When using a uniform method, information about the number of segmentations per line can be generated, and when using a non-uniform method, distance information (width or height) between lines can be generated. A uniform or non-uniform segmentation method can be used depending on the encoding settings, or method selection information can be explicitly generated. A uniform or non-uniform segmentation method can be applied to both vertical and horizontal lines. Alternatively, different methods can be applied to vertical and horizontal lines. Information about the number of sub-pictures can be derived based on the segmentation information.
[0120] The distance information between lines can be expressed in terms of n sample units, CTU size, (2 CTU size), (4 The encoding is performed in units of CTU size, etc. Here, n can be a natural number of 4, 8, 16, 32, 64, 128, 256, or more. The generated information can be notified at at least one level of the video parameter set (VPS), sequence parameter set (SPS), picture parameter set (PPS), and picture header (PH).
[0121] (2) In the latter case, the division information of the sub-pictures may be configured using position information of the sub-pictures (e.g., information indicating the upper left, upper right, lower left, and lower right positions of each sub-picture), size information (e.g., information indicating the width or height), information about the number of sub-pictures, and the like.
[0122] The encoding device may encode information specifying the number of sub-pictures (hereinafter, "number information"), and the decoding device may determine the number of sub-pictures configuring a picture based on the encoded number information. The number information may be provided at at least one of the VPS, SPS, PPS, and PH levels. Alternatively, the sub-picture number information may be implicitly derived based on sub-picture division information (such as position and size information).
[0123] The information specifying the position of each sub-picture (hereinafter, position information) may include an x-coordinate or a y-coordinate of a pre-provided position of the corresponding sub-picture. The pre-provided position may be determined in the upper left, upper right, lower left, and lower right of the sub-picture. The position information may be encoded by the encoding device, and the decoding device may determine the position of each sub-picture based on the encoded position information. Here, the x-coordinate / y-coordinate may be expressed in units such as n-sample units, CTU size, (2 CTU size), (4 Here, n can be a natural number of 1, 2, 4, 8, 16, 32, 64, 128, 256 or a larger number. For example, in the case where the position information is encoded using the x-coordinate and y-coordinate of the upper left CTU of the sub-picture, if the width and height are 2 and 3 respectively in the unit of CTU (CtbSize), the position (upper left) of the sub-picture can be determined as (2 CtbSize, 3 CtbSize).
[0124] The information specifying the size of each sub-picture (hereinafter, size information) may include at least one of width information and height information of the corresponding sub-picture. Here, the width / height information may be expressed in terms of, for example, n-sample units, CTU size, (2 CTU size), (4 Here, n can be a natural number of 4, 8, 16, 32, 64, 128, 256 or more. For example, when the width information is encoded in units of CTU size (CtbSize), if the width information is 6, the width of the sub-picture can be determined as (6 CtbSize).
[0125] The above-mentioned position information and size information can be limited to being encoded / decoded only when the number of sub-pictures belonging to the picture is 2 or more. That is, if the number of sub-pictures according to the number information is greater than or equal to 2, the position information and size information are notified. Otherwise, the sub-picture can be set to have the same position / size as the picture. However, even when the number of sub-pictures is 2 or more, the position information of the first sub-picture located at the upper left of the picture may not be notified, and the position information of the first sub-picture located at the upper left of the picture may be notified based on the position information about the second sub-picture. In addition, at least one of the position information or size information about the last sub-picture of the picture may not be notified.
[0126] Reference Figure 3 , a sub-picture may include one or more slices. That is, a sub-picture may consist of one slice or may be divided into multiple slices. A sub-picture may consist of multiple slices divided in the horizontal direction or may consist of multiple slices divided in the vertical direction.
[0127] Information specifying the number of slices belonging to a picture or sub-picture (hereinafter, "number information") is encoded by the encoding device, and the decoding device can determine the number of sub-pictures or sub-pictures in a picture based on the encoded number information. The number information can be notified at at least one of the VPS, SPS, PPS, and PH levels. However, the number information can be notified only in at least one of the following situations: when rectangular slices are allowed or when a sub-picture does not consist of a single slice.
[0128] The information specifying the size of each slice (hereinafter, size information) may include at least one of width information and height information of the corresponding slice. Here, the width / height information may be encoded in units of tiles or CTUs.
[0129] However, a slice may not be allowed to be divided to overlap with multiple sub-pictures. In other words, a sub-picture may be divided to completely include one or more slices. Alternatively, the slices constituting a sub-picture may be limited to be divided only in the horizontal direction or the vertical direction.
[0130] Reference Figure 3A sub-picture or slice 310 may include one or more tiles. That is, a slice may consist of one tile or multiple tiles. However, the present invention is not limited thereto, and multiple slices may be included in a tile. As an example, a slice may consist of a subset of multiple CTU rows belonging to a tile. In this case, information specifying the number of slices belonging to a tile (hereinafter, "number information") is encoded by the encoding device, and the decoding device may determine the number of slices comprising a tile based on the encoded number information. Information specifying the size of each slice (hereinafter, "size information") may include at least one of width information and height information of the corresponding slice. Here, the width / height information may be encoded in units of CTU size. However, when a slice consists of a subset of multiple CTU rows, only the height information of the corresponding slice may be notified, and the width information may not be notified. The number / size information may be notified at at least one of the VPS, SPS, PPS, or PH levels.
[0131] At least one of the aforementioned information regarding the number, location, and size is required only when the picture is divided into predetermined segment regions. For example, this information may be communicated only when the picture is divided into multiple slices or tiles. To this end, a separate flag may be used to indicate whether the current picture is divided into multiple slices or tiles. This flag may be communicated at at least one of the VPS, SPS, PPS, and PH levels.
[0132] Reference Figure 3 , a tile can be composed of multiple CTUs, and a CTU 320 (hereinafter, a first block) can be divided into multiple sub-blocks (hereinafter, a second block) by at least one of vertical lines or horizontal lines. The number of vertical lines and horizontal lines can be one, two, or more. Hereinafter, the first block is not limited to a CTU and can be a coding block (CU) divided from a CTU, a prediction block (PU) as a basic unit of predictive encoding / decoding, or a transform block (TU) as a basic unit of transform encoding / decoding. The first block can be a square block or a non-square block.
[0133] The partitioning of the first block may be performed based not only on a quadtree but also on a multitree such as a binary tree or a ternary tree.
[0134] Specifically, quadtree partitioning (QT) is a partitioning type in which a first block is partitioned into four second blocks. For example, when a 2N×2N first block is partitioned using QT, the first block can be partitioned into four second blocks of N×N size. QT is limited to being applicable only to square blocks, but can also be applied to non-square blocks.
[0135] Binary tree partitioning (BT) is a type of partitioning in which a first block is divided into two second blocks. BT can include horizontal binary trees (hereinafter, horizontal BT) and vertical binary trees (hereinafter, vertical BT). Horizontal BT is a type of partitioning in which a first block is divided into two second blocks along a horizontal line. This partitioning can be performed symmetrically or asymmetrically. For example, when a 2N×2N first block is partitioned 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. Vertical BT is a type of partitioning in which a first block is divided into two second blocks along a vertical line. This partitioning can be performed symmetrically or asymmetrically. For example, when a 2N×2N first block is partitioned 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.
[0136] Ternary tree partitioning (TT) is a partitioning type in which a first block is divided into three second blocks. Similarly, TT can include horizontal ternary trees (hereinafter, horizontal TT) and vertical ternary trees (hereinafter, vertical TT). Horizontal TT is a partitioning 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 partitioned based on horizontal TT, the first block can be divided into three second blocks with a height ratio of (a:b:c). Here, a, b, and c can be the same value. Alternatively, a and c can be the same, and b can be greater than or less than a. For example, a and c can be 2, and b can be 1. Vertical TT is a partitioning type in which a first block is partitioned into three second blocks by two vertical lines. For example, when a 2N×2N first block is partitioned 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 may be the same, and c may be greater than or less than a. Alternatively, b and c may be the same, and a may be greater than or less than b. For example, a and c may be 2, and b may be 1.
[0137] The above-mentioned division can be performed based on the division information notified from the encoding device. The division information can include at least one of division type information, division direction information, or division ratio information.
[0138] The partition type information may specify any 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 a non-partitioning mode (no segmentation). Alternatively, the partition type information may indicate whether QT, BT, or TT is applied and may be encoded in the form of a flag or index. As an example, the partition type information may include at least one of a first flag indicating whether QT is applied or a second flag indicating whether BT or TT is applied. BT or TT may be selectively used based on the second flag. However, the first flag may only be notified when the size of the first block is less than or equal to a predetermined threshold size. The threshold size may be a natural number of 64, 128, or greater. When the size of the first block is greater than the threshold size, the first block may be forcibly partitioned using only QT. In addition, the second flag may only be notified when QT is not applied based on the first flag.
[0139] In the case of BT or TT, the division direction information may indicate whether it is horizontal division or vertical division. In the case of BT or TT, the division ratio information may indicate a width ratio and / or a height ratio of the second block.
[0140] Figure 3 The block 320 shown in FIG is assumed to be a square block having a size of 8N×8N and a partition depth of k (hereinafter, 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, a second block). The size of the second block may be 4N×4N, and the partition depth may be (k+1).
[0141] The four second blocks may be further divided based on QT, BT, TT, or non-division mode. For example, when the division information of the second block indicates horizontal BT, the second block is divided into two sub-blocks (hereinafter, the third block). In this case, the size of the third block may be 4N×2N, and the division depth may be (k+2).
[0142] 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 vertical BT, the third block is divided into two sub-blocks 321 and 322. In this case, the size of the sub-blocks 321 and 322 may be 2N×2N, and the division depth may be (k+3). Alternatively, when the division information of the third block indicates horizontal BT, the third block may be divided into two sub-blocks 323 and 324. In this case, the size of the sub-blocks 323 and 324 may be 4N×N, and the division depth may be (k+3).
[0143] The partitioning may be performed independently or in parallel with adjacent blocks, or may be performed sequentially according to a predetermined priority order.
[0144] The division information of the current block can be determined based on at least one of the division information of the block above 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 will have the same result as dividing the second block by the QT. Therefore, the encoding of the division information of the lower third block (particularly the division direction information) can be skipped, and the decoding device can be configured to divide the lower third block horizontally.
[0145] The upper block may refer to 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 adjacent block may be a block adjacent to the upper or left side of the current block. The adjacent block may be a block having the same partition depth as the current block.
[0146] The above division can be repeatedly performed until the minimum unit of encoding / decoding. When divided into the minimum unit, the division information of the block is no longer notified 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 can 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 can be notified in at least one of video sequence, picture, slice or block unit. Alternatively, the information about the minimum unit can be a value predefined in the encoding / decoding device. The information about the minimum unit can be notified for each of CU, PU and TU. The information about one minimum unit can be equally applied to CU, PU and TU. The blocks in the following embodiments can be obtained by the above block division.
[0147] Block partitioning according to an embodiment of the present invention can be obtained within a supportable range, and block partitioning setting information for this can be supported. For example, the block partitioning setting information may include m×n sizes (e.g., m and n are natural numbers such as 2, 4, 8, 16, 32, 64, 128, etc.) related to the largest coding block (CTU), the smallest coding block, the largest transform block, and the smallest transform block, as well as the maximum partition depth k of each block (e.g., coding / transformation x intra / inter x QT / BT / TT, etc., k is 0, 1, 2, or more). Furthermore, it can be notified at at least one level in the VPS, SPS, PPS, PH, or slice header.
[0148] In the case of some of the above-mentioned slice regions (sub-picture, slice, tile, etc.), in order to segment / partition each slice region (for example, to obtain the position and size information of the slice region), predetermined basic information (for example, information about the lower or basic unit of the corresponding slice region such as CTU or tile) may be required. In this case, VPS-SPS-PPS can be performed sequentially, but in order to perform encoding / decoding simultaneously, it may be necessary to provide basic information at a level that supports segmentation / partitioning of each slice region.
[0149] For example, CTU information may be generated (fixedly generated) in the SPS, and may be used (if divided) depending on whether the image is divided into sub-pictures (assuming it is processed in the SPS). Alternatively, CTU information may be generated (if divided, additionally generated) depending on whether the image is divided into slices or tiles (assuming it is processed in the PPS), and the CTU information may be divided into slices and tiles based on this.
[0150] In summary, basic information for segmentation / division of a segment image may be generated at one level. Alternatively, basic information for segmentation / division may be generated at two or more levels according to the type of the segment image.
[0151] Regardless of the type of segment image, basic information (syntax or markup) related to the segments of the segment image can be generated at a single level. Alternatively, basic information related to each segment image can be generated at multiple levels depending on the segment image. In this case, even if basic information can be generated and present at two or more levels, it can be set to have the same value or information to maintain the same effect as if it were generated and present at a single level. However, in the case of basic information, having the same value or information can be a default setting, but this is not limited to this, and they can be changed to have different values or information.
[0152] Figure 4 FIG. 1 is an exemplary diagram showing intra prediction modes predefined in an image encoding / decoding apparatus as an embodiment to which the present invention is applied.
[0153] Reference Figure 4 , the predefined intra prediction mode can be defined as a prediction mode candidate group consisting of 67 modes, and specifically can include 65 directional modes (No. 2 to No. 66) and two non-directional modes (DC, planar). In this case, the directional mode can be identified based on slope information (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 for the luma component or chroma component, and other additional modes may be included in the prediction mode candidate group.
[0154] In addition, a reconstructed block in another color space that has been encoded / decoded using the correlation between color spaces can be used to predict the current block, and can include supported prediction modes. For example, in the case of chrominance components, a prediction block for the current block can be generated by using a reconstructed block of the luma component corresponding to the current block. In other words, a prediction block can be generated based on the reconstructed block by considering the correlation between color spaces.
[0155] The prediction mode candidate groups can be adaptively determined according to encoding / decoding settings. The number of candidate groups can be increased for the purpose of improving prediction accuracy, and can be reduced for the purpose of reducing the amount of bits according to the prediction mode.
[0156] 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), or candidate group C (18, 17 directional modes and 1 non-directional mode) can be selected, and the candidate group can be adaptively selected or determined based on the size and shape of the block.
[0157] In addition, depending on the encoding / decoding settings, there may be various configurations of the prediction mode candidate group. Figure 4 As shown, the prediction mode candidate group may be configured so that the mode interval is an even number, or the prediction mode candidate group may be configured so that Figure 4 The number of patterns between pattern 18 and pattern 34 is greater than the number of patterns between pattern 2 and pattern 18. The opposite is also possible. The candidate groups can be adaptively configured according to the shape of the block (i.e., square, non-square with a width greater than height, non-square with a height greater than width, etc.).
[0158] For example, when the width of the current block is greater than the height, all or some of the intra-frame prediction modes belonging to modes 2 to 18 may not be used, and all or some of the intra-frame prediction modes belonging to modes 67 to 80 may be used instead of all or some of the intra-frame prediction modes belonging to modes 2 to 18. On the other hand, when the width of the current block is less than the height, all or some of the intra-frame prediction modes belonging to modes 50 to 66 are not used, and all or some of the intra-frame prediction modes belonging to modes -14 to -1 may be used instead of all or some of the intra-frame prediction modes belonging to modes 50 to 66.
[0159] In the present invention, unless otherwise specified, it is assumed that intra prediction is performed using one preset prediction mode candidate group (candidate group A) having a uniform mode interval, but main elements of the present invention may also be applied to an adaptive intra prediction setting.
[0160] Figure 5 A method of decoding a current block based on intra-frame prediction is shown as an embodiment to which the present invention is applied.
[0161] Reference Figure 5 , a reference region for intra prediction of a current block may be determined ( S500 ).
[0162] The reference area according to the present invention may be an area adjacent to at least one of the left, top, upper left, lower left or upper right of the current block. Figure 5 Not shown in the figure, the reference area may also include an area adjacent to at least one of the right, lower right, or lower part of the current block, and may be selectively used based on the intra prediction mode, encoding / decoding order, scanning order, etc. of the current block.
[0163] The encoding / decoding device may define a plurality of pixel lines that may be used for intra prediction. The plurality of pixel lines may include at least one of a first pixel line adjacent to the current block, a second pixel line adjacent to the first pixel line, a third pixel line adjacent to the second pixel line, or a fourth pixel line adjacent to the third pixel line.
[0164] For example, depending on the encoding / decoding settings, the plurality of pixel lines may include all of the first to fourth pixel lines, or may include only the remaining pixel lines except the third pixel line. Alternatively, the plurality of pixel lines may include only the first and fourth pixel lines, or may include only the first to third pixel lines.
[0165] The current block may select one or more of a plurality of pixel lines and use them as a reference area. In this case, the selection may be performed based on an index (refIdx) notified from the encoding device. Alternatively, the selection may be performed based on predetermined encoding information. Here, the encoding information may include at least one of the size, shape, and partition type of the current block, whether the intra-frame prediction mode is non-directional, whether the intra-frame prediction mode is horizontal, and the angle or component type of the intra-frame prediction mode.
[0166] For example, when the intra-frame prediction mode is planar mode or DC mode, the use of only the first pixel line can be restricted. Alternatively, when the size of the current block is less than or equal to a predetermined threshold, the use of only the first pixel line can be restricted. Here, the size can be expressed as any one of the width or height of the current block (for example, maximum value, minimum value, etc.), the sum of the width and height, or the number of samples belonging to the current block. Alternatively, when the angle of the intra-frame prediction mode is greater than a predetermined threshold angle (or less than a predetermined threshold angle), only the first pixel line can be used. The threshold angle can be the angle of the intra-frame prediction mode corresponding to mode 2 or mode 66 in the prediction mode candidate group mentioned above.
[0167] Meanwhile, there may be a case where at least one of the pixels of the reference area is unavailable, and in this case, the unavailable pixel may be replaced with a predetermined default value or an available pixel. Figure 6 Provide a detailed description.
[0168] Reference Figure 5 , the intra prediction mode of the current block can be obtained (S510).
[0169] The current block is a concept including a luminance block and a chrominance block, and an intra prediction mode can be determined for each of the luminance block and the chrominance block. In the following, it is assumed that the intra prediction mode predefined in the decoding device consists of a non-directional mode (planar mode, DC mode) and 65 directional modes.
[0170] 1. Luminance block situation
[0171] The 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 the MPM candidate group or the non-MPM candidate group. To this end, a flag (hereinafter, a first flag) indicating whether the intra prediction mode of the current block is derived from the MPM candidate group can be used. For example, when the first flag is a first value, the MPM candidate group can be used, and when the first flag is a second value, the non-MPM candidate group can be used.
[0172] Specifically, when the first flag is the first value, the intra prediction mode of the current block can be determined based on an MPM candidate group (candModeList) including at least one MPM candidate and an MPM index. The MPM index may be information specifying any one of the MPM candidates belonging to the MPM candidate group. The MPM index may be notified only when multiple MPM candidates belong to the MPM candidate group.
[0173] On the other hand, when the first flag is the second value (i.e., when there is no MPM candidate in the MPM candidate group that is the same as the intra prediction mode of the current block), the intra prediction mode of the current block can be determined based on the notified remaining mode information. The remaining mode information can specify any one of the remaining modes other than the MPM candidate.
[0174] Hereinafter, a method of determining an MPM candidate group will be described.
[0175] (Embodiment 1) 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 value of n may be an integer of 1, 2, 3, 4, or more. The neighboring block may represent a block adjacent to the left and / or above the current block. However, the present invention is not limited thereto, and the neighboring block may include at least one of an upper left neighboring block, a lower left neighboring block, or an upper right neighboring block. The default mode may be at least one of a planar 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), mode Vk, mode V+k, mode Hk, or mode H+k. Here, k may be an integer of 1, 2, 3, 4, 5, or more.
[0176] 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.
[0177] (Embodiment 2) The MPM candidate group may be divided into m candidate groups. m may be an integer of 2, 3, 4, or more. In the following, for ease of description, it is assumed that the MPM candidate group is divided into a first candidate group and a second candidate group.
[0178] The encoding / decoding apparatus may select the first candidate group or the second candidate group. The selection may be performed based on a flag (hereinafter, the second flag) that specifies whether the intra prediction mode of the current block belongs to the first candidate group or the second candidate group. For example, if the second flag is a first value, the intra prediction mode of the current block may be derived from the first candidate group; otherwise, the intra prediction mode of the current block may be derived from the second candidate group.
[0179] Specifically, when the first candidate group is used according to the second flag, a first MPM index specifying any one of a plurality of default modes belonging to the first candidate group may be notified. The default mode corresponding to the notified first MPM index may be set as the intra prediction mode of the current block. On the other hand, when the first candidate group consists of one default mode, the first MPM index is not notified, and the intra prediction mode of the current block may be set to the default mode of the first candidate group.
[0180] When the second candidate group is used according to the second flag, a second MPM index specifying any one of the multiple MPM candidates belonging to the second candidate group may be notified. The MPM candidate corresponding to the notified second MPM index may be set as the intra prediction mode of the current block. On the other hand, when the second candidate group consists of one MPM candidate, the second MPM index is not notified, and the intra prediction mode of the current block may be set to the MPM candidate of the second candidate group.
[0181] At the same time, the second flag can be notified only when the first flag is the first value (condition 1). In addition, the second flag can be notified only when the reference area of the current block is determined to be the first pixel line. When the current block references non-adjacent pixel lines, the MPM candidates of the first candidate group can be restricted so that they are not used. Or conversely, when the intra prediction mode of the current block is derived from the first candidate group based on the second flag, the current block can be restricted to referencing only the first pixel line.
[0182] In addition, the second flag may be notified only when intra prediction is not performed on the current block in units of subblocks (Condition 2). Conversely, when intra prediction is performed on the current block in units of subblocks, the flag may not be notified, and the flag may be set to the second value in the decoding device.
[0183] The second flag may be notified when either of the above-mentioned conditions 1 or 2 is satisfied, or the second flag may be notified when both conditions 1 and 2 are satisfied.
[0184] The first candidate group may be composed of predefined default modes. The default mode may be at least one of a directional mode or a non-directional mode. For example, the directional mode may include at least one of a vertical mode, a horizontal mode, and a diagonal mode. The non-directional mode may include at least one of a planar mode and a DC mode.
[0185] The first candidate group may include only r non-directional patterns or directional patterns. r may be an integer of 1, 2, 3, 4, 5, or more. r may be a fixed value provided in advance to the encoding / decoding apparatus, or may be variably determined based on predetermined encoding parameters.
[0186] The second candidate group may include multiple MPM candidates. However, the second candidate group may be limited to not including a default mode belonging to the first candidate group. The number of MPM candidates may be 2, 3, 4, 5, 6 or more. The number of MPM candidates may be a fixed value provided in advance to the encoding / decoding device, or may be variably determined based on encoding parameters. The MPM candidate may be derived based on the intra-frame prediction mode of a neighboring block adjacent to the current block. The neighboring block may be a block adjacent to at least one of the left, top, upper left, lower left or upper right of the current block.
[0187] Specifically, the MPM candidate may be determined considering whether the intra prediction mode (candIntraPredModeA) of the left block and the intra prediction mode (candIntraPredModeB) of the upper block are the same and whether candIntraPredModeA and candIntraPredModeB are non-directional modes.
[0188] [Case 1] For example, when candIntraPredModeA and candIntraPredModeB are the same and candIntraPredModeA is not a non-directional mode, the MPM candidates for the current block may include at least one of candIntraPredModeA, (candIntraPredModeA-n), (IntraPredModeA+n), or a non-directional mode. Here, n may be an integer of 1, 2, or more. The non-directional mode may include at least one of a planar mode or a DC mode. As an example, the MPM candidates for the current block may be determined as shown in Table 1 below. The index of Table 1 specifies the position or priority of the MPM candidate, but is not limited thereto.
[0189] [Table 1]
[0190]
[0191] [Case 2] Alternatively, when candIntraPredModeA is different from candIntraPredModeB and both candIntraPredModeA and candIntraPredModeB are not non-directional modes, the MPM candidates of the current block may include at least one of candIntraPredModeA, candIntraPredModeB, (maxAB-n), (maxAB+n), (minAB-n), (minAB+n), or a non-directional mode. Here, maxAB and minAB represent the maximum and minimum values of candIntraPredModeA and candIntraPredModeB, respectively, and n may be an integer of 1, 2, or more. The non-directional mode may include at least one of a planar mode or a DC mode. As an example, based on the difference D between candIntraPredModeA and candIntraPredModeB, the candidate mode of the second candidate group may be determined as shown in Table 2 below. The index of Table 2 specifies the position or priority of the MPM candidate, but is not limited thereto.
[0192] [Table 2]
[0193]
[0194] In Table 2 above, one of the MPM candidates is derived based on minAB, and the other is derived based on maxAB. However, the present invention is not limited thereto, and the MPM candidate may be derived based on maxAB regardless of minAB, and conversely, the MPM candidate may be derived based on minAB regardless of maxAB.
[0195] [Case 3] When candIntraPredModeA is different from candIntraPredModeB and only one of candIntraPredModeA and candIntraPredModeB is a non-directional mode, the MPM candidate of the current block may include at least one of maxAB, (maxAB-n), (maxAB+n), or a non-directional mode. Here, maxAB represents the maximum value of candIntraPredModeA and candIntraPredModeB, and n may be an integer of 1, 2, or more. The non-directional mode may include at least one of a planar mode or a DC mode. As an example, the MPM candidate of the current block may be determined as shown in Table 3 below. The index of Table 3 specifies the position or priority of the MPM candidate, but is not limited thereto.
[0196] [Table 3]
[0197]
[0198] [Case 4], when candIntraPredModeA is different from candIntraPredModeB and both candIntraPredModeA and candIntraPredModeB are non-directional modes, the MPM candidates for the current block may include at least one of a non-directional mode, a vertical mode, a horizontal mode, (vertical mode - m), (vertical mode + m), (horizontal mode - m), or (horizontal mode + m). Here, m may be an integer of 1, 2, 3, 4, or greater. The non-directional mode may include at least one of a planar mode or a DC mode. As an example, the MPM candidates for the current block may be determined as shown in Table 4 below. The indexes in Table 4 specify the positions or priorities of the MPM candidates, but are not limited thereto. For example, index 1 may be assigned to the horizontal mode, or the maximum index may be assigned to the horizontal mode. In addition, the MPM candidates may include at least one of a diagonal mode (e.g., mode 2, mode 34, mode 66), (diagonal mode - m), or (diagonal mode + m).
[0199] [Table 4]
[0200]
[0201] The intra prediction mode (IntraPredMode) decoded by the above process may be changed / corrected based on a predetermined offset, which will be referred to as Figure 7 Provide a detailed description.
[0202] 2. Chroma Block
[0203] The predefined intra prediction modes of the chroma block can be divided into a first group and a second group. Here, the first group can be configured with a prediction mode based on an inter-component reference, and the second group can be configured with all or some of the above predefined intra prediction modes.
[0204] The intra prediction mode of the chroma block can be derived by selectively using the first group or the second group. The selection can be performed based on a predetermined third flag. The third flag can indicate whether the intra prediction mode of the chroma block is derived based on the first group or the second group.
[0205] For example, when the third flag is the first value, the intra prediction mode of the chroma block may be determined to be one of the one or more inter-component reference-based prediction modes belonging to the first group. Figure 8 Detailed description is given in .
[0206] On the other hand, when the third flag is the second value, the intra prediction mode of the chroma block may be determined as one of a plurality of intra prediction modes belonging to the second group. As an example, the second group may be defined as shown in Table 5, and the intra prediction mode of the chroma block may be derived based on the information (intra_chroma_pred_mode) notified by the encoding device and the intra prediction mode (intraPredModeY) of the luma block.
[0207] [Table 5]
[0208]
[0209] According to Table 5, the intra prediction mode of the chrominance block can be determined based on the notified information and the intra prediction mode of the luminance block. The mode numbers listed in Table 5 correspond to Figure 4 mode number in. For example, when the value of the notified information intra_chroma_pred_mode is 0, the intra prediction mode of the chroma block can be determined as the diagonal mode (66) or the planar mode (0) according to the intra prediction mode of the luminance block. Alternatively, when the value of the notified information intra_chroma_pred_mode is 4, the intra prediction mode of the chroma block can be set to be the same as the intra prediction mode of the luminance block. At the same time, the intra prediction mode (IntraPredModeY) of the luminance block can be an intra prediction mode of a sub-block including a specific position in the luminance block. Here, the specific position in the luminance block can correspond to the center position in the chroma block.
[0210] However, there may be a case where a sub-block corresponding to the center position of the chrominance block in the luminance block is unavailable. Here, "unavailable" may be a case where the corresponding sub-block is not encoded in intra mode. For example, when a sub-block does not have an intra prediction mode, such as when the corresponding sub-block is encoded in inter mode or current picture reference mode, it can be determined that the corresponding sub-block is unavailable. In this case, the intra prediction mode (IntraPredModeY) of the luminance block can be set to be equal to the mode pre-provided to the encoding / decoding device. Here, the pre-provided mode can be any one of a planar mode, a DC mode, a vertical mode, or a horizontal mode.
[0211] Reference Figure 5 , the current block may be decoded based on the reference region for intra prediction and the intra prediction mode ( S520 ).
[0212] The decoding of the current block can be performed in units of sub-blocks of the current block. To this end, the current block can be divided into multiple sub-blocks. Here, the current block can correspond to a leaf node. A leaf node can represent a coding block that is no longer divided into smaller coding blocks. In other words, a leaf node can represent a block that is no longer divided by the above-mentioned tree-based block partitioning.
[0213] The splitting may be performed based on the size of the current block (embodiment 1).
[0214] For example, when the size of the current block is less than a predetermined threshold size, the current block may be divided vertically or horizontally into two sub-blocks. Conversely, when the size of the current block is greater than or equal to the threshold size, the current block may be divided vertically or horizontally into four sub-blocks. The threshold size may be notified by the encoding device or may be a fixed value predefined in the decoding device. For example, the threshold size is expressed as N×M, and N and M may be 4, 8, 16, or greater. N and M may be the same or may be set differently from each other.
[0215] Alternatively, if the size of the current block is smaller than a predetermined threshold size, the current block is not divided (non-partitioned). Otherwise, the current block may be divided into two or four sub-blocks.
[0216] The division may be performed based on the shape of the current block (embodiment 2).
[0217] For example, if the shape of the current block is a square, the current block is divided into four sub-blocks, and otherwise, the current block can be divided into two sub-blocks. Conversely, if the shape of the current block is a square, the current block is divided into two sub-blocks, and otherwise, the current block can be divided into four sub-blocks.
[0218] Alternatively, if the shape of the current block is a square, the current block is divided into two or four sub-blocks, and otherwise, the current block may not be divided. Conversely, when the shape of the current block is a square, the current block may not be divided, and otherwise, the current block may be divided into two or four sub-blocks.
[0219] 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.
[0220] Two-partitioning means division into two sub-blocks in a vertical or horizontal direction, and four-partitioning may include division into four sub-blocks in a vertical or horizontal direction, or division into four sub-blocks in vertical and horizontal directions.
[0221] In the above embodiments, two-partition or four-partition is described, but the present invention is not limited thereto, and the current block may be divided into three sub-blocks in the vertical or horizontal direction. In this case, the width ratio or height ratio may be (1:1:2), (1:2:1), or (2:1:1).
[0222] Information regarding whether the image is divided into sub-block units, whether it is divided into four sub-blocks, the direction of division, and the number of divisions may be notified from the encoding device, or may be variably determined by the decoding device based on predetermined encoding parameters. The encoding parameters may include block size / shape, partition type (four-partition, two-partition, three-partition), intra-prediction mode, range / position of adjacent pixels used for intra-prediction, component type (e.g., luma and chroma), maximum / minimum transform block size, transform type (e.g., transform skip, DCT2, DCT7, DCT8), and the like.
[0223] The subblocks of the current block can be predicted / reconstructed sequentially according to a predetermined priority. In this case, the first subblock of the current block can be predicted / reconstructed, and the second subblock can be predicted / reconstructed with reference to the pre-decoded first subblock. Regarding priority, prediction / reconstruction is performed in a top-to-bottom order, but each subblock above and below can be predicted / reconstructed in a left-to-right order. Alternatively, prediction / reconstruction is performed in a top-to-bottom order, but each subblock above and below can be predicted / reconstructed in a right-to-left order. Alternatively, prediction / reconstruction is performed in a bottom-to-top order, but each subblock below and above can be predicted / reconstructed in a left-to-right order. Alternatively, prediction / reconstruction is performed in a bottom-to-top order, but each subblock below and above can be predicted / reconstructed in a right-to-left order. Alternatively, prediction / reconstruction is performed in a left-to-right order, but each subblock below and above can be predicted / reconstructed in a top-to-bottom order. Alternatively, the prediction / reconstruction is performed in the order of left→right, but each sub-block at the left and right can be predicted / reconstructed in the order of bottom→top. Alternatively, the prediction / reconstruction is performed in the order of right→left, but each sub-block at the right and left can be predicted / reconstructed in the order of top→bottom. Alternatively, the prediction / reconstruction is performed in the order of right→left, but each sub-block at the right and left can be predicted / reconstructed in the order of bottom→top.
[0224] The encoding / decoding device may define any one of the above-described sequences and use that sequence. Alternatively, the encoding / decoding device may define at least two or more of the above-described sequences and selectively use any one of those sequences. To this end, an index or tag specifying any one of the predefined sequences may be encoded and notified.
[0225] Figure 6 A method of replacing unusable pixels in a reference area is shown as an embodiment to which the present invention is applied.
[0226] As described above, the reference region may be determined as one of the first to fourth pixel lines. However, in this embodiment, for ease of description, it is assumed that the reference region is the first pixel line. This embodiment may be applied in the same or similar manner to the second to fourth pixel lines.
[0227] When all pixels in the reference region are unavailable, the corresponding pixels can be replaced with one of the ranges of pixel values represented by the bit depth or the range of actual pixel values of the image. For example, the maximum, minimum, median, or average value of the range of pixel values can correspond to the value to be replaced. When the bit depth is 8, all pixels in the reference region can be filled with 128 when replacing with the median value of the bit depth.
[0228] However, if not, that is, not all pixels of the reference area are unavailable, but at least one of the pixels of the reference area is unavailable, then a replacement process may be performed on at least one of the upper reference area, the left reference area, the right reference area, or the lower reference area of the current block. For ease of explanation, the description will focus on the left reference area, the upper reference area, and the right reference area of the current block.
[0229] (Step 1) Determine whether the upper left pixel TL adjacent to the current block (prediction block) is unavailable. If the upper left pixel TL is unavailable, the pixel can be replaced by the median value of the bit depth.
[0230] (Step 2) It is possible to sequentially search whether there are unavailable pixels in the upper reference area. Here, the upper reference area may include a pixel line adjacent to at least one of the upper and upper right sides of the current block. The length of the upper reference area may be equal to the width (nW) of the current block, (2 nW), or equal to the sum of the width and height (nW + nH).
[0231] Here, the search direction can be performed from left to right. In this case, when it is determined that the pixel p[x][-1] is not available, the pixel p[x][-1] can be replaced by the adjacent pixel p[x-1][-1]. Alternatively, the search direction can be performed from right to left. In this case, when it is determined that the pixel p[x][-1] is not available, the pixel p[x][-1] can be replaced by the adjacent pixel p[x+1][-1].
[0232] (Step 3) The left reference area may be sequentially searched for unavailable pixels. Here, the left reference area may include a pixel line adjacent to at least one of the left or lower left of the current block. The length of the left reference area may be equal to the height (nH) of the current block, (2 nH), or equal to the sum of the width and height (nW + nH).
[0233] Here, the search direction can be performed from top to bottom. In this case, when it is determined that the pixel p[-1][y] is not available, the pixel p[-1][y-1] can be replaced by the adjacent pixel p[-1][y]. Alternatively, the search direction can be performed from bottom to top. In this case, when it is determined that the pixel p[-1][y] is not available, the pixel p[-1][y+1] can be replaced by the adjacent pixel p[-1][y].
[0234] (Step 4) A search may be performed sequentially to determine whether unavailable pixels exist in the right reference region. Here, the right reference region may include a pixel line adjacent to the right of the current block. The length of the right reference region may be the same as the height (nH) of the current block.
[0235] Here, the search direction can be performed from top to bottom. In this case, when it is determined that the pixel p[nW][y] is not available, the pixel p[nW][y-1] can be replaced by the adjacent pixel. Alternatively, the search direction can be performed from bottom to top. In this case, when it is determined that the pixel p[nW][y] is not available, the pixel p[nW][y] can be replaced by the adjacent pixel p[nW][y+1].
[0236] Alternatively, for the right reference area, a separate search process can be omitted. Instead, unavailable pixels in the right reference area can be filled with the median value of the bit depth. Alternatively, unavailable pixels in the right reference area can be replaced with one of the upper right pixel TR or the lower right pixel BR adjacent to the current block, or with their representative values. Here, the representative value can be expressed as an average value, maximum value, minimum value, mode value, median value, etc. Alternatively, the unavailable pixels in the right reference area can be derived by applying a predetermined weight to each of the upper right pixel TR and the lower right pixel BR. In this case, the weight can be determined by considering the first distance between the unavailable pixel in the right reference area and the upper right pixel TR and the second distance between the unavailable pixel in the right reference area and the lower right pixel BR. The lower right pixel BR can be filled with one of the upper left pixel TL, the upper right pixel TR, or the lower left pixel BL adjacent to the current block, or replaced with the representative value of at least two of the upper left pixel TL, the upper right pixel TR, or the lower left pixel BL. Here, the representative value is as described above. Alternatively, the lower right pixel BR may be derived by applying predetermined weights to at least two of the upper left pixel TL, the upper right pixel TR, or the lower left pixel BL, respectively. Here, the weight may be determined in consideration of the distance from the lower right pixel BR.
[0237] Meanwhile, the above-described substitution process is not limited to being performed in the order of top → left → right. For example, the substitution process may be performed in the order of left → top → right. Alternatively, the substitution process may be performed in parallel on the top and left reference regions, and then on the right reference region. Furthermore, when the substitution process is performed in the order of left → top → right, step 1 may be omitted.
[0238] Figure 7 A method of changing / correcting an intra prediction mode is shown as an embodiment to which the present invention is applied.
[0239] The decoded intra-frame prediction mode (IntraPredMode) can be changed based on a predetermined offset. The application of the offset can be selectively performed based on at least one of block attributes (i.e., size, shape, partition information, partition depth, intra-frame prediction mode value, or component type). Here, the block can refer to the current block and / or a neighboring block of the current block.
[0240] The partition information may include at least one of first information indicating whether the current block is divided into a plurality of sub-blocks, second information indicating the direction of the partition (e.g., horizontal or vertical), or third information regarding the number of sub-blocks to be partitioned. The second partition information may be encoded and notified by the encoding device. Alternatively, some of the partition information may be variably determined in the decoding device based on the aforementioned block attributes, or may be set to fixed values predefined in the encoding / decoding device.
[0241] For example, if the first information is a first value, the current block is divided into multiple sub-blocks; otherwise, the current block may not be divided into multiple sub-blocks (NO_SPLIT). When the current block is divided into multiple sub-blocks, the current block may be split horizontally (HOR_SPLIT) or vertically (VER_SPLIT) based on the second information. In this case, the current block may be divided into k sub-blocks. Here, k can be an integer of 2, 3, 4, or more. Alternatively, k can be limited to powers of 2, such as 1, 2, 4, etc. Alternatively, in the case of a block where at least one of the width or height of the current block is 4 (e.g., 4×8, 8×4), k is set to 2; otherwise, k is set to 4, 8, or 16. When the current block is not split (NO_SPLIT), k can be set to 1.
[0242] The current block may be divided into sub-blocks having the same width and height, or may be divided into sub-blocks having different widths and heights. The current block may be divided into N×M block units (e.g., 2×2, 2×4, 4×4, 8×4, 8×8, etc.) provided in advance to the encoding / decoding apparatus, regardless of the attributes of the above blocks.
[0243] The offset can only be applied when the size of the current block is less than or equal to a predetermined threshold value T1. Here, threshold value T1 may represent the maximum block size to which the offset is applied. Alternatively, the offset can only be applied when the size of the current block is greater than or equal to a predetermined threshold value T2. In this case, threshold value T2 may represent the minimum block size to which the offset is applied. The threshold value may be notified via the bitstream. Alternatively, the threshold value may be variably determined by the decoding device based on at least one of the above-mentioned block properties, or may be a fixed value pre-provided to the encoding / decoding device.
[0244] Alternatively, the offset may be applied only when the shape of the current block is non-square.For example, a predetermined offset (eg, 65) may be added to the IntraPredMode of the current block when the following conditions are met.
[0245] - nW is greater than nH
[0246] - IntraPredMode greater than or equal to 2
[0247] - IntraPredMode is less than (whRatio>1)? (8+2 whRatio): 8
[0248] Here, nW and nH represent the width and height of the current block, respectively, and whRatio may be set to Abs(Log2(nW / nH)).
[0249] Alternatively, when the following conditions are met, a predetermined offset (eg, 67) may be subtracted from the IntraPredMode of the current block.
[0250] - nH is greater than nW
[0251] - IntraPredMode is less than or equal to 66
[0252] - Is IntraPredMode greater than (whRatio>1)? (60-2 whRatio): 60
[0253] As described above, the final intra prediction mode may be determined by adding an offset to or subtracting an offset from the intra prediction mode (IntraPredMode) of the current block in consideration of the properties of the current block. However, the present invention is not limited thereto, and the application of the offset may be performed in the same / similar manner in consideration of properties (e.g., size, shape) of a subblock other than the current block.
[0254] Figure 8 A prediction method based on inter-component reference in an embodiment to which the present disclosure is applied is shown.
[0255] According to the component type, the current block can be divided into a luminance block and a chrominance block. The pixels of the reconstructed luminance block can be used to predict the chrominance 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).
[0256] Reference Figure 8 , an intra prediction mode of a chroma block may be determined ( S800 ).
[0257] like Figure 5As described above, according to the third flag, 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. The first group can be composed of prediction modes based only on inter-component references. The encoding / decoding device can define at least one of INTRA_LT_CCLM, INTRA_L_CCLM, or INTRA_T_CCLM as a prediction mode based on inter-component references. INTRA_LT_CCLM is a mode that refers to both the left area and the upper area adjacent to the luminance / chroma block, INTRA_L_CCLM is a mode that refers to the left area adjacent to the luminance / chroma block, and INTRA_T_CCLM is a mode that refers to the upper area adjacent to the luminance / chroma block.
[0258] Any one of the inter-component reference-based prediction modes can be selected using a predetermined index. The index may be information specifying any one of INTRA_LT_CCLM, INTRA_L_CCLM, or INTRA_T_CCLM. The index may be notified only when the third flag is the first value. The inter-component reference-based prediction modes belonging to the first group and the index assigned to each prediction mode are shown in Table 6 below.
[0259] [Table 6]
[0260]
[0261] Table 6 is merely an example of the index assigned to each prediction mode, but is not limited thereto. That is, as shown in Table 6, the indexes may be assigned in the order of priority of INTRA_LT_CCLM, INTRA_L_CCLM, and INTRA_T_CCLM, or may be assigned in the order of priority of INTRA_LT_CCLM, INTRA_T_CCLM, and INTRA_L_CCLM. Alternatively, the priority of INTRA_LT_CCLM may be lower than that of INTRA_T_CCLM or INTRA_L_CCLM. The third flag may be selectively notified based on information indicating whether inter-component references are allowed. For example, if the value of the information is 1, the third flag may be notified, otherwise, the third flag may not be notified. Here, the information may be determined to be 0 or 1 based on a predetermined condition described later.
[0262] (Condition 1) When the fourth flag indicating whether prediction based on inter-component reference is allowed is 0, the information may be set to 0. The fourth flag may be notified in at least one of a VPS, an SPS, a PPS, a PH, and a slice header.
[0263] (Condition 2) When at least one of the following sub-conditions is satisfied, the information can be set to 1.
[0264] - qtbtt_dual_tree_intra_flag is equal to 0
[0265] - The slice type is not an I slice
[0266] - The size of the coding tree block is less than 64×64
[0267] In condition 2, qtbtt_dual_tree_intra_flag can indicate whether the coding tree block is implicitly divided into 64×64 coding blocks and whether the 64×64 coding blocks are divided based on a dual tree. Dual tree refers to a method of dividing the luma component and chroma component using independent partitioning structures. The size of the coding tree block (CtbLog2Size) can be a size predefined in the encoding / decoding device (e.g., 64×64, 128×128, 256×256) or can be encoded and notified by the encoding device.
[0268] (Condition 3) When at least one of the following sub-conditions is satisfied, the information may be set to 1.
[0269] - The width and height of the first upper block are 64
[0270] - 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
[0271] - The depth of the first upper block is greater than (CtbLog2Size-6)
[0272] - The depth of the first upper block is the same as (CtbLog2Size-6), the first upper block is divided based on horizontal BT, and the second upper block is divided based on vertical BT
[0273] 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 greater. The depth of the first upper block may simply represent the depth according to the quadtree-based partition, or may represent the depth according to at least one of the quadtree, binary tree, or ternary tree partitions. 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.
[0274] When none of the above conditions 1 to 3 are met, the information can be set to 0.
[0275] However, even when at least one of Conditions 1 to 3 is satisfied, the information may be reset to 0 when at least one of the following sub-conditions is satisfied.
[0276] - The first upper block is 64×64 and performs the above sub-block based prediction
[0277] - 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)
[0278] Reference Figure 8 , a luma region for inter-component reference of a chroma block may be designated ( S810 ).
[0279] The luminance region may include at least one of a luminance block or an adjacent region adjacent to the luminance block. Here, the luminance block may be defined as including pixels pY[x][y] (x=0..nTbW 2-1, y=0..nTbH 2-1). The pixels may represent the reconstructed values before the loop filter is applied.
[0280] The adjacent area may include at least one of a left adjacent area, an upper adjacent area, or an upper left adjacent area. The left adjacent area may be set to include 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 adjacent area can be set to include the pixel 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 adjacent area can be set to the area including the pixel 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.
[0281] The above numSampL and numSampT may be determined based on the intra prediction mode of the current block. Here, the current block may represent a chroma block.
[0282] For example, when the intra prediction mode of the current block is INTRA_LT_CCLM, numSampL and numSampT may be derived based on Equation 9. Here, INTRA_LT_CCLM may indicate a mode of performing inter-component referencing based on a left neighboring region and an upper neighboring region of the current block.
[0283] [Equation 1]
[0284] numSampT=availT? nTbW: 0
[0285] numSampL=availL? nTbH: 0
[0286] 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, numSampL may be derived as 0.
[0287] In contrast, 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.
[0288] [Equation 2]
[0289] numSampT=(availT&&predModeIntra==INTRA_T_CCLM)?(nTbW+numTopRight): 0
[0290] numSampL=(availL&&predModeIntra==INTRA_L_CCLM)?(nTbH+numLeftBelow): 0
[0291] In Equation 2, INTRA_T_CCLM may refer to a mode for performing inter-component referencing based on the upper neighboring area of the current block. INTRA_L_CCLM may refer to a mode for performing inter-component referencing based on the left neighboring area of the current block. numTopRight may refer to 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 among the pixels belonging to the lowest pixel row of the corresponding area. In the availability determination, whether a pixel is available may be determined sequentially from left to right. This process may be performed until an unavailable pixel is found. numLeftBelow may refer to 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 among the pixels belonging to the rightmost pixel row (column) of the corresponding area. In the availability determination, whether a pixel is available may be determined sequentially from top to bottom. This process may be performed until an unavailable pixel is found.
[0292] Reference Figure 8 , downsampling may be performed on the luminance region specified in S810 ( S820 ).
[0293] Downsampling may include at least one of the following: 1. downsampling of the luminance block, 2. downsampling of the left adjacent area of the luminance block, or 3. downsampling of the upper adjacent area of the luminance block. This will be described in detail below.
[0294] 1. Downsampling of Luma Blocks
[0295] (Implementation Method 1)
[0296] The corresponding pixel pY[2 x][2 y] and the adjacent pixels to obtain the pixel pDsY[x][y] (x=0..nTbW-1, y=0..nTbH-1) of the downsampled luma block. The adjacent pixels may represent at least one of the left adjacent pixel, the right adjacent pixel, the upper adjacent pixel, or the lower adjacent pixel of the corresponding pixel. For example, the pixel pDsY[x][y] may be obtained based on the following equation 3.
[0297] [Equation 3]
[0298] 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
[0299] However, there may be a situation where the left / upper adjacent area of the current block is not available. When the left adjacent area of the current block is not available, the corresponding pixel pY[0][2 y] and the neighboring pixels of the corresponding pixel are used to obtain the pixel pDsY[0][y] (y=1..nTbH-1) of the downsampled luma block. The neighboring pixels may represent 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) may be obtained based on the following equation 4.
[0300] [Equation 4]
[0301] pDsY[0][y]=(pY[0][2 y-1]+2 pY[0][2 y]+pY[0][2 y+1]+2)>>2
[0302] When the upper adjacent area of the current block is not available, the corresponding pixel pY[2 The pixel pDsY[x][0] (x=1..nTbW-1) of the downsampled luma block is obtained by combining the neighboring pixels of the corresponding pixel with the pixel pDsY[x][0]. The neighboring pixels may represent 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) may be obtained based on the following equation 5.
[0303] [Equation 5]
[0304] pDsY[x][0]=(pY[2 x-1][0]+2 pY[2 x][0]+pY[2 x+1][0]+2)>>2
[0305] 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 positions of the neighboring pixels may vary depending on whether the left / upper neighboring area of the current block is available.
[0306] For example, when the left adjacent region is available and the upper adjacent region is unavailable, pDsY[0][0] may be derived based on the following Equation 6.
[0307] [Equation 6]
[0308] pDsY[0][0]=(pY[-1][0]+2 pY[0][0]+pY[1][0]+2)>>2
[0309] In contrast, when the left adjacent region is unavailable and the upper adjacent region is available, pDsY[0][0] may be derived based on the following Equation 7.
[0310] [Equation 7]
[0311] pDsY[0][0]=(pY[0][-1]+2 pY[0][0]+pY[0][1]+2)>>2
[0312] In another example, when both the left-neighboring area and the upper-neighboring area are unavailable, pDsY[0][0] may be set to a corresponding pixel pY[0][0] of the luma block.
[0313] (Implementation Method 2)
[0314] The corresponding pixel pY[2 x][2 y] and the neighboring pixels of the corresponding pixel to obtain the pixel pDsY[x][y] (x=0..nTbW-1, y=0..nTbH-1) of the downsampled luma block. The neighboring pixel may represent 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] may be obtained based on the following equation 8.
[0315] [Equation 8]
[0316] 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
[0317] However, when the left neighboring area of the current block is not available, the corresponding pixel pY[0][2 y] and its lower neighboring pixels derive the pixel pDsY[0][y] (y=0..nTbH-1) of the downsampled luma block. For example, the pixel pDsY[0][y] (y=0..nTbH-1) can be derived based on the following equation 9.
[0318] [Equation 9]
[0319] pDsY[0][y]=(pY[0][2 y]+pY[0][2 y+1]+1)>>1
[0320] Downsampling of the luma block can be performed based on one of Embodiments 1 and 2 as described above. Here, one of Embodiments 1 and 2 can be selected based on a predetermined flag. The flag may indicate whether the downsampled luma pixel has the same position as the original luma pixel. For example, when the flag is a first value, the downsampled luma pixel has the same position as the original luma pixel. Conversely, when the flag is a second value, the downsampled luma pixel has the same horizontal position as the original luma pixel, but is offset by half a pixel in the vertical direction.
[0321] 2. Downsampling of the left adjacent area of the luminance block
[0322] (Implementation Method 1)
[0323] It can be based on the corresponding pixel pY[-2][2 y] and the neighboring pixels of the corresponding pixel to obtain the pixel pLeftDsY[y] (y = 0..numSampL-1) in the downsampled left neighboring area. The neighboring pixels can represent 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 obtained based on the following equation 10.
[0324] [Equation 10]
[0325] 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
[0326] However, when the upper left neighboring area of the current block is unavailable, 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 pixels of the corresponding pixel. The neighboring pixel may represent 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.
[0327] [Equation 11]
[0328] pLeftDsY[0]=(pY[-3][0]+2 pY[-2][0]+pY[-1][0]+2)>>2
[0329] (Implementation Method 2)
[0330] It can be based on the corresponding pixel pY[-2][2 y] and the neighboring pixels around the corresponding pixel to obtain the pixel pLeftDsY[y] (y = 0..numSampL-1) in the downsampled left neighboring area. The neighboring pixels can represent 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 obtained based on the following equation 12.
[0331] [Equation 12]
[0332] 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
[0333] Similarly, downsampling of the left adjacent region can be performed based on one of Embodiments 1 and 2 as described above. Here, one of Embodiments 1 and 2 can be selected based on a predetermined flag. The flag indicates whether the downsampled luma pixel has the same position as the original luma pixel. This is the same as described above.
[0334] 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, it may indicate 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.
[0335] 3. Downsampling of the upper adjacent area of the luminance block
[0336] (Implementation Method 1)
[0337] The pixel pTopDsY[x] (x=0..numSampT-1) of the downsampled upper adjacent area can be obtained by considering whether the upper adjacent area belongs to a CTU different from the CTU to which the luminance block belongs.
[0338] When the upper adjacent area belongs to the same CTU as the luminance block, the corresponding pixel pY[2 The pixel pTopDsY[x] in the downsampled upper adjacent region is obtained by combining the adjacent pixels of the corresponding pixel with the pixel pTopDsY[x]. The adjacent pixels may represent at least one of the left adjacent pixel, the right adjacent pixel, the upper adjacent pixel, or the lower adjacent pixel of the corresponding pixel. For example, the pixel pTopDsY[x] may be obtained based on the following equation 13.
[0339] [Equation 13]
[0340] 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
[0341] On the contrary, when the upper adjacent area belongs to a different CTU from the luminance block, the corresponding pixel pY[2 The pixel pTopDsY[x] in the downsampled upper adjacent region is obtained by combining the adjacent pixels of the corresponding pixel with the pixel pTopDsY[x][-1]. The adjacent pixels may represent at least one of the left adjacent pixel or the right adjacent pixel of the corresponding pixel. For example, the pixel pTopDsY[x] may be obtained based on the following equation 14.
[0342] [Equation 14]
[0343] pTopDsY[x]=(pY[2 x-1][-1]+2 pY[2 x][-1]+pY[2 x+1][-1]+2)>>2
[0344] Alternatively, when the upper left neighboring area of the current block is not available, the neighboring pixel may represent 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.
[0345] [Equation 15]
[0346] pTopDsY[0]=(pY[0][-3]+2 pY[0][-2]+pY[0][-1]+2)>>2
[0347] 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.
[0348] (Implementation Method 2)
[0349] The pixel pTopDsY[x] (x=0..numSampT-1) of the downsampled upper adjacent area can be obtained by considering whether the upper adjacent area belongs to a different CTU from the luminance block.
[0350] When the upper adjacent area belongs to the same CTU as the luminance block, the corresponding pixel pY[2 The pixel pTopDsY[x] in the downsampled upper adjacent region is obtained by combining the adjacent pixels of the corresponding pixel with the pixel pTopDsY[x]. The adjacent pixel may represent at least one of the lower adjacent pixel, the left adjacent pixel, the right adjacent pixel, the lower left adjacent pixel, or the lower right adjacent pixel of the corresponding pixel. For example, the pixel pTopDsY[x] may be obtained based on the following equation 16.
[0351] [Equation 16]
[0352] 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
[0353] On the contrary, when the upper adjacent area belongs to a different CTU from the luminance block, the corresponding pixel pY[2 [x] [-1] and the adjacent pixels of the corresponding pixel are used to obtain the pixel pTopDsY[x] in the downsampled upper adjacent area. The adjacent pixel can represent at least one of the left adjacent pixel or the right adjacent pixel of the corresponding pixel. For example, the pixel pTopDsY[x] can be obtained based on the following equation 17.
[0354] [Equation 17]
[0355] pTopDsY[x]=(pY[2 x-1][-1]+2 pY[2 x][-1]+pY[2 x+1][-1]+2)>>2
[0356] Alternatively, when the upper left neighboring area of the current block is not available, the neighboring pixel may represent 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.
[0357] [Equation 18]
[0358] pTopDsY[0]=(pY[0][-2]+pY[0][-1]+1)>>1
[0359] 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.
[0360] In a similar manner, downsampling of the upper adjacent region can be performed based on one of Embodiments 1 and 2 as described above. Here, one of Embodiments 1 and 2 can 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.
[0361] Meanwhile, 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 indicate 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.
[0362] Only the corresponding pixel pY[-2][2 Downsampling is performed for at least one of the left neighboring region or the upper neighboring region of the luma block (hereinafter, the luma reference region) based on the surrounding pixels. Here, the specific position may be determined based on the position of a selected pixel among a plurality of pixels belonging to at least one of the left neighboring region or the upper neighboring region of the chroma block (hereinafter, referred to as the chroma reference region).
[0363] The selected pixels may be odd-numbered pixels or even-numbered pixels in the chromaticity reference area. Alternatively, the selected pixels may be a starting pixel and one or more pixels located at a predetermined interval from the starting pixel. Here, the starting pixel may be a pixel located at the first, second, or third position in the chromaticity reference area. The interval may be 1, 2, 3, 4, or more sampling intervals. For example, when the interval is one sampling interval, the selected pixels may include the nth pixel, the (n+2)th pixel, and the like. The number of selected pixels may be 2, 4, 6, 8, or more.
[0364] The number of selected pixels, the starting pixel, and the interval may be variably determined based on at least one of the length of the chroma reference region (i.e., numSampL and / or numSampT) or the intra prediction mode of the chroma block. Alternatively, the number of selected pixels may be a fixed number (e.g., 4) pre-determined to the encoding / decoding apparatus, regardless of the length of the chroma reference region and the intra prediction mode of the chroma block.
[0365] Reference Figure 8 , parameters for inter-component reference of the chroma block may be derived ( S830 ).
[0366] The parameter may include at least one of a weight or an offset. The parameter may be determined considering an intra prediction mode of the current block. The parameter may be derived using selected pixels of a chroma reference region and pixels obtained by downsampling a luma reference region.
[0367] Specifically, by performing a size comparison between n pixels obtained by downsampling the luminance reference area, the n pixels can be classified into two groups. For example, the first group can be a group of pixels with relatively large values among the n pixels, and the second group can be a group of pixels other than the pixels in the first group among the n samples. In other words, the second group can be a group of pixels with relatively small values. Here, n can be 4, 8, 16, or more. The average value of the pixels belonging to the first group can be set to a maximum value MaxL, and the average value of the pixels belonging to the second group can be set to a minimum value MinL.
[0368] The selected pixels of the chrominance reference area can be grouped based on the grouping of n pixels obtained by downsampling the luma reference area. A first group of chrominance reference areas is configured using pixels of the chrominance reference area corresponding to the pixels of the first group of chrominance reference areas. A second group of chrominance reference areas can be configured using pixels of the chrominance reference area corresponding to the pixels of the second group of luma reference areas. Similarly, the average value of the pixels in the first group can be set to a maximum value MaxC, and the average value of the pixels in the second group can be set to a minimum value MinC.
[0369] Based on the calculated maximum (MaxL, MaxC) and minimum (MinL, MaxC) values, weights and / or biases for the parameters can be derived.
[0370] A chroma block may be predicted based on the downsampled luma block and the parameters ( S840 ).
[0371] The chroma blocks may be predicted by applying at least one of pre-derived weights or offsets to the pixels of the downsampled luma block.
[0372] Figure 9A method of configuring a reference area is shown as an embodiment to which the present invention is applied.
[0373] The reference region according to the present invention may be a region adjacent to the current block. Next, a method for configuring each reference region as an available pixel by classifying the reference region according to a category will be described. For ease of explanation, the description will focus on the left reference region, the upper reference region, and the right reference region of the current block. Figure 6 The described embodiments refer to or derive descriptions that are not mentioned in embodiments to be described later.
[0374] Reference Figure 9 , the pixels in the reference area can be classified into predetermined categories (SA00).
[0375] The reference region can be identified / classified into k categories, where k can be an integer of 1, 2, 3, or more. Alternatively, k can be limited to an integer of 2 or less. The reference region can be classified into one of the predetermined categories based on the image type (I / P / B), classification type (Y / Cb / Cr, etc.), block attributes (size, shape, partition information, partition depth, etc.), and the location of the reference pixel. Here, the block can refer to the current block and / or a neighboring block of the current block.
[0376] For example, the reference region can be classified into predetermined categories based on the size of the block. In the case of the block size, the support range can be determined by the threshold size. Based on the width (W) and height (H), each threshold size can be expressed as W, H, W×H, and W H. W and H can be natural numbers, such as 4, 8, 16, 32, etc. Two or more threshold sizes are supported and can be used to set a supported range, such as the minimum and maximum values a block may have.
[0377] Alternatively, the reference region may be classified into predetermined categories based on the position of the reference pixel. In this case, the position of the reference pixel may be defined in pixels or may be defined as the direction of the block to which the reference pixel belongs (left, right, top, bottom, top left, top right, bottom left, bottom right).
[0378] Reference Figure 6 , the position of the reference pixel can be defined as whether it is included in the positions of the upper left pixel TL, the upper right pixel TR, the lower left pixel BL, and the lower right pixel BR. In addition, the position of the reference pixel can be defined as whether it is included in the position of the upper left pixel TL, the upper right pixel TR, the lower left pixel BL, and the lower right pixel BR based on the width of the current block (2 nW), height (2 nH) or the sum of width and height (nW+nH) or the pixel position of TL0, TL1, TR0, TR1, BL0, BL1, BR0, BR1. Figure 12, the position of the reference pixel may be defined as whether it is included in the pixel positions of T0, T3, B0, B3, L0, L3, R0, and R3, which are pixels located at both ends of the upper block, lower block, left block, and right block. Alternatively, the position of the reference pixel may be defined as whether it is included in the pixel located in the middle of each block (T1, L2, B2, R1, etc.).
[0379] Reference regions (reference pixels) may be classified into each category based on various coding elements.
[0380] Reference Figure 9 , unavailable pixels belonging to the reference area can be searched (SA10).
[0381] The reference area may be sequentially searched for unavailable pixels. Figure 6 , the starting position of the search can be determined in TL, TR, BL and BR, but is not limited thereto. In this case, when the search is performed sequentially, the number of the starting positions of the search can be set to one, but for the case of parallel processing, it can be set to two or more.
[0382] The search area for unavailable pixels can be determined based on the starting position of the search. If a search position is specified (assuming TL), the upper or left reference area can be searched before the right reference area, but this may not be the case in an encoding setting (parallel processing).
[0383] Here, the search direction may be determined as one of clockwise and counterclockwise. In this case, one of clockwise and counterclockwise may be selected for the entire reference area. Alternatively, one of clockwise and counterclockwise may be adaptively selected according to the position of the reference area. That is, one search direction of clockwise or counterclockwise may be supported for each of the upper / lower / left / right reference areas. Here, it should be understood that the position of the reference area is not limited to the width (nW) and height (nH) of the current block (i.e., including 2 nW, 2 reference area included in nH, nW+nH, etc.).
[0384] Here, in the case of a clockwise direction, it can refer to a direction from bottom to top in the left reference area, a direction from left to right in the upper reference area, a direction from top to bottom in the right reference area, and a direction from right to left in the lower reference area. Counterclockwise can be derived in the opposite direction of counterclockwise.
[0385] For example, when searching from the upper left pixel TL adjacent to the current block, the upper reference area and the right reference area can be searched in a clockwise direction (left → right, top → bottom). Alternatively, the left reference area and the lower reference area can be searched in a counterclockwise direction (up → down, left → right). However, the above description is only a partial example, and various modified examples are possible.
[0386] Reference Figure 9 , unavailable pixels can be replaced with available pixels by using a method set for each category (SA20).
[0387] Unavailable pixels can be replaced with a predetermined default value (e.g., the median of a pixel value range). Alternatively, unavailable pixels can be replaced based on predetermined available pixels, and unavailable pixels can be replaced with values obtained by copying, linearly extrapolating, or interpolating one or more adjacent available pixels. First, a process is performed to classify each pixel into a category based on its position. The following are examples of how each method can be applied based on multiple categories, with unavailable pixels being referred to as target pixels.
[0388] As an example <1> When there are available pixels in the reference area, the target pixel can be replaced by using a pixel value obtained based on the available pixels, and when there are no available pixels in the reference area, the target pixel can be replaced by a default value.
[0389] As an example <2> , when there are available pixels before the target pixel and at the starting position of the search, the target pixel can be replaced by using the pixel value obtained based on the available pixels, and when there are no available pixels before the target pixel, the target pixel can be replaced by a default value.
[0390] As an example <3> , you can use a default value instead of the target pixel.
[0391] exist <1> In the case of , a method of replacing with available pixels according to whether there are available pixels in the reference area is described. <2> In the case of , a method of replacing an available pixel with an available pixel according to whether an available pixel exists during a previous search process is described. <3> In the case of , a method of replacing it with a fixed available pixel is described.
[0392] If a category is supported, you can use <1> to <3> If more than one category is supported, a reference pixel belonging to any one category can be selected and used <1> to <3> One of the categories, and reference pixels belonging to another category can be selected and used <1> to <3> one.
[0393] Reference Figure 9 , the reference area can be configured as available pixels (SA30). In addition, intra prediction can be performed (SA40).
[0394] The above embodiment describes a method of replacing unavailable pixels in a reference area with available pixels according to the categories by classifying the unavailable pixels into categories. In addition, not only unavailable pixels but also available pixels can be replaced with a default value, another available pixel, or a value obtained based on other available pixels.
[0395] Figure 10 is an exemplary diagram for gradually configuring intra prediction mode settings as an embodiment to which the present invention is applied.
[0396] Reference Figure 10 (Step 1) supports various prediction mode candidate group configurations, and one of them can be selected implicitly or explicitly. The prediction mode candidate group can be identified by the number of modes, the slope information (dy / dx) of the directional mode, the support range of the directional mode, etc. In this case, even if the number of modes is k (a directional modes and b non-directional modes), there may be prediction mode candidates with different a or b.
[0397] Prediction mode candidate group selection information can be explicitly generated and notified at at least one of the VPS, SPS, PPS, PH, and slice header levels. Alternatively, the prediction mode candidate group can be implicitly selected based on coding settings. In this case, the coding settings can be defined based on the picture type (I / P / B), component type, and block attributes (size, shape, partition information, partition depth, etc.). Here, the block can refer to the current block and / or its neighboring blocks, and in this embodiment, the same description applies.
[0398] When a prediction mode candidate group is selected (B in this example) through (step 1), intra-frame prediction or prediction mode encoding can be performed based on this. Alternatively, a process for efficient candidate group configuration can be performed, which will be described through (step 2).
[0399] Reference Figure 10 In (step 2), the configurations of some prediction modes can be configured in various ways, and one of them can be selected implicitly or explicitly. (B0) to (B2) can be candidate configurations assuming that the prediction modes in some directions are not well used (dashed lines in the figure).
[0400] The prediction mode candidate group selection information may be explicitly generated and may be signaled in a CTU, coding block, prediction block, transform block, etc. Alternatively, the prediction mode candidate group may be implicitly selected according to coding settings, and the coding settings may be defined as various previous coding elements.
[0401] Here, the shape of the block may be subdivided according to its width / height ratio (W:H), and the prediction mode candidate group may be differently configured according to all possible ratios of W:H or according to only a certain ratio of W:H.
[0402] When a prediction mode candidate group is selected (B1 in this example) through (step 2), intra-frame prediction or prediction mode encoding can be performed based on this. Alternatively, a process for efficient candidate group configuration can be performed, which will be described through (step 3).
[0403] Reference Figure 10 (Step 3), since the number of prediction mode candidate groups is large, it may be assumed that some prediction modes (dashed lines in the figure) are not well used as candidate configurations.
[0404] Prediction mode candidate group selection information can be explicitly generated and notified in CTUs, coding blocks, prediction blocks, transform blocks, etc. Alternatively, the prediction mode candidate group can be implicitly selected based on the coding settings, and the coding settings can be defined as various coding elements. In addition, the position of the block, the prediction mode, etc. can be additionally considered in defining the coding settings.
[0405] In this case, the position and prediction mode of the block can represent information about neighboring blocks adjacent to the current block. That is, based on the attribute information of the current block and the neighboring blocks, it is estimated that the prediction mode that is not well used can be derived, and the corresponding mode can be excluded from the prediction mode candidate group.
[0406] For example, when the adjacent blocks include Figure 12 When the positions TL, T0, TR0, L0 and BL0 are set, it is assumed that the prediction mode of the corresponding block has a certain directionality (from upper left to lower right). In this case, it can be expected that the prediction mode of the current block has a certain directionality with high probability, and the following processing possibilities may exist.
[0407] For example, intra prediction may be performed on all modes within a prediction mode candidate group. In addition, prediction mode encoding may be performed based on the prediction mode candidate group.
[0408] Alternatively, intra prediction may be performed on a mode within a prediction mode candidate group from which some modes have been removed. In addition, prediction mode encoding may be performed based on a prediction mode candidate group from which some modes have been removed.
[0409] Comparing the above examples, it can be distinguished whether a prediction mode considered to have a low probability of occurrence is included in the actual prediction and encoding process (which may be included as non-MPM, etc.) or removed.
[0410] In the case of (B21) where prediction modes having different directivities from those of neighboring blocks can be partially removed, there may be an example where some sparsely arranged modes are removed for a case where corresponding directivity patterns actually occur.
[0411] Figure 11 A method of classifying intra prediction modes into a plurality of candidate groups is shown as an embodiment to which the present invention is applied.
[0412] The following describes the case of classifying into one or more candidate groups for decoding of intra prediction modes, and this may be the same or similar to the MPM candidate group and non-MPM candidate group mentioned above. Therefore, the parts not mentioned in this embodiment can be derived in the same or similar manner as the previous embodiment. In the case of this embodiment, the method of expanding the number of candidate groups and configuring the candidate groups will be described later.
[0413] The intra prediction mode of the current block can be derived by selectively using any one of a plurality of candidate groups. To this end, the selection flag may use a number as large as or smaller than (the number of candidate groups - 1).
[0414] For example, when prediction modes are classified into three candidate groups (A, B, C), a flag (first flag) indicating whether the intra prediction mode of the current block is derived from candidate group A may be used.
[0415] In this case, when the first flag is a first value, candidate group A is used, and when the first flag is a second value, a flag (second flag) indicating whether the intra prediction mode of the current block is derived from candidate group B may be used.
[0416] In this case, when the second tag is the first value, candidate group B is used, and when the second tag is the second value, candidate group C may be used. In the above example, three candidate groups are supported, and for this purpose, the first tag and the second tag may be used, i.e., two selection tags in total.
[0417] When one of the candidate groups is selected, the intra prediction mode of the current block can be determined based on the candidate group and the candidate group index. The candidate group index can be information that specifies any one of the candidates belonging to the candidate group. The candidate group index can be notified only when multiple candidates belong to the candidate group.
[0418] The above example describes the configuration of the selection flag when supporting three candidate groups. As in the above configuration, flags indicating whether the prediction mode of the current block is derived from a candidate group with a higher priority can be supported sequentially (for example, in the order of first flag → second flag). That is, when a predetermined candidate group selection flag is generated and the corresponding candidate group is not selected, a selection flag for the candidate group with the next higher priority can be generated.
[0419] Alternatively, a configuration having a different meaning from the selection flag (EE) may be used. For example, a flag (first flag) indicating whether the intra prediction mode of the current block is derived from candidate group A or candidate group B may be used.
[0420] In this case, when the first flag is the first value, candidate group C is used, and when the first flag is the second value, a flag (second flag) indicating whether the intra prediction mode of the current block is derived from candidate group A may be used.
[0421] In this case, when the second flag is the first value, candidate group A may be used, and when the second flag is the second value, candidate group B may be used.
[0422] Each of candidate groups A, B, and C may have m, n, or p candidates, and m may be an integer of 1, 2, 3, 4, 5, 6, or more. n may be an integer of 1, 2, 3, 4, 5, 6, or more. Alternatively, n may be an integer between 10 and 40. p may be (the total number of prediction modes - mn). Here, m may be less than or equal to n, and n may be less than or equal to p.
[0423] As another example, when prediction modes are classified into four candidate groups (A, B, C, D), flags (first flag, second flag, third flag) indicating whether the intra prediction mode of the current block is derived from candidate groups A, B, C may be used.
[0424] In this case, when the first tag is the second value, a second tag can be generated, and when the second tag is the second value, a third tag can be generated. That is, when the first tag is the first value, candidate group A can be used, and when the second tag is the first value, candidate group B can be used. Furthermore, when the third tag is the first value, candidate group C can be used, and when the third tag is the second value, candidate group D can be used. In this example, the opposite configuration is also possible, as in some examples (EE) of configurations with three candidate groups.
[0425] Alternatively, when the first tag is the first value, the second tag may be generated, and when the first tag is the second value, the third tag may be generated. When the second tag is the first value, candidate group A may be used, and when the second tag is the second value, candidate group B may be used. When the third tag is the first value, candidate group C may be used, and when the second value is the second value, candidate group D may be used.
[0426] Each of candidate groups A, B, C, and D may have m, n, p, or q candidates, and m may be an integer of 1, 2, 3, 4, 5, 6, or more. n may be an integer of 1, 2, 3, 4, 5, 6, or more. Alternatively, n may be an integer between 8 and 24. p may be an integer such as 6, 7, 8, 9, 10, 11, 12, or the like. Alternatively, p may be an integer between 10 and 32. q may be (the total number of prediction modes - mnp). Here, m may be less than or equal to n, n may be less than or equal to p, and p may be less than or equal to q.
[0427] Next, we will describe how to configure each candidate group when supporting multiple candidate groups. The reason for supporting multiple candidate groups is to achieve efficient intra-frame prediction mode decoding. Specifically, it is expected that the same prediction mode as the intra-frame prediction mode of the current block is configured as a candidate group with a high priority, and it is not expected that the same prediction mode as the intra-frame prediction mode of the current block is configured as a candidate group with a low priority.
[0428] For example, in Figure 11 , when category 2 (a), category 3 (b and c), and category 4 (d) are candidate groups with the lowest priority, respectively, a prediction mode that is not included in any of the candidates with the previous priority can be used to configure the candidate group. In this embodiment, since the candidate group is composed of the remaining prediction modes that are not included in the previous candidate group, it is assumed that it is a candidate group that is irrelevant to the priority between the prediction modes for configuring each candidate group to be described later (that is, the remaining prediction modes that are not included in the previous candidate group without considering the priority). And, it is assumed that the priority (priority order) between the candidate groups is in ascending order (category 1 → category 2 → category 3 → category 4), as shown in FIG. Figure 11 Priority in examples shown and described later is a term used in a list mode for configuring each candidate group.
[0429] Similar to the aforementioned MPM candidate group, the candidate group can be configured with prediction modes of neighboring blocks, default modes, predetermined directional modes, etc. For the purpose of allocating fewer bits to the prediction mode with the highest probability of occurrence, the candidate group can be configured by determining a predetermined priority for configuring the candidate group.
[0430] Reference Figure 11 A, the priority of the first candidate group (category 1) may be supported. When the first candidate group is configured based on the number of first candidate groups according to the priority, the remaining prediction modes (b, j, etc.) may be configured as the second candidate group (category 2).
[0431] Reference Figure 11B. A common priority for the first and second candidate groups can be supported. The first candidate group is configured based on the number of first candidate groups according to the priority. After the prediction mode (e) ultimately included in the first candidate group (after c), the second candidate group is configured based on the number of second candidate groups according to the priority. Additionally, the remaining prediction modes (b, j, etc.) can be configured as a third candidate group (category 3).
[0432] Reference Figure 11 C. Separate priorities (first priority, second priority) can be supported for the first and second candidate groups. The first candidate group is configured based on the number of first candidate groups according to the first priority. Then, the second candidate group is configured based on the number of second candidate groups according to the second priority. Additionally, the remaining prediction modes (b, w, x, etc.) can be configured as a third candidate group.
[0433] Here, similar to the existing priority (first priority), it can be based on the adjacent blocks <1> Prediction mode, default mode <2> , predetermined directional pattern <3> etc. to set the second priority. However, the priority may be set based on an importance different from that of the first priority (for example, if the first priority is configured in the order of 1-2-3, the second priority is configured in the order of 3-2-1, etc.). In addition, the second priority may be variably configured according to the pattern included in the previous candidate group, and may be affected by the pattern of the neighboring blocks of the current block. The second priority may be configured differently from the first priority, but it is understood that the configuration of the second priority may be partially affected by the configuration of the first candidate group. In this paragraph, it should be understood that the first priority (previous level), the first candidate group (previous candidate group), and the second priority (current level) and the second candidate group (current candidate group) are not described in fixed levels such as numbers.
[0434] Reference Figure 11 D can support the common priority (first priority) of the first and second candidate groups, and can support the independent priority (second priority) of the third candidate group. The first candidate group is configured based on the number of first candidate groups according to the first priority. After the prediction mode (d) is finally included in the first candidate group (after e), the second candidate group is configured based on the number of second candidate groups according to the priority. Then, the third candidate group is configured based on the number of third candidate groups according to the second priority. In addition, the remaining prediction modes (u, f, etc.) can be configured as a fourth candidate group.
[0435] According to an embodiment of the present invention, in the case of an intra prediction mode of a current block, the prediction mode may be configured with one or more candidate groups, and prediction mode decoding may be performed based on this. In this case, one or more priorities for configuring the candidate groups may be supported. The priorities may be used in the process of configuring the one or more candidate groups.
[0436] In the above example, when two or more priorities are supported, a priority (second priority) separate from the priority (first priority) used in the previous candidate group (first candidate group) is used for another candidate group (second candidate group). This can correspond to a case where all candidates in one candidate group are configured according to one priority.
[0437] Additionally, the first priority level for the first candidate group can be used to configure some candidates in the second candidate group. That is, some candidates (cand_A) in the second candidate group can be determined based on the first priority level (starting with the prediction modes not included in the first candidate group), and some candidates (or the remaining candidates, cand_B) in the second candidate group can be determined based on the second priority level. In this case, cand_A can be an integer of 0, 1, 2, 3, 4, 5, or a larger integer. That is, when configuring the first candidate group, prediction modes not included in the first candidate group can be included in the second candidate group.
[0438] For example, three candidate groups are supported, and the first candidate group includes two candidates. A first priority (e.g., Pmode_L, Pmode_U, DC, Planar, Ver, Hor, etc.) may be determined among prediction modes of neighboring blocks (e.g., left, top), predetermined directional modes (e.g., vertical, horizontal, etc.), and predetermined non-directional modes (e.g., DC, planar, etc.). The candidate groups are configured based on the number of the first candidate group according to the first priority (e.g., Pmode_L, Pmode_U).
[0439] In this case, the second candidate group is configured with 6 candidates, and the second priority (for example, diagonal lower left - diagonal lower right - diagonal upper right - diagonal lower right - diagonal upper right - diagonal lower right - diagonal lower right - diagonal lower right - diagonal lower right - diagonal lower right - diagonal lower right - diagonal lower right - diagonal lower right - diagonal lower right - diagonal lower right - diagonal upper ... lower right - diagonal lower right - diagonal lower right - diagonal upper right - diagonal lower right - diagonal lower<Pmode_L+2> ,<Pmode_U+2> wait).
[0440] The second candidate group may be configured based on the number of the second candidate group according to the second priority. Alternatively, two candidates (DC, Plane) of the second candidate group may be configured based on the first priority, and the remaining four candidates (DDL, DDR, DUR) may be configured based on the second priority.
[0441] For ease of explanation, the same terms as previously described are used, such as first candidate group, second candidate group, and first priority, but it should be noted that the priorities among candidate groups in the plurality of candidate groups are not fixed to first and second.
[0442] In summary, when classified into a plurality of candidate groups for prediction mode decoding and supporting one or more priorities, a predetermined candidate group may be configured based on the one or more priorities.
[0443] Figure 12 is an exemplary diagram showing a current block and pixels adjacent thereto as an embodiment to which the present invention is applied.
[0444] Reference Figure 12 , showing pixels (a to p) belonging to the current block and pixels adjacent thereto. Specifically, the pixels adjacent thereto represent pixels adjacent to the current block that can be referenced (Ref_T, Ref_L, Ref_TL, Ref_TR, and Ref_BL), and pixels adjacent to the current block that cannot be referenced (B0 to B3, R0 to R3, BR). This figure assumes that some encoding order, scanning order, etc. are fixed (the left, top, top-left, top-right, and bottom-left blocks of the current block can be referenced), and can be changed to different configurations depending on changes in encoding settings.
[0445] Figure 13 A method of performing intra prediction step by step as an embodiment to which the present invention is applied is shown.
[0446] The current block can perform intra prediction using pixels located in the left, right, up, and down directions. Figure 12 As shown, there may be not only pixels that can be referenced but also pixels that cannot be referenced. By estimating not only the pixel values of referenceable pixels but also the pixel values of non-referenceable pixels and using them, encoding efficiency can be improved.
[0447] Reference Figure 13 , any pixel value (SB00) can be obtained.
[0448] Here, the arbitrary pixel may be a pixel that cannot be referenced around the current block or a pixel inside the current block. The arbitrary pixel position will be described with reference to the following figures.
[0449] Figure 14 FIG. 1 is an exemplary diagram of arbitrary pixels used for intra prediction as an embodiment to which the present invention is applied.
[0450] Reference Figure 14 , not only the pixel (c) outside the current block and cannot be referenced, but also the pixel (a, b) inside the current block can be any pixel. The following assumes that the size of the current block is width × height, and the upper left coordinate is (0,0).
[0451] exist Figure 14 In , a and b can be located from (0, 0) to (width-1, height-1).
[0452] For example, a and b can be located on the boundary line (left, right, top, bottom) of the current block. For example, a and b can be located from (width-1, 0) to (width-1, height-1) in the right column of the current block or from (0, height-1) to (width-1, height-1) in the bottom row of the current block.
[0453] For example, a and b can be located in odd or even columns and rows of the current block. For example, a and b can be located in even rows of the current block, or can be located in odd columns of the current block. Alternatively, a and b can be located in even rows and odd columns of the current block, or can be located in odd rows and odd columns of the current block. Here, a and b can also be located in addition to odd or even numbers with k or exponent (2 k ), and k can be an integer of 1, 2, 3, 4, 5 or more.
[0454] exist Figure 14 In , c can be located outside the reference pixel and the current block.
[0455] As an example, c can be located on the boundary line of the current block (in this example, right and bottom). For example, c can be located from (width, 0) to (width, height) on the right boundary of the current block or from (0, height) to (width, height) on the bottom boundary of the current block.
[0456] For example, c can be located in odd or even columns and rows of the current block. For example, c can be located in an even row outside the right boundary of the current block, or in an odd column outside the bottom boundary of the current block. Here, c can be located in addition to being odd or even and in addition to being in the same column as k or the index (2 k ), and k can be an integer of 1, 2, 3, 4, 5 or more.
[0457] The number of arbitrary pixels used for / referenced for intra prediction of the current block may be m, and m may be 1, 2, 3, 4, or greater. Alternatively, the number of arbitrary pixels may be set based on the size (width or height) of the current block. For example, the number of arbitrary pixels used for intra prediction may be width / w_factor, height / h_factor, or (width / h_factor). Here, w_factor and h_factor may be predetermined values used as a division value based on the width and height of each block, and may be integers such as 1, 2, 4, and 8. Here, wh_factor may be a predetermined value used as a division value based on the size of the block, and may be an integer such as 2, 4, 8, 16, etc.
[0458] Furthermore, the number of arbitrary pixels may be determined based on all or some of the coding elements such as picture type, component type, block attributes, and intra prediction mode.
[0459] Any pixel obtained through the above process can be obtained from an area where a corresponding pixel value can be referenced. For example, a pixel value can be obtained based on a reference pixel located in a horizontal or vertical direction of the arbitrary pixel.
[0460] In this case, the pixel value of any pixel can be taken as the pixel value of the pixel by using the pixel value located at ( <1> Horizontal direction / <2> The value is obtained by replicating or weighted averaging one or more pixels (k, k is an integer such as 1, 2, 3, 4, 5, 6) in the vertical direction. <1> Horizontal direction / <2> vertical direction), you can use / reference any pixel with the same or similar ( <1> y component / <2> x component) to obtain the pixel value. However, in a broad sense, the pixel located in the current block ( <1> Left direction / <2> The reference pixels in the upward direction can be used to obtain the pixel value of any pixel.
[0461] Pixel values may be obtained based on the horizontal direction or the vertical direction, or may be obtained based on both directions. In this case, the pixel value acquisition setting may be determined based on various encoding elements (described in the above examples, such as image type and block attributes).
[0462] For example, when the current block has a rectangular shape with a width greater than a height, the pixel value of an arbitrary pixel may be obtained based on the reference pixels located in the vertical direction. Alternatively, when the primary pixel value is obtained based on each of the reference pixels located in the vertical and horizontal directions, the secondary pixel value (i.e., the pixel value of the arbitrary pixel) may be obtained by further applying weight to the primary pixel value obtained in the vertical direction rather than the primary pixel value obtained in the horizontal direction.
[0463] Alternatively, when the current block has a rectangular shape with a height greater than a width, the pixel value of an arbitrary pixel may be obtained based on the reference pixels located in the horizontal direction. Alternatively, when the primary pixel value is obtained based on each of the reference pixels located in the vertical and horizontal directions, the secondary pixel value (i.e., the pixel value of the arbitrary pixel) may be obtained by further weighting the primary pixel value obtained in the horizontal direction rather than the primary pixel value obtained in the vertical direction. Of course, without being limited to the above example, an opposite configuration is also possible.
[0464] In addition, a predetermined candidate list can be configured, and the pixel value of any pixel can be obtained by selecting at least one of them. It can be notified in one of the units such as CTU, coding block, prediction block and transform block. In this case, the candidate list can be configured with a predetermined value, or can be configured based on the above-mentioned reference pixels adjacent to the current block. In this case, the number of candidate lists can be 2, 3, 4, 5 or a larger integer. Alternatively, the number of candidate lists can be an integer between 10 and 20, an integer between 20 and 40, or an integer between 10 and 40.
[0465] Here, in the candidate list, pixel values can be configured as candidates, or equations for deriving pixel values, feature values, etc. can be configured as candidates. In the latter case, various pixel values can be derived in units of arbitrary pixels based on equations for obtaining the position (x coordinate or y coordinate) and pixel value or feature value of an arbitrary pixel.
[0466] As described above, one or more arbitrary pixels can be obtained, and intra prediction can be performed based on them. Below, for ease of explanation, it is assumed that the number of arbitrary pixels is 1. However, it is obvious that even if two or more arbitrary pixels are obtained, the examples described later can be extended to the same or similar cases.
[0467] Reference Figure 13 , the sub-region can be divided into a plurality of sub-regions based on arbitrary pixels (SB10).
[0468] Here, the sub-regions may be divided based on horizontal lines or vertical lines including arbitrary pixels, and the number of sub-regions may be 2, 3, 4, or a greater integer. The configuration of the sub-regions will be described with reference to the following drawings.
[0469] Figure 15 FIG. 1 is an exemplary diagram of a method of dividing an arbitrary pixel into a plurality of sub-regions as an embodiment to which the present invention is applied.
[0470] Reference Figure 15 , the predetermined sub-region (b, c) which is a vertical line or a horizontal line of an arbitrary pixel d can be obtained, and the predetermined sub-region (a) can be obtained based on the vertical line and the horizontal line.
[0471] In this case, subregion (b) can be obtained between an arbitrary pixel and a pixel T that can be referenced in the vertical direction, and subregion (c) can be obtained between an arbitrary pixel and a pixel L that can be referenced in the horizontal direction. In this case, subregions b and c may not always appear in a fixed manner, and depending on arbitrary pixel-related settings of the current block (for example, whether b or c is also an arbitrary pixel, etc.), only one of the two subregions may appear. If only one of subregions b and c appears, subregion a may not appear.
[0472] like Figure 15 As shown, T or L can refer to a reference pixel adjacent to the current block. Alternatively, T or L can refer to any pixel (e, f) that is different from d and located in the vertical or horizontal direction of any pixel (d). This means that any pixel d can also be the T or L of any other pixel.
[0473] As in the above examples, the size of the sub-region may be determined based on the number and arrangement of any pixels in the current block.
[0474] For example, when two or more arbitrary pixels exist and are located at the interval of one slit, each of the sub-regions a, b, and c may have a size of 1×1. Alternatively, when one arbitrary pixel exists and is located Figure 14 When the sub-regions a, b and c are at c, they may have sizes of (width×height), (1×height) and (width×1), respectively.
[0475] Reference Figure 13 , intra prediction may be performed according to a predetermined order (SB20).
[0476] Here, according to the position of an arbitrary pixel, some sub-regions may be used as prediction values for intra prediction or may be used as temporary reference values for intra prediction.
[0477] For example, when any pixel (or sub-region d) is located Figure 14 When the pixel is located at c, sub-regions b and c are located outside the current block, and only sub-region a can be the target of intra prediction. Alternatively, when any pixel is located at Figure 14 When the sub-region b is located outside the current block, the sub-regions a and c can be the targets of intra prediction. Alternatively, when any pixel is located above c, the sub-region b is located outside the current block, and the sub-regions a and c can be the targets of intra prediction. Figure 14 When the subregion c is located to the left of c, the subregion c is located outside the current block, and the subregions a and b can be targets of intra prediction. Alternatively, when any pixel is located inside the current block, the subregions a, b, and c can be targets of intra prediction.
[0478] As in the above examples, depending on the position of an arbitrary pixel, it may be a target of intra prediction or may be used as a temporary reference value.
[0479] The following description assumes a case where an arbitrary pixel is located inside the current block, but even if a position change occurs, the following examples can be applied and understood in the same or similar manner.
[0480] Since the position and pixel value of any pixel are obtained through the previous steps, each sub-region acquisition process can be performed according to the predetermined priority among the sub-regions a, b, and c. For example, the pixel value of each sub-region can be obtained in the order of b→c or c→b, and the pixel value of sub-region a can be obtained.
[0481] In the case of the sub-region b, a pixel value can be obtained based on an arbitrary pixel d or T. In the case of the sub-region c, a pixel value can be obtained based on an arbitrary pixel d or L.
[0482] Although not shown in the figure, it is assumed that the upper left pixel is TL (i.e., the intersection of the horizontal line of T and the vertical line of L). When TL and T are located above the current block, the pixels between TL and T can be referenced. In addition, when TL and L are located on the left side of the current block, the pixels between TL and L can be referenced. This is because the referenceable pixels belong to blocks adjacent to the current block.
[0483] On the other hand, when at least one of TL or T is located within the current block, reference can be made to pixels between TL and T. In addition, when at least one of TL or L is located within the current block, reference can be made to pixels between TL and L. This is because a reference pixel can be a sub-region obtained based on another arbitrary pixel.
[0484] Therefore, in the case of sub-region a, pixel values can be obtained based on sub-regions b and c, the reference area between TL and T, and the reference area between TL and L. Of course, TL, T, L, and d can be used to obtain the pixel value of sub-region a. Here, this means that any pixel can also be referenced.
[0485] Through the above process, intra prediction of the current block can be performed based on any pixel.
[0486] Performing intra prediction based on arbitrary pixels may be configured as one of the intra prediction modes, or may be included as a replacement for an existing mode.
[0487] Alternatively, it can be classified as a candidate for a prediction method, and selection information for the prediction method can be generated. For example, it can be considered as an additional prediction method to the method of performing intra prediction based on a directional mode or a non-directional mode. The selection information can be notified in a CTU, coding block, prediction block, transform block, etc.
[0488] At any pixel position, Figure 14 The following is described under the assumption of c. However, the present invention is not limited thereto, and the contents described below can be applied in the same or similar manner even if arranged in different positions. Figure 12 Provide a description.
[0489] Although the current block and the right and lower blocks of the current block are not encoded, they can be estimated based on data of the referenceable area.
[0490] For example, data may be copied or derived from Ref_TR, Ref_BL, etc., which are areas adjacent to the right and lower boundaries of the current block, and then the right or lower boundary of the current block may be filled with the data. For example, the right boundary may be filled by copying one of the pixels such as T3, TR0, and TR1 as is, or by using a value obtained by applying filtering to T3, TR0, and TR1.
[0491] Alternatively, data may be copied or derived from Ref_TL, Ref_T, Ref_L, Ref_TR, Ref_BL, etc., which are regions adjacent to the current block, and the lower right boundary of the current block may be filled with the data. For example, the lower right boundary of the current block may be filled with a value obtained based on one or more pixels in the adjacent region.
[0492] Here, the right boundary of the current block can be (d~p) or (R0~R3). The lower boundary of the current block can be (m~p) or (B0~B3). The lower right boundary of the current block can be one of p, BR, R3 and B3.
[0493] In the following example, it is assumed that the right boundaries are R0 to R3, the lower boundaries are B0 to B3, and the lower right boundary is BR.
[0494] (Processing of right and bottom boundaries)
[0495] For example, the right boundary may be filled by copying one of T3, TR0, and TR1 adjacent to the vertical direction, and the lower boundary may be filled by copying one of L3, BL0, and BL1 adjacent to the horizontal direction.
[0496] Alternatively, the right boundary may be filled with a weighted average of T3, TR0, and TR1 adjacent to the vertical direction, and the lower boundary may be filled with a weighted average of L3, BL0, and BL1 adjacent to the horizontal direction.
[0497] After obtaining the values of the right boundary and the lower boundary, intra prediction of the current block may be performed based on these values.
[0498] (Processing of the lower right border)
[0499] For example, the lower right border may be filled by copying one of T3, TR0, TR1, L3, BL0, and BL1. Alternatively, the lower right border may be filled with a weighted average of one of T3, TR0, and TR1 and one of L3, BL0, and BL1. Alternatively, the lower right border may be filled with a weighted average of T3, TR0, and TR1 and one of L3, BL0, and BL1. Alternatively, the lower right border may be filled with a first weighted average of T3, TR0, and TR1 and a second weighted average of the first weighted average of L3, BL0, and BL1.
[0500] After obtaining the value of the lower right boundary, the value of the right boundary or the lower boundary may be obtained based on the value, and intra prediction of the current block may be performed based on the right boundary or the lower boundary.
[0501] The description of the lower right boundary processing is continued below.
[0502] Assume that the configuration of the positions of TL, TR0, BL0, and BR is considered. Here, BR may represent a pixel at the lower right boundary, TR0 may be a reference pixel located in the vertical direction of BR, BL0 may be a reference pixel located in the horizontal direction of BR, and TL may be a reference pixel located at the upper left boundary of the current block or at the intersection between the horizontal direction of TR0 and the vertical direction of BL0.
[0503] Based on the pixel positions, the directionality and feature information (eg, edges, etc.) of the current block can be estimated.
[0504] As an example <1> , when moving diagonally from TL to BR, the pixel value can gradually increase or decrease. In this case, if TL is greater than or equal to TR0 and BL0, then BR can be less than or equal to TR0 and BL0. Alternatively, it can be the opposite configuration.
[0505] As an example <2> , when moving diagonally from BL0 to TR0, the pixel value can gradually increase or decrease. In this case, if BL0 is greater than or equal to TL and BR, TR0 can be less than or equal to TL and BR. Alternatively, the configuration can be the opposite.
[0506] As an example <3> , when moving from left (TL, BL0) to right (TR0, BR) in the horizontal direction, the pixel value can gradually increase or decrease. In this case, if TL is greater than or equal to TR0, BL0 can be greater than or equal to BR. Alternatively, the configuration can be the opposite.
[0507] As an example <4> , when moving from top (TL, TR0) to bottom (BL0, BR) in the vertical direction, the pixel value can be displayed or decreased gradually. In this case, if TL is greater than or equal to BL0, TR0 can be greater than or equal to BR. Alternatively, the configuration can be the opposite.
[0508] If the image feature as in the above example exists in the current block, this predicted lower right boundary can be used. In this case, the pixels located in the vertical direction or horizontal direction of the estimated target pixel and the pixels that are the intersection points of each pixel in the vertical direction or horizontal direction may be required, and the estimated target pixel can be predicted based on the comparison of their pixel values.
[0509] <1> Example: When TL<=TR0 and TL<=BL0, the BR value can be derived (predicted) based on the difference between pixels by estimating that there is a trend of increasing from TL to BR.
[0510] For example, the BR pixel value may be obtained by adding the value of (BL0-TL) to TR0 or by adding the value of (TR0-TL) to BL0. Alternatively, the BR pixel value may be obtained by averaging or weighted averaging the two values.
[0511] <2> Example: When TL>=BL0 and TL<=TR0, the BR value can be derived based on the difference between pixels by estimating that there is a trend of increasing from BL0 to TR0.
[0512] For example, the BR pixel value may be derived by subtracting the (TL-BL0) value from TR0 or by adding the (TR0-TL) value to BL0. Alternatively, the BR pixel value may be derived by averaging or weighted averaging the two values.
[0513] The above examples describe the case of predicting the BR of an arbitrary pixel by estimating the characteristics of the block based on predetermined pixels adjacent to the current block. However, due to the limited number of pixels, it can be difficult to accurately grasp the characteristics of the block. For example, if impulse components exist in some of the pixels used to derive the BR, it can be difficult to accurately grasp the characteristics.
[0514] To this end, characteristic information (e.g., variance, standard deviation, etc.) of the upper and left regions of the current block may be calculated. For example, if it is determined that characteristic information of pixels between TL and TR0 or characteristic information of pixels between TL and BL0 well reflects the increase or decrease of the block, a method for deriving the value of an arbitrary pixel, such as BR, based on predetermined pixels of the current block, such as TL, TR0, BL0, etc., may be used.
[0515] The various embodiments of the present disclosure are not intended to be all-inclusive and are intended to illustrate representative aspects of the present disclosure, and the features described in the various embodiments may be applied independently or in combinations of two or more.
[0516] In addition, various embodiments of the present disclosure may be implemented by hardware, firmware, software, or a combination thereof. In the case of hardware implementation, the hardware may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), general purpose processors, controllers, microcontrollers, microprocessors, and the like.
[0517] The scope of the present disclosure includes: software or machine-executable instructions (e.g., operating systems, applications, firmware, programs, etc.) that enable operations of methods according to various embodiments to be performed on a device or computer; and non-transitory computer-readable media having such software or instructions stored therein that can be executed on a device or computer.
[0518] Industrial Applicability
[0519] The present invention can be used to encode / decode video signals.
Claims
1. A method for decoding an image, comprising: Determining a reference pixel line from a plurality of pixel lines adjacent to a current luminance block; Determining an intra prediction mode for the current luminance block; as well as determining a prediction block for the current luminance block based on the reference pixel line and the intra prediction mode of the current luminance block, selecting one of a first mode group or a second mode group based on a first flag, the first mode group including only prediction modes based on inter-component references, the second mode group including 67 intra prediction modes predefined in a decoding device, the 67 intra prediction modes consisting of 2 non-directional modes and 65 directional modes, and the first flag specifying whether the intra prediction mode of a current chroma block belongs to the first mode group or the second mode group; deriving the intra prediction mode of the current chroma block from the selected mode group; determining a prediction block for the current chroma block based on the intra prediction mode of the current chroma block, and wherein the second mode group includes an intra prediction mode of the current luminance block corresponding to the current chrominance block, wherein, when the intra prediction mode of the current chroma block is derived from the first mode group, the current chroma block is predicted by the current luminance block corresponding to the current chroma block, and The second mode group includes an intra-frame prediction mode of the current luminance block corresponding to the current chrominance block.
2. The method according to claim 1, wherein In response to selection of the intra prediction mode of the current chroma block being derived from the second mode group, the intra prediction mode of the current chroma block is determined based on the intra prediction mode of the current luma block.
3. The method according to claim 1, wherein The reference pixel line of the current luminance block is determined based on index information signaled from the encoding device and a plurality of reference pixel line candidates, wherein the index information specifies one of the plurality of reference pixel line candidates, and The multiple reference pixel line candidates include at least one of a first pixel line adjacent to the current luminance block, a second pixel line adjacent to the first pixel line, or a third pixel line adjacent to the second pixel line.
4. The method according to claim 1, wherein When the intra prediction mode of the current luminance block is a planar mode, the current luminance block is predicted using only a first pixel line adjacent to the current luminance block.
5. A method for encoding an image, comprising: Determining a reference pixel line from a plurality of pixel lines adjacent to a current luminance block; Determining an intra prediction mode for the current luminance block; Obtaining a prediction block of the current luminance block based on the intra prediction mode of the current luminance block; as well as encoding the current luminance block based on the prediction block of the current luminance block to generate a bitstream; Determining an intra prediction mode for a current chroma block; Obtaining a prediction block of the current chroma block based on the intra prediction mode of the current chroma block; as well as encoding the current chroma block based on the prediction block of the current chroma block to generate the bitstream, wherein the intra prediction mode of the current chroma block belongs to one of a first mode group and a second mode group, the first mode group includes only prediction modes based on inter-component references, and the second mode group includes 67 intra prediction modes predefined in the encoding device, the 67 intra prediction modes consisting of 2 non-directional modes and 65 directional modes, and wherein a first flag for specifying whether the intra prediction mode of the current chroma block belongs to the first mode group or the second mode group is encoded and included in the bitstream, and wherein the second mode group includes an intra prediction mode of the current luminance block corresponding to the current chrominance block, wherein, when the intra prediction mode of the current chroma block is derived from the first mode group, the current chroma block is predicted by the current luminance block corresponding to the current chroma block, and The second mode group includes an intra-frame prediction mode of the current luminance block corresponding to the current chrominance block.
6. A bit stream transmission method for transmitting a bit stream, comprising: generating the bitstream by encoding the image based on an image encoding method; as well as transmitting the bitstream, and The image encoding method includes: Determining a reference pixel line from a plurality of pixel lines adjacent to a current luminance block; Determining an intra prediction mode for the current luminance block; Obtaining a prediction block of the current luminance block based on the intra prediction mode of the current luminance block; and encoding the current luminance block based on the prediction block of the current luminance block to generate a bitstream; Determining an intra prediction mode for a current chroma block; Obtaining a prediction block of the current chroma block based on the intra prediction mode of the current chroma block; and encoding the current chroma block based on the prediction block of the current chroma block to generate the bitstream, wherein the intra prediction mode of the current chroma block belongs to one of a first mode group and a second mode group, the first mode group includes only prediction modes based on inter-component references, and the second mode group includes 67 intra prediction modes predefined in the encoding device, the 67 intra prediction modes consisting of 2 non-directional modes and 65 directional modes, and wherein a first flag for specifying whether the intra prediction mode of the current chroma block belongs to the first mode group or the second mode group is encoded and included in the bitstream, and wherein the second mode group includes an intra prediction mode of the current luminance block corresponding to the current chrominance block, wherein, when the intra prediction mode of the current chroma block is derived from the first mode group, the current chroma block is predicted by the current luminance block corresponding to the current chroma block, and The second mode group includes an intra-frame prediction mode of the current luminance block corresponding to the current chrominance block.