Encoding method, encoding device, decoding method and decoding device
By determining the intra prediction direction according to the block shape and adopting multiple prediction modes, the efficiency and accuracy of video coding are improved, and the problems of intra prediction accuracy and data rate limitation in the existing technology are solved.
Patent Information
- Application Number
- CN202411060548.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2018-12-07
- Filing Date
- 2019-08-26
- Publication Date
- 2024-10-11
AI Technical Summary
When existing video coding methods improve intra-frame prediction accuracy, coding information increases, resulting in data rate limitations, and the prediction accuracy of non-square blocks decreases, affecting coding efficiency.
Determine the intra prediction direction by determining the shape of the block, use the most suitable direction among multiple prediction direction candidate groups for intra prediction, including the processing of square and non-square blocks, use bidirectional prediction and multi-reference line intra prediction mode to Improve forecast accuracy.
It improves the accuracy of intra-frame prediction and video coding efficiency, reduces the size of coding information, adapts to the characteristics of blocks of different shapes, and enhances data compression capabilities.
Smart Images

Figure CN118764618A_ABST
Abstract
Description
[0001] This application is a divisional application of the PCT invention patent application with the application date of August 26, 2019, application number 201980070585.5, and invention name "Encoding method and encoding device and decoding method and decoding device". Technical Field
[0002] The present disclosure relates to a video encoding method and a video decoding method, and more particularly, to a method of efficiently encoding and decoding a video according to an intra-frame prediction method. Background Art
[0003] High quality video requires a large amount of data to encode. However, there are limitations on the bandwidth available to transmit video data, thus limiting the data rate to be applied to the transmission of video data. Therefore, in order to efficiently transmit video data, video data encoding and decoding methods with minimal image quality degradation and increased compression ratio are needed.
[0004] Video data can be compressed by removing spatial and temporal redundancy between pixels. Pixels adjacent to each other generally have common characteristics, so in order to remove redundancy between adjacent pixels, encoded information is transmitted in data units consisting of pixels.
[0005] The pixel value of the pixel included in the data unit is not directly transmitted, and the method required for obtaining the pixel value is transmitted. A prediction method for predicting a pixel value similar to the original value is determined for each data unit, and encoding information about the prediction method is transmitted from the encoder to the decoder. In addition, because the predicted value is not completely equal to the original value, residual data of the difference between the original value and the predicted value is transmitted from the encoder to the decoder.
[0006] As the prediction accuracy increases, the coding information required to specify the prediction method increases, but the size of the residual data decreases. Therefore, the prediction method is determined based on the coding information and the size of the residual data. In particular, the data units segmented from the picture have various sizes, and as the size of the data unit increases, the possibility of reduced prediction accuracy increases, while the coding information decreases. Therefore, the size of the block is determined according to the characteristics of the picture.
[0007] In addition, prediction methods include intra prediction and inter prediction. Intra prediction refers to a method of predicting pixels of a block from adjacent pixels of the block. Inter prediction refers to a method of predicting pixels by referring to pixels of another picture, the pixels of which are referenced by the picture including the block. Therefore, spatial redundancy is removed according to intra prediction, and temporal redundancy is removed according to inter prediction.
[0008] As the number of prediction methods increases, the size of encoding information indicating the prediction method increases. Therefore, the size of encoding information to be applied to the block can be reduced by predicting the encoding information from another block.
[0009] The loss of video data is allowed to the extent that the loss is not perceptible to the human eye, and therefore the amount of residual data can be reduced by performing lossy compression on the residual data during the transform and quantization processes. Summary of the invention
[0010] Technical issues
[0011] A video encoding method and a video encoding device for performing video encoding according to an intra-frame prediction method for blocks are provided. A video decoding method and a video decoding device for performing video decoding according to an intra-frame prediction method for blocks are also provided. A computer-readable recording medium is also provided, on which a program for executing the video encoding method and the video decoding method according to an embodiment of the present disclosure on a computer is recorded.
[0012] Solution to the problem
[0013] In the present disclosure, a video decoding method may include: obtaining intra-frame prediction mode information indicating an intra-frame prediction mode of a current block; determining an intra-frame prediction direction indicated by the intra-frame prediction mode information according to the shape of the current block; predicting the current block by intra-frame prediction of the current block in the intra-frame prediction direction; and reconstructing the current block according to the prediction result about the current block; wherein determining the intra-frame prediction direction of the current block includes: when the current block has a square shape, determining the intra-frame prediction direction of the current block from a first intra-frame prediction direction candidate determined according to the square shape; and when the current block has a non-square shape, determining the intra-frame prediction direction of the current block from a second intra-frame prediction direction candidate determined according to a width and a height of the non-square current block; and wherein the first intra-frame prediction direction candidate and the second intra-frame prediction direction candidate are determined from an intra-frame prediction direction candidate group including multiple prediction directions.
[0014] In the present disclosure, a video decoding device may include: a memory storing at least one instruction for performing video decoding; and a processor configured to execute the at least one instruction, wherein the processor is further configured to: obtain intra-frame prediction mode information indicating an intra-frame prediction mode of a current block, determine an intra-frame prediction direction indicated by the intra-frame prediction mode information according to a shape of the current block, predict the current block by intra-frame prediction on the current block in the intra-frame prediction direction, and reconstruct the current block according to the prediction result about the current block, and wherein, when the current block has a square shape, the intra-frame prediction mode of the current block is determined from a first intra-frame prediction direction candidate determined according to the square shape, wherein when the current block has a non-square shape, the intra-frame prediction direction of the current block is determined from a second intra-frame prediction direction candidate determined according to a width and a height of the non-square current block, and wherein the first intra-frame prediction direction candidate and the second intra-frame prediction direction candidate are determined from an intra-frame prediction direction candidate group including a plurality of prediction directions.
[0015] In the present disclosure, a video encoding method may include: determining an intra-frame prediction direction to be used in the prediction of a current block from multiple intra-frame prediction directions; determining intra-frame prediction mode information indicating the intra-frame prediction mode of the current block according to the shape of the current block and the intra-frame prediction direction; and outputting a bit stream including the intra-frame prediction mode information, wherein determining the intra-frame prediction mode information of the current block includes: when the current block has a square shape, determining the intra-frame prediction mode information from a first intra-frame prediction direction candidate determined according to the square shape; and when the current block has a non-square shape, determining the intra-frame prediction mode information of the current block from a second intra-frame prediction direction candidate determined according to a width and a height of the non-square current block; and wherein the first intra-frame prediction direction candidate and the second intra-frame prediction direction candidate are determined from an intra-frame prediction direction candidate group including multiple prediction directions.
[0016] In the present disclosure, a video encoding device may include: a memory storing at least one instruction for performing video encoding; and a processor configured to execute the at least one instruction, wherein the processor is also configured to respond to the at least one instruction: determine an intra-frame prediction direction to be used in the prediction of a current block from a plurality of intra-frame prediction directions; determine intra-frame prediction mode information indicating the intra-frame prediction mode of the current block according to the shape of the current block and the intra-frame prediction direction; and output a bit stream including the intra-frame prediction mode information, wherein when the current block has a square shape, the intra-frame prediction mode information of the current block is determined from a first intra-frame prediction direction candidate determined according to the square shape; wherein when the current block has a non-square shape, the intra-frame prediction mode information of the current block is determined from a second intra-frame prediction direction candidate determined according to a width and a height of the non-square current block; and wherein the first intra-frame prediction direction candidate and the second intra-frame prediction direction candidate are determined from an intra-frame prediction direction candidate group including a plurality of prediction directions.
[0017] In the present disclosure, a video decoding method may include: determining an intra-frame prediction direction of a current block; determining whether bidirectional prediction is allowed for the current block; when the bidirectional prediction is allowed for the current block, determining a bidirectional prediction area in the current block for which the bidirectional prediction is allowed; determining a first median prediction value of a current sample in the intra-frame prediction direction of the current block, and determining a second median prediction value of the current sample in an opposite direction of the intra-frame prediction direction of the current block; determining a prediction value of the current sample based on a weighted average of the first median prediction value and the second median prediction value; and reconstructing the current block based on the prediction value of the current sample, wherein the current sample is included in the bidirectional prediction area.
[0018] In the present disclosure, a video decoding method may include: determining whether to apply a multi-reference line intra-frame prediction mode to a current block; when the multi-reference line intra-frame prediction mode is to be applied to the current block, determining multiple line reference areas adjacent to the current block; obtaining reference area index information indicating line reference areas among the multiple line reference areas to be used in the prediction of the current block; predicting the current block based on reference samples of the line reference areas indicated by the reference area index information; and reconstructing the current block based on the result of predicting the current block; wherein the multiple line reference areas are divided according to the distance from the current block.
[0019] In the present disclosure, a video decoding method may include: determining whether to apply a multi-reference line intra-frame prediction mode to a current block; when the multi-reference line intra-frame prediction mode is to be applied to the current block, determining a weighted average line reference area based on multiple line reference areas located adjacent to the current block; performing intra-frame prediction on the current block based on the weighted average line reference area; and reconstructing the current block based on the result of predicting the current block, wherein the weighted average line reference area is determined based on a weighted average of sample values of reference samples of the multiple line reference areas.
[0020] In the present disclosure, a video decoding method may include: determining a reference area including multiple line reference areas adjacent to a current block; determining a gradient between reference samples of the line reference area by scanning the reference area in horizontal and vertical directions; determining an angular intra-frame prediction mode of the current block according to the gradient; predicting the current block according to the angular intra-frame prediction mode; and reconstructing the current block according to a result of predicting the current block.
[0021] In the present disclosure, a video decoding method may include: determining whether to apply a linear model (LM) chroma mode to a current chroma block; when the LM chroma mode is to be applied to the current chroma block, determining an LM chroma reference area adjacent to the current chroma block and a current luminance block located at the same position as the current chroma block; determining a plurality of luminance-chroma pairs from reference samples of the current chroma block and reference samples of the current luminance block; determining a luminance-chroma linear model indicating a correlation between luminance samples and chroma samples in the LM chroma reference area from the plurality of luminance-chroma pairs; predicting chroma samples of the current chroma block from luminance samples of the current luminance block according to the luminance-chroma linear model; and reconstructing the current block according to the result of predicting the current chroma block.
[0022] The present disclosure provides a computer recordable recording medium having recorded thereon a program for executing a video encoding method and a video decoding method.
[0023] The technical problems of the present embodiment are not limited to the above-mentioned technical problems, and other unexplained technical problems can be inferred from the following embodiments.
[0024] The beneficial effects of disclosure
[0025] According to the intra-frame prediction method provided in the present disclosure, the accuracy of the intra-frame prediction method is enhanced, thereby improving the video encoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1A is a block diagram of an image encoding apparatus based on coding units having a tree structure according to an embodiment of the present disclosure.
[0027] Figure 1B is a block diagram of an image decoding apparatus based on coding units having a tree structure according to an embodiment.
[0028] Figure 2 A process of determining at least one coding unit by splitting a current coding unit according to an embodiment is illustrated.
[0029] Figure 3 A process of determining at least one coding unit by splitting a non-square coding unit according to an embodiment is illustrated.
[0030] Figure 4 A process of splitting a coding unit based on at least one of block shape information and partition shape information according to an embodiment is illustrated.
[0031] Figure 5 A method of determining a predetermined coding unit from among an odd number of coding units according to an embodiment is illustrated.
[0032] Figure 6 An order in which a plurality of coding units are processed when a plurality of coding units are determined by splitting a current coding unit according to an embodiment is illustrated.
[0033] Figure 7 A process of determining to split a current coding unit into an odd number of coding units when coding units cannot be processed in a predetermined order according to an embodiment is illustrated.
[0034] Figure 8 A process of determining at least one coding unit by splitting a first coding unit according to an embodiment is illustrated.
[0035] Fig. 9 It is shown that shapes into which the second coding unit can be divided are restricted when a non-square second coding unit determined by dividing the first coding unit satisfies a preset condition according to an embodiment.
[0036] Fig.10 A process of splitting a square coding unit when the split shape information cannot indicate that the square coding unit is split into four square coding units according to an embodiment is illustrated.
[0037] Fig.11 It is shown that a processing order among a plurality of coding units may be changed according to a process of splitting the coding units according to an embodiment.
[0038] Fig.12 A process of determining a depth of a coding unit as a shape and a size of the coding unit are changed when a coding unit is recursively split so that a plurality of coding units are determined according to an embodiment is illustrated.
[0039] Fig.13Detailed description is given of a depth that may be determined based on a shape and a size of a coding unit according to an embodiment, and a part index (PID) for identifying a coding unit.
[0040] Fig.14 It is shown that a plurality of coding units are determined based on a plurality of preset data units included in a picture according to an embodiment.
[0041] Fig.15 A processing block serving as a unit for determining an order of determining reference coding units included in a picture according to an embodiment is shown.
[0042] Fig.16 is a block diagram of a video decoding apparatus 1600 for performing video decoding according to a block intra prediction method.
[0043] Fig.17 35 intra prediction modes according to an embodiment are shown.
[0044] Fig.18 95 intra prediction modes according to another embodiment are shown.
[0045] Fig.19A and Fig.19B An embodiment of intra prediction mode to be applied to non-square shapes is shown.
[0046] Fig. 20 The present invention is a flowchart of an embodiment of a method for determining an intra prediction direction candidate to be applied to a current block from among first intra prediction direction candidates and second intra prediction direction candidates.
[0047] Fig.21 An angular intra prediction mode included in the default intra prediction mode is shown.
[0048] Fig. 22 is a diagram for describing a method of determining a Most Probable Mode (MPM) of a non-square block according to an embodiment.
[0049] Fig.23 An embodiment of determining weights of reference samples when bidirectional prediction is applied to a current block is shown.
[0050] Fig.24 An embodiment of an intra prediction method according to a multi-reference line intra prediction mode is shown.
[0051] Fig.25 is a diagram for describing an intra prediction method according to a linear model (LM) chroma mode.
[0052] Fig.26 A method of predicting a current block according to a Position Dependent Intra Prediction Combination (PDPC) mode is shown.
[0053] Fig. 27 A flowchart of a video decoding method for determining an intra prediction direction of a current block according to a shape of the current block and intra prediction mode information according to an embodiment is shown.
[0054] Fig.28 A block diagram of a video encoding apparatus that performs video encoding according to a block intra prediction method is shown.
[0055] Fig.29 A flowchart of a video encoding method for determining intra-prediction mode information of a current block according to a shape and an intra-prediction direction of the current block according to an embodiment is shown. DETAILED DESCRIPTION
[0056] In the present disclosure, a video decoding method may include: obtaining intra-frame prediction mode information indicating an intra-frame prediction mode of a current block; determining an intra-frame prediction direction indicated by the intra-frame prediction mode information according to the shape of the current block; predicting the current block by intra-frame prediction on the current block in the intra-frame prediction direction; and reconstructing the current block according to the prediction result about the current block, wherein determining the intra-frame prediction direction of the current block includes: when the current block has a square shape, determining the intra-frame prediction direction of the current block from a first intra-frame prediction direction candidate determined according to the square shape, and when the current block has a non-square shape, determining the intra-frame prediction direction of the current block from a second intra-frame prediction direction candidate determined according to a width and a height of the non-square current block, and wherein the first intra-frame prediction direction candidate and the second intra-frame prediction direction candidate are determined from an intra-frame prediction direction candidate group including multiple prediction directions.
[0057] Disclosed Embodiments
[0058] By referring to the embodiments and the accompanying drawings, the advantages and features of the embodiments and the methods for achieving them can be more easily understood. In this regard, the present disclosure may have different forms and should not be interpreted as being limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be thorough and complete, and the concepts of the present disclosure will be fully conveyed to those of ordinary skill in the art.
[0059] Terms used in the specification will be briefly defined, and embodiments will be described in detail.
[0060] All terms used in the specification, including descriptive or technical terms, should be interpreted as having meanings that are obvious to those of ordinary skill in the art. However, these terms may have different meanings depending on the intentions of those of ordinary skill in the art, precedents, or the emergence of new technologies. In addition, the applicant may arbitrarily select some terms, and in this case, the meaning of the selected terms will be described in detail in the detailed description of the present disclosure. Therefore, the terms used in the present disclosure should not be interpreted based solely on their names, but must be defined based on the meaning of the terms and the descriptions throughout the specification.
[0061] In the following description, a singular form includes a plural form unless the context clearly indicates otherwise.
[0062] When a part "includes" or "contains" an element, unless there is a specific description to the contrary, the part may further include other elements without excluding other elements. The term "unit" used herein refers to a software component or hardware component that performs certain tasks, such as a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC). However, "unit" is not limited to software or hardware. "Unit" can be formed to be located in an addressable storage medium, or can be formed to operate one or more processors. Therefore, for example, the term "unit" can refer to components such as software components, object-oriented software components, class components, and task components, and can include processes, functions, attributes, processes, subroutines, program code segments, drivers, firmware, microcodes, circuits, data, databases, data structures, tables, arrays, or variables. The functions provided by components and "units" can be associated with a smaller number of components and "units", or can be divided into additional components and "units".
[0063] The term "current block" refers to one of a coding unit, a prediction unit, and a transform unit to be currently encoded or decoded. For ease of description, when other types of blocks such as prediction units and transform units need to be distinguished from each other, "current coding block", "current prediction block", and "current transform block" may be used. In addition, the term "lower block" refers to a data unit segmented from a "current block". The term "upper block" refers to a data unit including a "current block".
[0064] In addition, the term "sample" used herein refers to data assigned to a sampling position of an image and to be processed. For example, a pixel value of an image in a spatial domain or a transform coefficient in a transform domain may be a sample. A unit including at least one sample may be defined as a block.
[0065] The present disclosure will now be described more fully with reference to the accompanying drawings so that those skilled in the art can carry out the present disclosure without difficulty. In addition, in order to clearly describe the present disclosure, parts irrelevant to the description of the present disclosure will be omitted in the accompanying drawings.
[0066] Figure 1A is a block diagram of an image encoding apparatus 100 based on coding units having a tree structure according to an embodiment of the present disclosure.
[0067] The image encoding apparatus 100 includes an encoder 110 and a bitstream generator 120 .
[0068] The encoder 110 may first divide a single picture into one or more slices or one or more tiles. The encoder 110 divides the picture or the slices or tiles included in the picture into multiple maximum coding units according to the size of the maximum coding unit. The maximum coding unit may be a data unit having a size of 32×32, 64×64, 128×128, 256×256, etc., wherein the shape of the data unit is a square shape having a width and length that are powers of 2. The encoder 110 may provide the bitstream generator 120 with maximum coding unit size information indicating the size of the maximum coding unit. The bitstream generator 120 may add the maximum coding unit size information to the bitstream.
[0069] The encoder 110 determines the coding unit by dividing the maximum coding unit. Whether to divide the coding unit is determined according to whether the rate-distortion optimization is efficient according to the division of the coding unit. Then, division information indicating whether to divide the coding unit can be generated. The division information can be represented in the form of a flag.
[0070] The coding unit can be split using various methods. For example, a square coding unit can be split into four square coding units whose width and height are half of the width and height of the square coding unit. A square coding unit can be split into two rectangular coding units whose width is half of the width of the square coding unit. A square coding unit can be split into two rectangular coding units whose height is half of the height of the square coding unit. A square coding unit can be split into three coding units by splitting its width or height in 1:2:1.
[0071] A rectangular coding unit whose width is twice the height may be split into two square coding units. A rectangular coding unit whose width is twice the height may be split into two rectangular coding units whose width is four times the height. A rectangular coding unit whose width is twice the height may be split into two rectangular coding units and one square coding unit by splitting the width in 1:2:1.
[0072] Similarly, a rectangular coding unit whose height is twice the width can be split into two square coding units. In addition, a rectangular coding unit whose height is twice the width can be split into two rectangular coding units whose height is four times the width. Similarly, a rectangular coding unit whose height is twice the width can be split into two rectangular coding units and one square coding unit by splitting its height in 1:2:1.
[0073] When the image encoding device 100 can use two or more partitioning methods, information about a partitioning method that can be used for a coding unit among the partitioning methods that can be used by the image encoding device 100 can be determined for each picture. Therefore, it can be determined that only a specific partitioning method will be used for each picture. When the image encoding device 100 uses only one partitioning method, information about a partitioning method that can be used for a coding unit is not separately determined.
[0074] A coding unit with a preset size may be split by using a specific splitting method. For example, when the size of the coding unit is 256×265, the coding unit may be set to be split into only four square units whose width and height are half of the width and height of the coding unit.
[0075] When the segmentation information of the coding unit indicates that the coding unit is segmented, segmentation shape information indicating the segmentation method of the coding unit may be generated. When only one segmentation method can be used in the picture to which the coding unit belongs, the segmentation shape information may not be generated. When the segmentation method is adaptively determined as encoding information around the coding unit, the segmentation shape information may not be generated.
[0076] As described above, the image data of the current picture is divided into maximum coding units according to the maximum size of the coding unit. Each maximum coding unit may include coding units hierarchically divided from the maximum coding unit. The shape and position of the lower coding unit may be determined according to the division shape of the upper coding unit. The minimum size of the coding unit that limits the division of the coding unit may be preset.
[0077] The encoder 110 compares the encoding efficiency when the coding unit is hierarchically divided with the encoding efficiency when the coding unit is not divided. Then, the encoder 110 determines whether to divide the coding unit according to the comparison result. When it is determined that dividing the coding unit is more efficient, the encoder 110 divides the coding unit hierarchically. When it is determined that it is efficient not to divide the coding unit according to the comparison result, the encoder 110 does not divide the coding unit. Whether to divide the coding unit can be determined regardless of whether the adjacent coding unit is divided.
[0078] The final segmented coding unit can be predicted by using intra prediction or inter prediction. Intra prediction refers to a method of predicting samples of a prediction unit by using reference samples around the prediction unit. Inter prediction refers to a method of predicting samples of a prediction unit by obtaining reference samples from a reference picture referenced by the current picture.
[0079] For intra prediction, the encoder 110 can select the most efficient intra prediction method by applying multiple intra prediction methods to the prediction unit. The intra prediction methods include a DC mode, a planar mode, and a directional mode such as a vertical mode, a horizontal mode, and the like.
[0080] When the reconstructed samples around the coding unit are used as reference samples, intra prediction can be performed for each prediction unit. However, when the reconstructed samples in the coding unit are used as reference samples, the reconstruction of the reference samples in the coding unit must precede the prediction, so the prediction order of the prediction unit may depend on the transformation order of the transformation unit. Therefore, when the reconstructed samples in the coding unit are used as reference samples, only the intra prediction method for the transformation unit corresponding to the prediction unit can be determined, and the actual intra prediction can be performed for each transformation unit.
[0081] The encoder 110 can select the most efficient inter-frame prediction method by determining the best motion vector and the best reference picture. For inter-frame prediction, the coding unit determiner 120 can determine multiple motion vector candidates from coding units that are spatially and temporally adjacent to the current coding unit, and can determine the most efficient motion vector from the motion vector candidates as the motion vector. Similarly, the encoder 110 can determine multiple reference picture candidates from coding units that are spatially and temporally adjacent to the current coding unit, and can determine the most efficient reference picture from the reference picture candidates. According to an embodiment, the reference picture can be determined from a reference picture list predetermined for the current picture. According to an embodiment, for the accuracy of prediction, the most efficient motion vector among multiple motion vector candidates can be determined as a predicted motion vector, and the motion vector can be determined by correcting the predicted motion vector. Inter-frame prediction can be performed in parallel for each prediction unit in the coding unit.
[0082] The encoder 110 can reconstruct the coding unit by obtaining only information indicating a motion vector and a reference picture according to a skip mode. According to the skip mode, all encoding information including a residual signal is skipped except for the information indicating a motion vector and a reference picture. Since the residual signal is skipped, the skip mode can be used when the accuracy of the prediction is very high.
[0083] The partition mode to be used may be limited according to the prediction method used for the prediction unit. For example, only the partition mode of the prediction unit of size 2N×2N or N×N may be applied to intra prediction, and the partition mode of the prediction unit of size 2N×2N, 2N×N, N×2N, or N×N may be applied to inter prediction. In addition, only the partition mode of the prediction unit of size 2N×2N may be applied to the skip mode of inter prediction. The partition mode allowed by each prediction method in the image encoding device 100 may vary according to the encoding efficiency.
[0084] The image encoding device 100 may perform transformation based on the coding unit. The image encoding device 100 may transform the residual data, which is the difference between the original value and the predicted value of the pixel included in the coding unit, through a preset process. For example, the image encoding device 100 may perform lossy compression on the residual data through quantization and discrete cosine transform (DCT) / discrete sine transform (DST). Alternatively, the image encoding device 100 may perform lossless compression on the residual data without quantization.
[0085] In summary, the encoder 110 determines the most efficient prediction method for the current coding unit from a plurality of intra prediction methods and inter prediction methods. Then, the encoder 110 determines the prediction method for the current coding unit according to the coding efficiency according to the prediction result. Similarly, the encoder 110 determines the transformation method according to the coding efficiency according to the transformation result. The coding efficiency of the coding unit is finally determined according to the most efficient coding unit prediction method and the transformation method determination scheme. The encoder 110 finalizes the hierarchical structure of the maximum coding unit according to the coding efficiency of the finally divided coding unit.
[0086] The encoder 110 may measure the encoding efficiency of a coding unit, the prediction efficiency of a prediction method, etc. by using rate-distortion optimization based on Lagrange multipliers.
[0087] The encoder 110 may generate partition information indicating whether to partition the coding unit according to the determined hierarchical structure of the maximum coding unit. Then, the encoder 110 may generate division mode information for determining the prediction unit and transformation unit partition information for determining the transformation unit for the partitioned coding unit. In addition, when the coding unit can be partitioned by using at least two partition methods, the encoder 110 may generate partition information and partition shape information indicating the partition method. The encoder 110 may generate information about the prediction method and the transformation method for the prediction unit and the transformation unit.
[0088] The bitstream generator 120 may output a plurality of pieces of information generated by the encoder 110 according to the hierarchical structure of the maximum coding units in a bitstream.
[0089] The following will refer to Figures 3 to 12 A method of determining a coding unit, a prediction unit, and a transformation unit according to a tree structure of a maximum coding unit according to an embodiment is described in detail.
[0090] Figure 1B is a block diagram of an image decoding apparatus 150 based on coding units having a tree structure according to an embodiment.
[0091] The image decoding device 150 includes a receiver 160 and a decoder 170 .
[0092] Definitions of terms including coding units, prediction units, transform units, various partition information, etc. used for the decoding operation performed by the image decoding device 150 are the same as those in the above reference. Figure 1A The definition is the same as that described for the image encoding device 100. In addition, since the image decoding device 150 is designed to reconstruct image data, various encoding methods used by the image encoding device 100 can be applied to the image decoding device 150.
[0093] The receiver 160 receives and parses a bitstream about the encoded video. The decoder 170 extracts a plurality of pieces of information for decoding the maximum coding unit from the parsed bitstream and provides the information to the decoder 170. The decoder 170 may extract information about the maximum size of the coding unit of the current picture from a header of the current picture, a sequence parameter set, or a picture parameter set.
[0094] In addition, the decoder 170 extracts partition information of the coding unit having a tree structure according to each maximum coding unit from the parsed bitstream. The extracted partition information is output to the decoder 170. The decoder 170 may determine the tree structure of the maximum coding unit by partitioning the maximum coding unit according to the extracted partition information.
[0095] The partition information extracted by the decoder 170 is partition information of a tree structure determined by the image encoding device 150 to cause the minimum encoding error. Therefore, the image decoding device 150 can reconstruct an image by decoding data according to the decoding method that causes the minimum encoding error.
[0096] The decoder 170 may extract partition information of a data unit such as a prediction unit and a transformation unit included in a coding unit. For example, the decoder 170 may extract information about the most efficient partitioning mode for the prediction unit. The decoder 170 may extract transformation partition information of the most efficient tree structure for the transformation unit.
[0097] In addition, the decoder 170 may obtain information about the most efficient prediction method for the prediction unit split from the coding unit. Then, the decoder 170 may obtain information about the most efficient transformation method for the transformation unit split from the coding unit.
[0098] The decoder 170 extracts information from the bitstream according to a method in which the bitstream generator 120 of the image encoding device 100 constructs the bitstream.
[0099] The decoder 170 may split the maximum coding unit into coding units having the most efficient tree structure based on the partition information. Then, the decoder 170 may split the coding unit into prediction units according to the information about the partition mode. The decoder 170 may split the coding unit into transformation units according to the transformation partition information.
[0100] The decoder 170 may predict the prediction unit according to the information about the prediction method. The decoder 170 may perform inverse quantization and inverse transformation on the residual data which is the difference between the original value and the prediction value of the pixel according to the information about the method of transforming the transform unit. The decoder 170 may reconstruct the pixels of the coding unit according to the prediction result of the prediction unit and the transformation result of the transform unit.
[0101] Figure 2 A process of determining at least one coding unit by splitting a current coding unit, which is performed by the image decoding device 150 according to an embodiment, is illustrated.
[0102] According to an embodiment, the image decoding device 150 may determine the shape of the coding unit by using the block shape information, and may determine the shape according to which the coding unit is to be divided by using the segmentation shape information. That is, the coding unit segmentation method indicated by the segmentation shape information may be determined according to the block shape indicated by the block shape information used by the image decoding device 150.
[0103] According to an embodiment, the image decoding device 150 may use block shape information indicating that the current coding unit has a square shape. For example, the image decoding device 150 may determine whether to split a square coding unit, whether to split a square coding unit vertically, whether to split a square coding unit horizontally, or whether to split a square coding unit into four coding units according to the split shape information. Figure 2 , when the block shape information of the current coding unit 200 indicates a square shape, the decoder 180 may not split the coding unit 210a having the same size as the current coding unit 200 according to the split shape information indicating that splitting is not performed, or may determine the split coding units 210b, 210c and 210d based on the split shape information indicating a preset splitting method.
[0104] refer to Figure 2According to an embodiment, the image decoding device 150 may determine two coding units 210b obtained by vertically splitting the current coding unit 200 based on the split shape information indicating that the splitting is performed vertically. The image decoding device 150 may determine two coding units 210c obtained by horizontally splitting the current coding unit 200 based on the split shape information indicating that the splitting is performed horizontally. The image decoding device 150 may determine four coding units 210d obtained by vertically and horizontally splitting the current coding unit 200 based on the split shape information indicating that the splitting is performed vertically and horizontally. However, it should not be interpreted that the split shape for splitting the square coding unit is limited to the above-mentioned shape, and the split shape may include various shapes that may be indicated by the split shape information. The split shape for splitting the square coding unit will be described in detail below through various embodiments.
[0105] Figure 3 A process of determining at least one coding unit by splitting a non-square coding unit, performed by the image decoding device 150 according to an embodiment, is illustrated.
[0106] According to an embodiment, the image decoding device 150 may use block shape information indicating that the current coding unit has a non-square shape. The image decoding device 150 may determine whether to not split the current non-square coding unit or whether to split the non-square current coding unit by using a preset method according to the split shape information. Figure 3 , when the block shape information of the current coding unit 300 or 350 indicates a non-square shape, the image decoding device 150 may not split the coding unit 310 or 360 having the same size as the current coding unit 300 or 350 according to the split shape information indicating that splitting is not performed, or may determine the coding units 320a and 320b, 330a, 330b and 330c, 370a and 370b, 380a, 380b and 380c to be split according to the split shape information indicating the preset split method. The preset split method for splitting the non-square coding unit will be described in detail below through various embodiments.
[0107] According to an embodiment, the image decoding device 150 may determine a shape according to which a coding unit is to be split by using the split shape information, and in this case, the split shape information may indicate the number of at least one coding unit generated when the coding unit is split. Figure 3 When the segmentation shape information indicates that the current coding unit 300 or 350 is segmented into two coding units, the image decoding device 150 can determine the two coding units 320a and 320b or 370a and 370b respectively included in the current coding unit 300 or 350 by segmenting the current coding unit 300 or 350 based on the segmentation shape information.
[0108] According to an embodiment, when the image decoding device 150 splits the current coding unit 300 or 350 having a non-square shape based on the split shape information, the image decoding device 150 may split the current coding unit 300 or 350 having a non-square shape in consideration of the position of the long side of the current coding unit 300 or 350. For example, the image decoding device 150 may determine a plurality of coding units by splitting the current coding unit 300 or 350 in a direction in which the long side of the current coding unit 300 or 350 is split in consideration of the shape of the current coding unit 300 or 350.
[0109] According to an embodiment, when the segmentation shape information indicates that the coding unit is to be segmented into an odd number of blocks, the image decoding device 150 may determine the odd number of coding units included in the current coding unit 300 or 350. For example, when the segmentation shape information indicates that the current coding unit 300 or 350 is to be segmented into three coding units, the image decoding device 150 may segment the current coding unit 300 or 350 into three coding units 330a, 330b, and 330c or 380a, 380b, and 380c. According to an embodiment, the image decoding device 150 may determine that the current coding unit 300 or 350 includes an odd number of coding units, and the size of the determined coding units may not be uniform. For example, the size of the coding unit 330b or 380b among the odd number of coding units 330a, 330b, and 330c or 380a, 380b, and 380c may be different from the size of the coding units 330a and 330c or 380a and 380c. That is, coding units that may be determined when the current coding unit 300 or 350 is split may have various types with respect to size.
[0110] According to an embodiment, when the partition shape information indicates that the coding unit is to be partitioned into an odd number of blocks, the image decoding device 150 may determine the odd number of coding units included in the current coding unit 300 or 350, and may impose a restriction on at least one of the odd number of coding units generated by partitioning the current coding unit 300 or 350. Figure 3 , the image decoding device 150 may decode the coding unit 330b or 380b located at the center of the three coding units 330a, 330b, and 330c or 380a, 380b, and 380c generated when the current coding unit 300 or 350 is divided in a different manner from the coding units 330a and 330c or 380a and 380c. For example, unlike the coding units 330a and 330c or 380a and 380c, the image decoding device 150 may restrict the coding unit 330b or 380b located at the center from being further divided or being divided only a preset number of times.
[0111] Figure 4A process of splitting a coding unit based on at least one of block shape information and partition shape information, performed by the image decoding device 150 according to an embodiment, is illustrated.
[0112] According to an embodiment, the image decoding device 150 may determine whether to segment or not segment the square first coding unit 400 into coding units based on at least one of the block shape information and the segmentation shape information. According to an embodiment, when the segmentation shape information indicates that the first coding unit 400 is segmented in the horizontal direction, the image decoding device 150 may determine the second coding unit 410 by segmenting the first coding unit 400 in the horizontal direction. The first coding unit, the second coding unit, and the third coding unit used according to the embodiment are terms for understanding the relationship before and after the segmentation of the coding unit. For example, the second coding unit may be determined by segmenting the first coding unit, and the third coding unit may be determined by segmenting the second coding unit. It will be understood that the relationship between the first coding unit, the second coding unit, and the third coding unit is applicable to the following description.
[0113] According to an embodiment, the image decoding device 150 may determine whether to split the second coding unit 410 into coding units based on at least one of the block shape information and the partition shape information, or may determine not to split the second coding unit 410. Figure 4 , the image decoding device 150 may split the non-square second coding unit 410 determined by splitting the first coding unit 400 into one or more third coding units 420a or 420b, 420c and 420d based on at least one of the block shape information and the split shape information, or may not split the non-square second coding unit 410. The image decoding device 150 may obtain at least one of the block shape information and the split shape information, and may split a plurality of second coding units (e.g., 410) of various shapes by splitting the first coding unit 400 based on at least one of the obtained block shape information and the split shape information, and may split the second coding unit 410 by using the splitting method of the first coding unit 400 based on at least one of the block shape information and the split shape information. According to an embodiment, when the first coding unit 400 is divided into the second coding unit 410 based on at least one of the block shape information and the segmentation shape information of the first coding unit 400, the second coding unit 410 may also be divided into the third coding unit 420a, or 420b, 420c, and 420d based on at least one of the block shape information and the segmentation shape information of the second coding unit 410. That is, the coding unit may be recursively divided based on at least one of the block shape information and the segmentation shape information of each coding unit. A method that may be used to recursively divide the coding unit will be described below through various embodiments.
[0114] According to an embodiment, the image decoding device 150 may determine to split each of the third coding units 420a or 420b, 420c, and 420d into coding units based on at least one of the block shape information and the segmentation shape information, or may determine not to split the second coding unit 410 based on at least one of the block shape information and the segmentation shape information. According to an embodiment, the image decoding device 150 may split the non-square second coding unit 410 into an odd number of third coding units 420b, 420c, and 420d. The image decoding device 150 may impose a preset restriction on the third coding units among the odd number of third coding units 420b, 420c, and 420d. For example, the image decoding device 150 may limit the third coding unit 420c located at the center position among the odd number of third coding units 420b, 420c, and 420d to no longer be split or to be split a set number of times. Reference Figure 4 , the image decoding device 150 may limit the third coding unit 420c located at the center position among the odd third coding units 420b, 420c, and 420d included in the non-square second coding unit 410 to be no longer divided, to be divided by using a preset division method (for example, to be divided only into four coding units or to be divided into a shape corresponding to the shape into which the second coding unit 410 is divided), or to be divided only a preset number of times (for example, to be divided only n times (where n>0)). However, the restriction on the third coding unit 420c located at the center position is not limited to the above example, and may include various restrictions for decoding the third coding unit 420c located at the center position differently from the other third coding units 420b and 420d.
[0115] According to an embodiment, the image decoding device 150 may obtain at least one of block shape information and partition shape information, which is used to partition the current coding unit from a preset position in the current coding unit.
[0116] According to an embodiment, when the current coding unit is split into a preset number of coding units, the image decoding device 150 may select one of the coding units. Various methods that may be used to select one of a plurality of coding units will be described below through various embodiments.
[0117] According to an embodiment, the image decoding device 150 may split a current coding unit into a plurality of coding units, and may determine a coding unit at a preset position.
[0118] Figure 5 A method of determining a preset-position coding unit from among odd-numbered coding units, performed by the image decoding apparatus 150 according to an embodiment, is illustrated.
[0119] According to an embodiment, the image decoding device 150 may determine a coding unit located at a center position from among the odd-numbered coding units using information indicating each position of the odd-numbered coding units. Figure 5 , the image decoding device 150 may determine the odd-numbered coding units 520a, 520b, and 520c by dividing the current coding unit 500. The image decoding device 150 may determine the coding unit 520b located at the center position by using information about the positions of the odd-numbered coding units 520a, 520b, and 520c. For example, the image decoding device 150 may determine the coding unit 520b located at the center position by determining the positions of the coding units 520a, 520b, and 520c based on information indicating the positions of preset samples included in the coding units 520a, 520b, and 520c. Specifically, the image decoding device 150 may determine the coding unit 520b located at the center position by determining the positions of the coding units 520a, 520b, and 520c based on information indicating the positions of the upper left samples 530a, 530b, and 530c of the coding units 520a, 520b, and 520c.
[0120] According to an embodiment, the information indicating the positions of the upper left samples 530a, 530b, and 530c respectively included in the coding units 520a, 520b, and 520c may include information about the positions or coordinates of the coding units 520a, 520b, and 520c in the picture. According to an embodiment, the information indicating the positions of the upper left samples 530a, 530b, and 530c respectively included in the coding units 520a, 520b, and 520c may include information indicating the width or height of the coding units 520a, 520b, and 520c included in the current coding unit 500, and the width or height may correspond to the information indicating the difference between the coordinates of the coding units 520a, 520b, and 520c in the picture. That is, the image decoding device 150 can determine the coding unit 520b located at the center position by directly using the information about the positions or coordinates of the coding units 520a, 520b, and 520c in the picture or by using the information about the width or height of the coding unit corresponding to the difference between the coordinates.
[0121] According to an embodiment, the information indicating the position of the upper left sample 530a of the upper coding unit 520a may include the coordinates (xa, ya), the information indicating the position of the upper left sample 530b of the middle coding unit 520b may include the coordinates (xb, yb), and the information indicating the position of the upper left sample 530c of the lower coding unit 520c may include the coordinates (xc, yc). The image decoding device 150 may determine the middle coding unit 520b by using the coordinates of the upper left samples 530a, 530b, and 530c respectively included in the coding units 520a, 520b, and 520c. For example, when the coordinates of the upper left samples 530a, 530b, and 530c are sorted in ascending or descending order, the coding unit 520b including the coordinates (xb, yb) of the sample 530b located at the center position may be determined as the coding unit located at the center position among the coding units 520a, 520b, and 520c determined by splitting the current coding unit 500. However, the coordinates indicating the positions of the upper left samples 530a, 530b, and 530c may include coordinates indicating absolute positions in the picture, or coordinates (dxb, dyb) indicating a relative position of the upper left sample 530b of the middle coding unit 520b with reference to the position of the upper left sample 530a of the upper coding unit 520a and coordinates ((dxc, dyc)) indicating a relative position of the upper left sample 530c of the lower coding unit 520c with reference to the position of the upper left sample 530a of the upper coding unit 520a may be used. In addition, a method of determining a coding unit located at a preset position by using the coordinates of a sample included in a coding unit as information indicating the position of the sample is not limited to the above method, and may include various arithmetic methods capable of using the coordinates of the sample.
[0122] According to an embodiment, the image decoding device 150 may split the current coding unit 500 into a plurality of coding units 520a, 520b, and 520c, and may select one of the coding units 520a, 520b, and 520c based on a preset criterion. For example, the image decoding device 150 may select a coding unit 520b having a size different from that of the other coding units from the coding units 520a, 520b, and 520c.
[0123] According to an embodiment, the image decoding device 150 may determine the width or height of the coding units 520a, 520b, and 520c by using the coordinates (xa, ya) indicating the position of the upper left sample 530a of the upper coding unit 520a, the coordinates (xb, yb) indicating the position of the upper left sample 530b of the middle coding unit 520b, and the coordinates (xc, yc) indicating the position of the upper left sample 530c of the lower coding unit 520c. The image decoding device 150 may determine the corresponding sizes of the coding units 520a, 520b, and 520c by using the coordinates (xa, ya), (xb, yb), and (xc, yc) indicating the positions of the coding units 520a, 520b, and 520c.
[0124] According to an embodiment, the image decoding device 150 may determine the width of the upper coding unit 520a as xb-xa, and determine the height of the upper coding unit 520a as yb-ya. According to an embodiment, the image decoding device 150 may determine the width of the middle coding unit 520b as xc-xb, and determine the height of the middle coding unit 520b as yc-yb. According to an embodiment, the image decoding device 150 may determine the width or height of the lower coding unit 520c by using the width or height of the current coding unit 500 and the widths and heights of the upper coding unit 520a and the middle coding unit 520b. The image decoding device 150 may determine a coding unit having a size different from that of other coding units based on the determined width and height of the coding units 520a, 520b, and 520c. Reference Figure 5 , the image decoding device 150 may determine the middle coding unit 520b having a size different from the sizes of the upper coding unit 520a and the lower coding unit 520c as the coding unit at the preset position. However, the above-mentioned method of determining the coding unit having a size different from the sizes of other coding units, performed by the image decoding device 150, corresponds only to an example of determining the coding unit located at the preset position by using the size of the coding unit determined based on the coordinates of the sample, and thus various methods of determining the coding unit located at the preset position by comparing the size of the coding unit determined based on the coordinates of the preset samples may be used.
[0125] However, the position of the sample considered for determining the position of the coding unit is not limited to the above-mentioned upper left position, and information on an arbitrary position of the sample included in the coding unit may be used.
[0126] According to an embodiment, the image decoding device 150 may select a coding unit located at a preset position from an odd number of coding units determined by dividing the current coding unit, taking into account the shape of the current coding unit. For example, when the current coding unit whose width is longer than its height has a non-square shape, the image decoding device 150 may determine a coding unit located at a preset position in the horizontal direction. That is, the image decoding device 150 may determine one of the coding units located at different positions in the horizontal direction, and may impose restrictions on the coding unit. When the current coding unit whose height is longer than its width has a non-square shape, the image decoding device 150 may determine a coding unit located at a preset position in the vertical direction. That is, the image decoding device 150 may determine one of the coding units located at different positions in the vertical direction, and may impose restrictions on the coding unit.
[0127] According to an embodiment, the image decoding device 150 may use information indicating the corresponding positions of the even-numbered coding units to determine the coding unit located at a preset position from the even-numbered coding units. The image decoding device 150 may determine the even-numbered coding units by splitting the current coding unit, and may determine the coding unit located at the preset position by using information about the positions of the even-numbered coding units. The operation related thereto may correspond to the operation of determining the coding unit located at a preset position (e.g., the center position) from the odd-numbered coding units, which has been referred to above. Figure 5 This has been described in detail, so a detailed description thereof will not be provided here.
[0128] According to an embodiment, when a non-square current coding unit is split into a plurality of coding units, preset information about a coding unit located at a preset position may be used in a split operation to determine the coding unit located at the preset position from among the plurality of coding units. For example, the image decoding device 150 may use at least one of block shape information and split shape information stored in a sample included in a coding unit located at a center position to determine the coding unit located at the center position from among the plurality of coding units determined by splitting the current coding unit in a split operation.
[0129] refer to Figure 5, the image decoding device 150 may divide the current coding unit 500 into a plurality of coding units 520a, 520b, and 520c based on at least one of the block shape information and the segmentation shape information, and may determine the coding unit 520b located at the center position from the plurality of coding units 520a, 520b, and 520c. In addition, the image decoding device 150 may determine the coding unit 520b located at the center position in consideration of the position from which at least one of the block shape information and the segmentation shape information is obtained. That is, at least one of the block shape information and the segmentation shape information of the current coding unit 500 may be obtained from a sample 540 located at the center position of the current coding unit 500, and when the current coding unit 500 is divided into a plurality of coding units 520a, 520b, and 520c based on at least one of the block shape information and the segmentation shape information, the coding unit 520b including the sample 540 may be determined as the coding unit located at the center position. However, the information for determining the coding unit located at the center position is not limited to at least one of the block shape information and the segmentation shape information, and the coding unit located at the center position may be determined using various information.
[0130] According to an embodiment, preset information for identifying a coding unit located at a preset position may be obtained from preset samples included in a coding unit to be determined. Figure 5 , the image decoding device 150 may use at least one of the block shape information and the partition shape information obtained from the sample located at the preset position in the current coding unit 500 (for example, the sample located at the center position of the current coding unit 500) to determine the coding unit located at the preset position (for example, the coding unit located at the center position of the multiple partitioned coding units) from the multiple coding units 520a, 520b, and 520c determined by partitioning the current coding unit 500. That is, the image decoding device 150 may determine the sample located at the preset position by referring to the block shape of the current coding unit 500, may determine the coding unit 520b including the sample from which the preset information (for example, at least one of the block shape information and the partition shape information) can be obtained from the multiple coding units 520a, 520b, and 520c determined by partitioning the current coding unit 500, and may impose a preset restriction on the coding unit 520b. Reference Figure 5 According to an embodiment, the image decoding device 150 may determine the sample 540 located at the center position of the current coding unit 500 as a sample from which preset information can be obtained, and may impose preset restrictions on the coding unit 520b including the sample 540 in the decoding operation. However, the position of the sample from which the preset information can be obtained is not limited to the above-mentioned position, and may include any position of the sample included in the coding unit 520b determined to be restricted.
[0131] According to an embodiment, the position of the sample from which the preset information can be obtained may be determined based on the shape of the current coding unit 500. According to an embodiment, the block shape information may indicate whether the current coding unit has a square or non-square shape, and the position of the sample from which the preset information can be obtained may be determined based on the shape. For example, the image decoding device 150 may determine a sample located on a boundary for dividing at least one of the width and the height of the current coding unit in half as a sample from which the preset information can be obtained, by using at least one of the information about the width of the current coding unit and the information about the height of the current coding unit. As another example, when the block shape information of the current coding unit indicates a non-square shape, the image decoding device 150 may determine one of the samples adjacent to the boundary for dividing the long side of the current coding unit in half as a sample from which the preset information can be obtained.
[0132] According to an embodiment, when the current coding unit is split into a plurality of coding units, the image decoding device 150 may use at least one of block shape information and split shape information to determine a coding unit located at a preset position from among the plurality of coding units. According to an embodiment, the image decoding device 150 may obtain at least one of block shape information and split shape information from a sample located at a preset position in the coding unit, and may split a plurality of coding units generated by splitting the current coding unit by using at least one of the split shape information and block shape information obtained from a sample located at a preset position in each of the plurality of coding units. That is, the coding unit may be recursively split based on at least one of the block shape information and split shape information obtained from a sample located at a preset position in each of the plurality of coding units. Reference has been made to the above. Figure 4 An operation of recursively splitting the coding unit is described, and thus a detailed description thereof will not be provided here.
[0133] According to an embodiment, the image decoding device 150 may determine one or more coding units by splitting a current coding unit, and may determine an order in which to decode the one or more coding units based on a preset block (eg, the current coding unit).
[0134] Figure 6 An order in which a plurality of coding units is processed when the image decoding device 150 determines a plurality of coding units by splitting a current coding unit according to an embodiment is illustrated.
[0135] According to an embodiment, based on the block shape information and the segmentation shape information, the image decoding device 150 may determine the second coding units 610a and 610b by segmenting the first coding unit 600 in a vertical direction, may determine the second coding units 630a and 630b by segmenting the first coding unit 600 in a horizontal direction, or may determine the second coding units 650a, 650b, 650c and 650d by segmenting the first coding unit 600 in vertical and horizontal directions.
[0136] refer to Figure 6 , the image decoding device 150 may determine to process the second coding units 610a and 610b determined by splitting the first coding unit 600 in the vertical direction in a horizontal direction order 610c. The image decoding device 150 may determine to process the second coding units 630a and 630b determined by splitting the first coding unit 600 in the horizontal direction in a vertical direction order 630c. The image decoding device 150 may determine to process the second coding units 650a, 650b, 650c, and 650d determined by splitting the first coding unit 600 in the vertical and horizontal directions according to a preset order (e.g., a raster scan order or a Z scan order 650e), process the coding units in one row in the preset order, and then process the coding units in the next row.
[0137] According to an embodiment, the image decoding apparatus 150 may recursively split the coding unit. Figure 6 , the image decoding device 150 may determine a plurality of second coding units 610a and 610b, 630a and 630b, and 650a, 650b, 650c, and 650d by splitting the first coding unit 600, and may recursively split each of the determined plurality of second coding units 610a, 610b, 630a, 630b, 650a, 650b, 650c, and 650d. The method of splitting the plurality of second coding units 610a, 610b, 630a, 630b, 650a, 650b, 650c, and 650d may correspond to the method of splitting the first coding unit 600. Therefore, each of the plurality of second coding units 610a, 610b, 630a, 630b, 650a, 650b, 650c, and 650d may be independently split into a plurality of coding units. Reference Figure 6 , the image decoding device 150 may determine the second coding units 610a and 610b by splitting the first coding unit 600 in the vertical direction, and may determine whether to split or not split each of the second coding units 610a and 610b independently.
[0138] According to an embodiment, the image decoding device 150 may determine the third coding units 620a and 620b by splitting the left second coding unit 610a in the horizontal direction, and may not split the right second coding unit 610b.
[0139] According to an embodiment, the processing order of the coding units may be determined based on the operation of splitting the coding units. In other words, the processing order of the split coding units may be determined based on the processing order of the coding units immediately before being split. The image decoding device 150 may determine the processing order of the third coding units 620a and 620b determined by splitting the left second coding unit 610a independently of the right second coding unit 610b. Since the third coding units 620a and 620b are determined by splitting the left second coding unit 610a in the horizontal direction, the third coding units 620a and 620b may be processed in a vertical direction order 620c. Since the left second coding unit 610a and the right second coding unit 610b are processed in a horizontal direction order 610c, the right second coding unit 610b may be processed after the third coding units 620a and 620b included in the left second coding unit 610a are processed in a vertical direction order 620c. The operation of determining the processing order of coding units based on the coding units before being split is not limited to the above example, and coding units split and determined to be various shapes may be independently processed in a preset order using various methods.
[0140] Figure 7 A process of determining that a current coding unit is to be split into an odd number of coding units when coding units cannot be processed in a preset order, performed by the image decoding device 150 according to an embodiment, is illustrated.
[0141] According to an embodiment, the image decoding device 150 may determine whether to split the current coding unit into an odd number of coding units based on the obtained block shape information and partition shape information. Figure 7 , the square first coding unit 700 may be split into non-square second coding units 710a and 710b, and the second coding units 710a and 710b may be independently split into third coding units 720a and 720b and 720c, 720d, and 720e. According to an embodiment, the image decoding device 150 may determine a plurality of third coding units 720a and 720b by splitting the left second coding unit 710a in the horizontal direction, and may split the right second coding unit 710b into an odd number of third coding units 720c, 720d, and 720e.
[0142] According to an embodiment, the image decoding device 150 may determine whether to split any coding unit into an odd number of coding units by determining whether the third coding units 720a and 720b and 720c, 720d, and 720e can be processed in a preset order. Figure 7 , the image decoding device 150 may determine the third coding units 720a and 720b and 720c, 720d and 720e by recursively dividing the first coding unit 700. The image decoding device 150 may determine whether to divide any one of the first coding unit 700, the second coding units 710a and 710b, and the third coding units 720a and 720b and 720c, 720d and 720e into an odd number of coding units based on at least one of the block shape information and the division shape information. For example, the second coding unit located on the right side of the second coding units 710a and 710b may be divided into an odd number of third coding units 720c, 720d and 720e. The processing order of the multiple coding units included in the first coding unit 700 can be a preset order (for example, a Z scan order 730), and the image decoding device 150 can determine whether the third coding units 720c, 720d and 720e determined by splitting the right second coding unit 710b into an odd number of coding units meet the conditions for processing in a preset order.
[0143] According to an embodiment, the image decoding device 150 may determine whether the third coding units 720a and 720b and 720c, 720d, and 720e included in the first coding unit 700 satisfy a condition for processing in a preset order, and the condition is related to whether at least one of the width and height of the second coding units 710a and 710b will be divided in half along the boundary of the third coding units 720a and 720b and 720c, 720d, and 720e. For example, although the third coding units 720a and 720b determined by dividing the height of the non-square left second coding unit 710a in half may satisfy the condition, since the boundary of the third coding units 720c, 720d, and 720e determined by dividing the right second coding unit 710b into three coding units does not divide the width or height of the right second coding unit 710b in half, it can be determined that the third coding units 720c, 720d, and 720e do not satisfy the condition. When the condition is not satisfied as described above, the image decoding device 150 may decide to disconnect the scanning order, and may determine to split the right second coding unit 710b into an odd number of coding units based on the decision result. According to an embodiment, when the coding unit is split into an odd number of coding units, the image decoding device 150 may impose a preset restriction on the coding unit located at a preset position in the split coding unit, and the restriction or preset position has been described above through various embodiments, so a detailed description thereof will not be provided here.
[0144] Figure 8 1 shows a process of determining at least one coding unit by splitting the first coding unit 800, which is performed by the image decoding device 150 according to an embodiment. According to an embodiment, the image decoding device 150 may split the first coding unit 800 based on at least one of the block shape information and the split shape information obtained by the receiver 160. The square first coding unit 800 may be split into four square coding units, or may be split into a plurality of non-square coding units. For example, referring to Figure 8 , when the block shape information indicates that the first coding unit 800 has a square shape and the segmentation shape information indicates that the first coding unit 800 is segmented into non-square coding units, the image decoding device 150 may segment the first coding unit 800 into a plurality of non-square coding units. Specifically, when the segmentation shape information indicates that an odd number of coding units is determined by segmenting the first coding unit 800 in the horizontal direction or the vertical direction, the image decoding device 150 may segment the square first coding unit 800 into an odd number of coding units, such as second coding units 810a, 810b, and 810c determined by segmenting the square first coding unit 800 in the vertical direction, or second coding units 820a, 820b, and 820c determined by segmenting the square first coding unit 800 in the horizontal direction.
[0145] According to an embodiment, the image decoding device 150 may determine whether the second coding units 810a, 810b, and 810c and 820a, 820b, and 820c included in the first coding unit 800 satisfy a condition for processing in a preset order, and the condition is related to whether at least one of the width and height of the first coding unit 800 is divided in half along the boundary of the second coding units 810a, 810b, and 810c and 820a, 820b, and 820c. Figure 8, since the boundaries of the second coding units 810a, 810b, and 810c determined by dividing the square first coding unit 800 in the vertical direction do not divide the width of the first coding unit 800 in half, it can be determined that the first coding unit 800 does not meet the condition sufficient for processing in a preset order. In addition, since the boundaries of the second coding units 820a, 820b, and 820c determined by dividing the square first coding unit 800 in the horizontal direction do not divide the width of the first coding unit 800 in half, it can be determined that the first coding unit 800 does not meet the condition sufficient for processing in a preset order. When the condition is not satisfied as described above, the image decoding device 150 may decide to interrupt the scanning order, and may determine to divide the first coding unit 800 into an odd number of coding units based on the decision result. According to an embodiment, when dividing the coding unit into an odd number of coding units, the image decoding device 150 may impose a preset restriction on the coding unit located at a preset position in the divided coding unit, and the restriction or the preset position has been described above through various embodiments, so a detailed description thereof will not be provided here.
[0146] According to an embodiment, the image decoding device 150 may determine coding units of various shapes by splitting the first coding unit.
[0147] refer to Figure 8 , the image decoding device 150 may divide the square first coding unit 800 or the non-square first coding unit 830 or 850 into coding units of various shapes.
[0148] Fig. 9 It is shown that shapes into which the image decoding device 150 may split the second coding unit are limited when a non-square second coding unit determined by splitting the first coding unit 900 satisfies a preset condition according to an embodiment.
[0149] According to an embodiment, the image decoding device 150 may determine to split the square first coding unit 900 into non-square second coding units 910a, 910b, 920a, and 920b based on at least one of the block shape information and the segmentation shape information obtained by the receiver 160. The second coding units 910a, 910b, 920a, and 920b may be split independently. In this way, the image decoding device 150 may determine to split the first coding unit 900 into a plurality of coding units based on at least one of the block shape information and the segmentation shape information of each of the second coding units 910a, 910b, 920a, and 920b, or may determine not to split the first coding unit 900. According to an embodiment, the image decoding device 150 may determine the third coding units 912a and 912b by splitting the non-square left second coding unit 910a in the horizontal direction, the non-square left second coding unit 910a being determined by splitting the first coding unit 900 in the vertical direction. However, when the left second coding unit 910a is split in the horizontal direction, the image decoding device 150 may limit the right second coding unit 910b to not be split in the horizontal direction in which the left second coding unit 910a is split. When the third coding units 914a and 914b are determined by splitting the right second coding unit 910b in the same direction, since the left second coding unit 910a and the right second coding unit 910b are independently split in the horizontal direction, the third coding units 912a and 912b and 914a and 914b may be determined. However, this case also serves as a case in which the image decoding device 150 splits the first coding unit 900 into four square second coding units 930a, 930b, 930c, and 930d based on at least one of the block shape information and the split shape information, and may be inefficient in terms of image decoding.
[0150] According to an embodiment, the image decoding device 150 may determine the third coding units 922a and 922b, or the third coding units 924a and 924b, by vertically splitting the non-square second coding unit 920a or 920b determined by horizontally splitting the first coding unit 900. However, when the second coding unit (e.g., the upper second coding unit 920a) is split in the vertical direction, the image decoding device 150 may limit the other second coding units (e.g., the lower second coding unit 920b) to not be split in the vertical direction in which the upper second coding unit 920a is split for the above-mentioned reason.
[0151] Fig.10A process of splitting a square coding unit performed by the image decoding device 150 when the split shape information cannot indicate that the square coding unit is to be split into four square coding units according to an embodiment is illustrated.
[0152] According to an embodiment, the image decoding device 150 may determine the second coding units 1010a, 1010b, 1020a, 1020b, etc. by segmenting the first coding unit 1000 based on at least one of the block shape information and the segmentation shape information. The segmentation shape information may include information about various shapes according to which the coding unit may be segmented, but the information about the various shapes may not include information for segmenting the coding unit into four square coding units. According to such segmentation shape information, the image decoding device 150 may not segment the first square coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d. The image decoding device 150 may determine the non-square second coding units 1010a, 1010b, 1020a, 1020b, etc. based on the segmentation shape information.
[0153] According to an embodiment, the image decoding device 150 may independently split each of the non-square second coding units 1010a, 1010b, 1020a, 1020b, etc. Each of the second coding units 1010a, 1010b, 1020a, 1020b, etc. may be recursively split in a preset order, and the splitting method may correspond to a method of splitting the first coding unit 1000 based on at least one of block shape information and split shape information.
[0154] For example, the image decoding device 150 may determine the square third coding units 1012a and 1012b by dividing the left second coding unit 1010a in the horizontal direction, and may determine the square third coding units 1014a and 1014b by dividing the right second coding unit 1010b in the horizontal direction. In addition, the image decoding device 150 may determine the square third coding units 1016a, 1016b, 1016c, and 1016d by dividing both the left second coding unit 1010a and the right second coding unit 1010b in the horizontal direction. In this case, a coding unit having the same shape as the four square second coding units 1030a, 1030b, 1030c, and 1030d divided from the first coding unit 1000 may be determined.
[0155] As another example, the image decoding device 150 may determine the third coding units 1022a and 1022b of square shape by dividing the upper second coding unit 1020a in the vertical direction, and may determine the third coding units 1024a and 1024b of square shape by dividing the lower second coding unit 1020b in the vertical direction. In addition, the image decoding device 150 may determine the third coding units 1026a, 1026b, 1026c, and 1026d of square shape by dividing both the upper second coding unit 1020a and the lower second coding unit 1020b in the vertical direction. In this case, a coding unit having the same shape as the four square second coding units 1030a, 1030b, 1030c, and 1030d divided from the first coding unit 1000 may be determined.
[0156] Fig.11 It is shown that a processing order among a plurality of coding units may be changed according to a process of splitting the coding units according to an embodiment.
[0157] According to an embodiment, the image decoding device 150 may split the first coding unit 1100 based on the block shape information and the segmentation shape information. When the block shape information indicates a square shape and the segmentation shape information indicates that the first coding unit 1100 is split in at least one of the horizontal direction and the vertical direction, the image decoding device 150 may determine the second coding unit (e.g., second coding units 1110a, 1110b, 1120a, 1120b, 1130a, 1130b, 1130c, 1130d, etc.) by splitting the first coding unit 1100. Fig.11 , the non-square second coding units 1110a, 1110b, 1120a, and 1120b determined by dividing the first coding unit 1100 only in the horizontal direction or the vertical direction may be independently divided based on the block shape information and the division shape information of each coding unit. For example, the image decoding device 150 may determine the third coding units 1116a, 1116b, 1116c, and 1116d by dividing the second coding units 1110a and 1110b in the horizontal direction, the second coding units 1110a and 1110b being generated by dividing the first coding unit 1100 in the vertical direction, and may determine the third coding units 1126a, 1126b, 1126c, and 1126d by dividing the second coding units 1120a and 1120b in the vertical direction, the second coding units 1120a and 1120b being generated by dividing the first coding unit 1100 in the horizontal direction. The above reference Fig. 9 The operation of splitting the second coding units 1110a, 1110b, 1120a, and 1120b is described, and thus a detailed description thereof will not be provided here.
[0158] According to an embodiment, the image decoding device 150 may process the coding units in a preset order. Figure 6 The operation of processing the encoding units in a preset order is described, and thus a detailed description thereof will not be provided here. Fig.11 , the image decoding device 150 may determine four square third coding units 1116a, 1116b, 1116c, and 1116d, and 1126a, 1126b, 1126c, and 1126d by dividing the square first coding unit 1100. According to an embodiment, the image decoding device 150 may determine the processing order of the third coding units 1116a, 1116b, 1116c, and 1116d, and 1126a, 1126b, 1126c, and 1126d based on the shape in which the first coding unit 1100 is divided.
[0159] According to an embodiment, the image decoding device 150 can determine the third coding units 1116a, 1116b, 1116c and 1116d by splitting the second coding units 1110a and 1110b generated by splitting the first coding unit 1100 in the vertical direction in the horizontal direction, and can process the third coding units 1116a, 1116b, 1116c and 1116d in the processing order 1117 to first process the third coding units 1116a and 1116c included in the left second coding unit 1110a in the vertical direction, and then process the third coding units 1116b and 1116d included in the right second coding unit 1110b in the vertical direction.
[0160] According to an embodiment, the image decoding device 150 may determine the third coding units 1126a, 1126b, 1126c, and 1126d by splitting in a vertical direction the second coding units 1120a and 1120b generated by splitting the first coding unit 1100 in a horizontal direction, and may process the third coding units 1126a, 1126b, 1126c, and 1126d in a processing order 1127 to first process the third coding units 1126a and 1126b included in the upper second coding unit 1120a in the horizontal direction, and then process the third coding units 1126c and 1126d included in the lower second coding unit 1120b in the horizontal direction.
[0161] refer to Fig.11, square third coding units 1116a, 1116b, 1116c, and 1116d, and 1126a, 1126b, 1126c, and 1126d can be determined by dividing the second coding units 1110a, 1110b, 1120a, and 1120b, respectively. Although the second coding units 1110a and 1110b are determined by dividing the first coding unit 1100 in the vertical direction differently from the second coding units 1120a and 1120b determined by dividing the first coding unit 1100 in the horizontal direction, the third coding units 1116a, 1116b, 1116c, and 1116d, and 1126a, 1126b, 1126c, and 1126d divided therefrom ultimately show the same shaped coding units divided from the first coding unit 1100. In this way, by recursively splitting the coding units in different ways based on at least one of the block shape information and the partition shape information, the image decoding device 150 can process multiple coding units in different orders even when it is finally determined that the coding units have the same shape.
[0162] Fig.12 A process of determining a depth of a coding unit as a shape and a size of the coding unit change when a coding unit is recursively split so that a plurality of coding units are determined according to an embodiment is illustrated.
[0163] According to an embodiment, the image decoding device 150 may determine the depth of the coding unit based on a preset criterion. For example, the preset criterion may be the length of the long side of the coding unit. When the length of the long side of the coding unit before being split is 2n times (n>0) the length of the long side of the current coding unit being split, the image decoding device 150 may determine that the depth of the current coding unit is increased by n from the depth of the coding unit before being split. In the following description, a coding unit with an increased depth is represented as a coding unit with a deeper depth.
[0164] refer to Fig.12According to an embodiment, the image decoding device 150 may determine a second coding unit 1202, a third coding unit 1204, and the like having a deeper depth by dividing a square first coding unit 1200 based on block shape information indicating a square shape (for example, the block shape information may indicate "0: square"). Assuming that the size of the square first coding unit 1200 is 2N×2N, the second coding unit 1202 determined by dividing the width and height of the first coding unit 1200 by 1 / 2 may have a size of N×N. In addition, the third coding unit 1204 determined by dividing the width and height of the second coding unit 1202 by 1 / 2 may have a size of N / 2×N / 2. In this case, the width and height of the third coding unit 1204 correspond to 1 / 2 times the width and height of the first coding unit 1200. When the depth of the first coding unit 1200 is D, the depth of the second coding unit 1202 whose width and height are 1 / 2 times the width and height of the first coding unit 1200 may be D+1, and the depth of the third coding unit 1204 whose width and height are 1 / 2 times the width and height of the first coding unit 1200 may be D+2.
[0165] According to an embodiment, the image decoding device 150 can determine a second coding unit 1212 or 1222, a third coding unit 1214 or 1224, and the like having a deeper depth by dividing a non-square first coding unit 1210 or 1220 based on block shape information indicating a non-square shape (for example, the block shape information may indicate "1:NS_VER", indicating a non-square shape whose height is longer than its width, or "2:NS_HOR", indicating a non-square shape whose width is longer than its height).
[0166] The image decoding device 150 may determine the second coding unit 1202, 1212, or 1222 by splitting at least one of the width and the height of the first coding unit 1210 having a size of N×2N. That is, the image decoding device 150 may determine the second coding unit 1202 having a size of N×N or the second coding unit 1222 having a size of N×N / 2 by splitting the first coding unit 1210 in the horizontal direction, or may determine the second coding unit 1212 having a size of N / 2×N by splitting the first coding unit 1210 in the horizontal and vertical directions.
[0167] According to an embodiment, the image decoding device 150 may determine the second coding unit 1202, 1212, or 1222 by splitting at least one of the width and the height of the first coding unit 1220 having a size of 2N×N. That is, the image decoding device 150 may determine the second coding unit 1202 having a size of N×N or the second coding unit 1212 having a size of N / 2×N by splitting the first coding unit 1220 in a vertical direction, or may determine the second coding unit 1222 having a size of N×N / 2 by splitting the first coding unit 1220 in horizontal and vertical directions.
[0168] According to an embodiment, the image decoding device 150 may determine the third coding unit 1204, 1214, or 1224 by splitting at least one of the width and the height of the second coding unit 1202 having a size of N×N. That is, the image decoding device 150 may determine the third coding unit 1204 having a size of N / 2×N / 2, the third coding unit 1214 having a size of N / 2×N / 2, or the third coding unit 1224 having a size of N / 2×N / 2 by splitting the second coding unit 1202 in the vertical direction and the horizontal direction.
[0169] According to an embodiment, the image decoding device 150 may determine the third coding unit 1204, 1214, or 1224 by splitting at least one of the width and the height of the second coding unit 1212 having a size of N / 2×N. That is, the image decoding device 150 may determine the third coding unit 1204 having a size of N / 2×N / 2 or the third coding unit 1224 having a size of N / 2×N / 2 by splitting the second coding unit 1212 in a horizontal direction, or may determine the third coding unit 1214 having a size of N / 2×N / 2 by splitting the second coding unit 1212 in a vertical direction and a horizontal direction.
[0170] According to an embodiment, the image decoding device 150 may determine the third coding unit 1204, 1214, or 1224 by splitting at least one of the width and the height of the second coding unit 1214 having a size of N×N / 2. That is, the image decoding device 150 may determine the third coding unit 1204 having a size of N / 2×N / 2 or the third coding unit 1214 having a size of N / 2×N / 2 by splitting the second coding unit 1212 in the vertical direction, or may determine the third coding unit 1224 having a size of N / 2×N / 2 by splitting the second coding unit 1212 in the vertical direction and the horizontal direction.
[0171] According to an embodiment, the image decoding device 150 may split a square coding unit (e.g., 1200, 1202, or 1204) in a horizontal direction or a vertical direction. For example, the image decoding device 150 may determine a first coding unit 1210 having a size of N×2N by splitting a first coding unit 1200 having a size of 2N×2N in a vertical direction, or may determine a first coding unit 1220 having a size of 2N×N by splitting the first coding unit 1200 in a horizontal direction. According to an embodiment, when the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by splitting the first coding unit 1200, 1202, or 1204 having a size of 2N×2N in a horizontal direction or a vertical direction may be the same as the depth of the first coding unit 1200, 1202, or 1204.
[0172] According to an embodiment, the width and height of the third coding unit 1214 or 1224 may be 1 / 2 times the width and height of the first coding unit 1210 or 1220. When the depth of the first coding unit 1210 or 1220 is D, the depth of the second coding unit 1212 or 1214 whose width and height are 1 / 2 times the width and height of the first coding unit 1210 or 1220 may be D+1, and the depth of the third coding unit 1214 or 1224 whose width and height are 1 / 2 times the width and height of the first coding unit 1210 or 1220 may be D+2.
[0173] Fig.13 Detailed description is given of a depth that may be determined based on a shape and a size of a coding unit, and a partial index (PID) for identifying a coding unit, according to an embodiment.
[0174] According to an embodiment, the image decoding device 150 may determine second coding units of various shapes by dividing the square first coding unit 1300. Fig.13 , the image decoding device 150 may determine the second coding units 1302a and 1302b, 1304a and 1304b, and 1306a, 1306b, 1306c, and 1306d by dividing the first coding unit 1300 in at least one of the vertical direction and the horizontal direction based on the division shape information. That is, the image decoding device 150 may determine the second coding units 1302a and 1302b, 1304a and 1304b, and 1306a, 1306b, 1306c, and 1306d based on the division shape information of the first coding unit 1300.
[0175] According to an embodiment, the depth thereof may be determined based on the length of the long sides of the second coding units 1302a and 1302b, 1304a and 1304b, and 1306a, 1306b, 1306c, and 1306d determined based on the segmentation shape information of the square-shaped first coding unit 1300. For example, since the length of the side of the square-shaped first coding unit 1300 is equal to the length of the long sides of the non-square second coding units 1302a and 1302b, and 1304a and 1304b, the first coding unit 1300 and the non-square second coding units 1302a and 1302b, and 1304a and 1304b may have the same depth, for example, D. However, when the image decoding device 150 divides the first coding unit 1300 into four square second coding units 1306a, 1306b, 1306c and 1306d based on the segmentation shape information, since the length of the side of the square second coding units 1306a, 1306b, 1306c and 1306d is 1 / 2 times the length of the side of the first coding unit 1300, the depth of the second coding units 1306a, 1306b, 1306c and 1306d can be D+1, which is 1 deeper than the depth D of the first coding unit 1300.
[0176] According to an embodiment, the image decoding device 150 may determine a plurality of second coding units 1312a and 1312b and 1314a, 1314b, and 1314c by dividing the first coding unit 1310 whose height is longer than its width in the horizontal direction based on the division shape information. According to an embodiment, the image decoding device 150 may determine a plurality of second coding units 1322a and 1322b and 1324a, 1324b, and 1324c by dividing the first coding unit 1320 whose width is longer than its height in the vertical direction based on the division shape information.
[0177] According to an embodiment, the depth thereof may be determined based on the length of the long side of the second coding units 1312a, 1312b, 1314a, 1314b, and 1314c or 1322a, 1322b, 1324a, 1324b, and 1324c determined based on the segmentation shape information of the non-square first coding unit 1310 or 1320. For example, since the length of the side of the square second coding units 1312a and 1312b is 1 / 2 times the length of the side of the first coding unit 1310 having a non-square shape having a height longer than its width, the depth of the square second coding units 1302a, 1302b, 1304a, and 1304b is D+1, which is 1 deeper than the depth D of the non-square first coding unit 1310.
[0178] In addition, the image decoding device 150 may divide the non-square first coding unit 1310 into an odd number of second coding units 1314a, 1314b, and 1314c based on the segmentation shape information. The odd number of second coding units 1314a, 1314b, and 1314c may include the non-square second coding units 1314a and 1314c and the square second coding unit 1314b. In this case, since the length of the long side of the non-square second coding units 1314a and 1314c and the length of the side of the square second coding unit 1314b are 1 / 2 times the length of the side of the first coding unit 1310, the depth of the second coding units 1314a, 1314b, and 1314c may be D+1, which is 1 deeper than the depth D of the first coding unit 1310. The image decoding device 150 may determine the depth of the coding unit split from the non-square first coding unit 1320 whose width is longer than its height by using the above-mentioned method of determining the depth of the coding unit split from the first coding unit 1310 .
[0179] According to an embodiment, when the odd-numbered split coding units do not have equal sizes, the image decoding device 150 may determine a PID for identifying the split coding units based on a size ratio between the coding units. Fig.13 , the coding unit 1314b at the center position among the odd-numbered divided coding units 1314a, 1314b, and 1314c may have a width equal to the width of the other coding units 1314a and 1314c, and a height twice the height of the other coding units 1314a and 1314c. That is, in this case, the coding unit 1314b located at the center position may include two of the other coding units 1314a and 1314c. Therefore, when the PID of the coding unit 1314b located at the center position based on the scanning order is 1, the PID of the coding unit 1314c located next to the coding unit 1314b may increase by 2 and may therefore be 3. That is, there may be discontinuity in the PID value. According to an embodiment, the image decoding device 150 may determine whether the odd-numbered divided coding units do not have equal sizes based on whether there is discontinuity in the PID used to identify the divided coding units.
[0180] According to an embodiment, the image decoding device 150 may determine whether to use a specific splitting method based on a PID value for identifying a plurality of coding units determined by splitting the current coding unit. Fig.13, the image decoding device 150 may determine the even number of coding units 1312a and 1312b or the odd number of coding units 1314a, 1314b, and 1314c by segmenting the first coding unit 1310 having a rectangular shape whose height is longer than its width. The image decoding device 150 may use the PID indicating the corresponding coding unit in order to identify the corresponding coding unit. According to an embodiment, the PID may be obtained from a sample at a preset position of each coding unit (e.g., an upper left sample).
[0181] According to an embodiment, the image decoding device 150 may determine a coding unit located at a preset position among the segmented coding units by using a PID for identifying a coding unit. According to an embodiment, when the segmentation shape information of the first coding unit 1310 having a rectangular shape having a height longer than its width indicates that the coding unit is segmented into three coding units, the image decoding device 150 may segment the first coding unit 1310 into three coding units 1314a, 1314b, and 1314c. The image decoding device 150 may assign a PID to each of the three coding units 1314a, 1314b, and 1314c. The image decoding device 150 may compare the PIDs of the odd number of segmented coding units to determine a coding unit located at a central position from the coding units. The image decoding device 150 may determine the coding unit 1314b having a PID corresponding to a median value among the PIDs of the coding units as a coding unit located at a central position among the coding units determined by segmenting the first coding unit 1310. According to an embodiment, when the split coding units do not have equal sizes, the image decoding device 150 may determine a PID for identifying the split coding units based on a size ratio between the coding units. Fig.13, the coding unit 1314b generated by dividing the first coding unit 1310 may have a width equal to the width of the other coding units 1314a and 1314c, and a height twice the height of the other coding units 1314a and 1314c. In this case, when the PID of the coding unit 1314b located at the center position is 1, the PID of the coding unit 1314c located next to the coding unit 1314b may be increased by 2, and thus may be 3. When the PID is unevenly increased as described above, the image decoding device 150 may determine to divide the coding unit into a plurality of coding units including coding units having sizes different from those of other coding units. According to an embodiment, when the segmentation shape information indicates that the coding unit is divided into an odd number of coding units, the image decoding device 150 may divide the current coding unit in such a manner that the coding unit at a preset position (e.g., the coding unit at the center position) among the odd number of coding units has a size different from that of the other coding units. In this case, the image decoding device 150 may determine the coding units at the center position having different sizes by using the PIDs of the coding units. However, the PID and the size or position of the coding unit of the preset position to be determined are not limited to the above-mentioned examples, and various PIDs and various positions and sizes of the coding unit may be used.
[0182] According to an embodiment, the image decoding device 150 may use a preset data unit that is recursively split starting from a coding unit.
[0183] Fig.14 It is shown that a plurality of coding units are determined based on a plurality of preset data units included in a picture according to an embodiment.
[0184] According to an embodiment, a preset data unit may be defined as a data unit in which a coding unit is recursively split by using at least one of block shape information and segmentation shape information. That is, the preset data unit may correspond to a coding unit of the highest depth, which is used to determine a plurality of coding units split from a current picture. In the following description, for ease of explanation, the preset data unit is referred to as a reference data unit.
[0185] According to an embodiment, the reference data unit may have a preset size and a preset shape. According to an embodiment, the reference data unit may include M×N samples. Here, M and N may be equal to each other and may be an integer expressed as a power of 2. That is, the reference data unit may have a square or non-square shape and may be divided into an integer number of coding units.
[0186] According to an embodiment, the image decoding device 150 may divide the current picture into a plurality of reference data units. According to an embodiment, the image decoding device 150 may divide the plurality of reference data units divided from the current picture by using the division shape information of each reference data unit. The operation of dividing the reference data unit may correspond to the division operation using the quadtree structure.
[0187] According to an embodiment, the image decoding device 150 may predetermine the minimum size allowed for the reference data unit included in the current picture. Therefore, the image decoding device 150 may determine various reference data units having a size equal to or larger than the minimum size, and may determine one or more coding units by using the partition shape information and the block shape information about the determined reference data unit.
[0188] refer to Fig.14 , the image decoding device 150 may use a square reference coding unit 1400 or a non-square reference coding unit 1402. According to an embodiment, the shape and size of the reference coding unit may be determined based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.) that can include one or more reference coding units.
[0189] According to an embodiment, the receiver 160 of the image decoding device 150 may obtain at least one of reference coding unit shape information and reference coding unit size information of each of various data units from a bitstream. Fig.10 The operation of splitting the current coding unit 300 describes the operation of determining one or more coding units included in the square reference coding unit 1400, and the above has been described with respect to Fig.11 The operation of splitting the current coding unit 1100 or 1150 describes the operation of determining one or more coding units included in the non-square reference coding unit 1402, and therefore, a detailed description thereof will not be provided here.
[0190] According to an embodiment, the image decoding device 150 may use a PID for identifying the size and shape of a reference coding unit to determine the size and shape of a reference coding unit according to some data units previously determined based on a preset condition. That is, the receiver 160 may obtain only a PID for identifying the size and shape of a reference coding unit of each slice, slice segment, tile, tile group, or maximum coding unit as a data unit satisfying a preset condition (e.g., a data unit having a size equal to or smaller than a slice) among various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.) from a bitstream. The image decoding device 150 may determine the size and shape of a reference data unit of each data unit satisfying a preset condition by using a PID. When the reference coding unit shape information and the reference coding unit size information are obtained and used from a bitstream according to each data unit having a relatively small size, the efficiency of using the bitstream may not be high, and therefore, only the PID may be obtained and used instead of directly obtaining the reference coding unit shape information and the reference coding unit size information. In this case, at least one of the size and shape of the reference coding unit corresponding to the PID for identifying the size and shape of the reference coding unit may be predetermined. That is, the image decoding device 150 may determine at least one of the size and shape of the reference coding unit included in the data unit of the unit for obtaining the PID by selecting at least one previously determined one of the size and shape of the reference coding unit based on the PID.
[0191] According to an embodiment, the image decoding device 150 may use one or more reference coding units included in one maximum coding unit. That is, the maximum coding unit segmented from the image may include one or more reference coding units, and the coding unit may be determined by recursively segmenting each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit may be obtained by segmenting the maximum coding unit n times based on a quadtree structure. That is, according to various embodiments, the image decoding device 150 may determine the reference coding unit by segmenting the maximum coding unit n times based on a quadtree structure, and may segment the reference coding unit based on at least one of block shape information and segmentation shape information.
[0192] Fig.15 A processing block serving as a unit for determining an order of reference coding units included in the picture 1500 according to an embodiment is illustrated.
[0193] According to an embodiment, the image decoding device 150 may determine one or more processing blocks segmented from a picture. A processing block is a data unit including one or more reference coding units segmented from an image, and one or more reference coding units included in the processing block may be determined according to a specific order. That is, the determination order of one or more reference coding units determined in each processing block may correspond to one of various types of orders for determining reference coding units, and may vary according to the processing block. The determination order of the reference coding units determined for each processing block may be one of various orders, for example, raster scanning, Z scanning, N scanning, upper right diagonal scanning, horizontal scanning, and vertical scanning, but is not limited to the above scanning order.
[0194] According to an embodiment, the image decoding device 150 may obtain processing block size information and may determine the size of one or more processing blocks included in the image. The image decoding device 150 may obtain processing block size information from a bitstream and may determine the size of one or more processing blocks included in the image. The size of the processing block may be a preset size of a data unit, which is indicated by the processing block size information.
[0195] According to an embodiment, the receiver 160 of the image decoding device 150 may obtain the processing block size information from the bit stream of each specific data unit. For example, the processing block size information may be obtained from the bit stream in a data unit such as an image, a sequence, a picture, a slice, a slice segment, a tile, or a tile group. That is, the receiver 160 may obtain the processing block size information from the bit stream of each of the various data units, and the image decoding device 150 may determine the size of one or more processing blocks segmented from the picture by using the obtained processing block size information, and the size of the processing block may be an integer multiple of the size of the reference coding unit.
[0196] According to an embodiment, the image decoding device 150 may determine the size of the processing blocks 1502 and 1512 included in the picture 1500. For example, the image decoding device 150 may determine the size of the processing block based on the processing block size information obtained from the bitstream. Fig.15 According to an embodiment, the image decoding device 150 may determine the width of the processing blocks 1502 and 1512 to be four times the width of the reference coding unit, and may determine the height of the processing blocks 1502 and 1512 to be four times the height of the reference coding unit. The image decoding device 150 may determine the determination order of one or more reference coding units in one or more processing blocks.
[0197] According to an embodiment, the image decoding device 150 may determine the processing blocks 1502 and 1512 included in the picture 1500 based on the size of the processing block, and may determine the determination order of one or more reference coding units included in the processing blocks 1502 and 1512. According to an embodiment, determining the reference coding unit may include determining the size of the reference coding unit.
[0198] According to an embodiment, the image decoding device 150 may obtain the determination order information of one or more reference coding units included in one or more processing blocks from the bitstream, and may determine the determination order of the one or more reference coding units based on the obtained determination order information. The determination order information may be defined as an order or direction for determining the reference coding units in the processing block. That is, the determination order of the reference coding units may be determined independently for each processing block.
[0199] According to an embodiment, the image decoding device 150 may obtain the determination order information of the reference coding unit for each specific data unit from the bitstream. For example, the receiver 160 may obtain the determination order information of the reference coding unit from the bitstream according to each data unit such as an image, a sequence, a picture, a slice, a slice segment, a tile, a tile group, or a processing block. Since the determination order information of the reference coding unit indicates the order of the reference coding unit used to determine the processing block, the determination order information may be obtained for each specific data unit including an integer number of processing blocks.
[0200] According to an embodiment, the image decoding device 150 may determine one or more reference coding units based on the determined determination order.
[0201] According to an embodiment, the receiver 160 may obtain the determination order information of the reference coding units from the bitstream as information related to the processing blocks 1502 and 1512, and the image decoding device 150 may determine the determination order of one or more reference coding units included in the processing blocks 1502 and 1512 and may determine one or more reference coding units included in the picture 1500 based on the determination order of the reference coding units. Fig.15, the image decoding device 150 may respectively determine the determination order 1504 and 1514 of one or more reference coding units in the processing blocks 1502 and 1512. For example, when the determination order information of the reference coding units is obtained for each processing block, different types of determination order information of the reference coding units may be obtained for the processing blocks 1502 and 1512. When the determination order 1504 of the reference coding units in the processing block 1502 is a raster scan order, the reference coding units included in the processing block 1502 may be determined according to the raster scan order. On the contrary, when the determination order 1514 of the reference coding units in another processing block 1512 is a backward raster scan order, the reference coding units included in the processing block 1512 may be determined according to the backward raster scan order.
[0202] refer to Figures 1A to 15 , describes a method of dividing an image into maximum coding units and dividing the maximum coding unit into coding units having a hierarchical tree structure. Figures 16 to 28 , various embodiments of a block intra prediction method are now provided.
[0203] Fig.16 is a block diagram of a video decoding apparatus 1600 for performing video decoding according to a block intra prediction method.
[0204] refer to Fig.16 , the video decoding device 1600 according to an embodiment may include a processor 1610 and a memory 1620.
[0205] The processor 1610 according to an embodiment may generally control the video decoding apparatus 1600. The processor 1610 according to an embodiment may execute one or more programs stored in the memory 1620.
[0206] The memory 1620 according to an embodiment may store various data, programs, or applications for driving and controlling the video decoding device 1600. The program stored in the memory 1620 may include one or more instructions. The program (one or more instructions) or application stored in the memory 1620 may be executed by the processor 1610.
[0207] The processor 1610 obtains intra prediction mode information indicating an intra prediction mode of a current block.
[0208] The processor 1610 determines the intra prediction direction indicated by the intra prediction mode information based on the shape of the current block. When the current block has a square shape, the intra prediction direction of the current block is determined in the prediction direction indicated by the intra prediction mode information. When the current block has a non-square shape, the intra prediction direction of the current block is determined based on a comparison result between a reference prediction direction and the prediction direction, the reference prediction direction is determined according to the ratio of the width and height of the current block, and the prediction direction is indicated by the intra prediction mode information.
[0209] According to an embodiment, when the current block has a square shape, the intra prediction direction of the current block may be determined from a first intra prediction direction candidate determined according to the square shape. When the current block has a non-square shape, the intra prediction direction of the current block may be determined from a second intra prediction direction candidate determined according to a width and a height of the non-square current block. The first intra prediction direction candidate and the second intra prediction direction candidate are determined from an intra prediction direction candidate group including a plurality of prediction directions.
[0210] The intra-frame prediction direction candidate group may include an intra-frame prediction direction of an angle range of 270 degrees between the right direction and the lower direction. According to an embodiment, the intra-frame prediction direction candidate group may include one or more intra-frame prediction directions of an angle range of 45 degrees between the upper right direction and the right direction. The intra-frame prediction direction candidate group may include one or more intra-frame prediction directions of an angle range of 45 degrees between the lower left direction and the lower direction. For example, the intra-frame prediction direction candidate group may include Fig.17 and Fig.18 The intra prediction direction is shown.
[0211] According to an embodiment, the intra prediction direction of the intra prediction direction candidate group may be determined to match the sub-pixel unit that allows intra prediction. The intra prediction direction defined for a square block according to a predetermined sub-pixel accuracy may be applied to a non-square block. In the foregoing case, the sample according to the intra prediction direction may not be a sample according to the predetermined sub-pixel accuracy. Therefore, when the intra prediction direction defined for a square block according to a predetermined sub-pixel accuracy is applied to a non-square block, the intra prediction direction may be adaptively adjusted for the non-square block.
[0212] For example, in the case where intra prediction of 1 / 2 sub-pixel units is allowed, the intra prediction direction of the intra prediction direction candidate group defined for the square block can be determined according to the accuracy of the 1 / 2 sub-pixel unit. When a specific intra prediction direction does not indicate a reference sample of the 1 / 2 sub-pixel unit, the specific intra prediction direction can be adjusted to indicate a reference sample of the 1 / 2 sub-pixel unit for a non-square block. In an embodiment, it is described that intra prediction of 1 / 2 sub-pixel units is allowed, but in another embodiment, intra prediction according to the accuracy of 1 / 4 sub-pixel units or smaller units can be allowed.
[0213] In addition, the intra prediction direction of the intra prediction direction candidate group can be set to have a predetermined sub-pixel unit accuracy with respect to both the square block and the non-square block. For example, Table 1 shows the intra prediction angle according to the intra prediction mode, and the adjusted intra prediction angle adjusted from the intra prediction angle. The intra prediction mode is substantially equal to the reference Fig.18 The intra prediction mode described. The intra prediction angle indicates the angle of the prediction direction of the intra prediction mode. The adjusted intra prediction angle is determined by adjusting the intra prediction angle to indicate a reference sample at an integer position or a reference sample adjacent to an integer position. However, Table 1 is only an example, and the adjusted intra prediction angle may vary.
[0214] [Table 1]
[0215]
[0216] When the current block has a non-square shape with a width greater than its height, the reference prediction direction is determined as a direction indicating a lower left vertex of the current block from the center of the current block. Alternatively, when the current block has a non-square shape with a height greater than its width, the reference prediction direction is determined as a direction indicating an upper right vertex of the current block from the center of the current block.
[0217] According to an embodiment, in the case where the current block has a non-square shape whose width is greater than its height, when the prediction direction indicated by the intra-prediction mode information is closer to the lower direction than the reference prediction direction, the intra-prediction direction of the current block may be determined in a direction opposite to the prediction direction indicated by the intra-prediction mode information or in a direction symmetrical to the prediction direction about the origin. Alternatively, in the case where the current block has a non-square shape whose width is greater than its height, when the reference prediction direction is equal to the prediction direction indicated by the intra-prediction mode information, or when the reference prediction direction is closer to the lower direction than the prediction direction indicated by the intra-prediction mode information, the intra-prediction direction of the current block may be determined in the prediction direction indicated by the intra-prediction mode information.
[0218] According to an embodiment, in the case where the current block has a non-square shape whose height is greater than its width, when the prediction direction indicated by the intra-prediction mode information is closer to the right direction than the reference prediction direction, the intra-prediction direction of the current block may be determined in a direction opposite to the prediction direction indicated by the intra-prediction mode information or in a direction symmetrical to the prediction direction about the origin. In the case where the current block has a non-square shape whose height is greater than its width, when the reference prediction direction is equal to the prediction direction indicated by the intra-prediction mode information, or when the reference prediction direction is closer to the right direction than the prediction direction indicated by the intra-prediction mode information, the intra-prediction direction of the current block may be determined in the prediction direction indicated by the intra-prediction mode information.
[0219] According to an embodiment, the intra prediction mode information indicates the index number of the intra prediction mode of the current block. Therefore, the intra prediction direction of the current block can be determined based on the index number indicated by the intra prediction mode information. Fig.17 and Fig.18 Describes the index number of the intra prediction mode. In addition, Fig.17 and Fig.18 There are different ways to determine the index number of the intra prediction mode.
[0220] According to an embodiment, in the case where the current block has a non-square shape with a width greater than its height, when the index number is less than the reference index number corresponding to the reference prediction direction, the intra-prediction direction of the current block may be determined in the prediction direction of the intra-prediction mode corresponding to the adjusted index number greater than the index number by a first value. In the case where the current block has a non-square shape with a width greater than its height, when the index number indicated by the intra-prediction mode information is equal to the index number corresponding to the reference prediction direction or the index number indicated by the intra-prediction mode information is greater than the index number corresponding to the reference prediction direction, the intra-prediction direction of the current block may be determined in the prediction direction of the intra-prediction mode corresponding to the index number.
[0221] According to an embodiment, in the case where the current block has a non-square shape with a height greater than its width, when the index number is greater than the reference index number corresponding to the reference prediction direction, the intra-prediction direction of the current block may be determined in the prediction direction of the intra-prediction mode corresponding to the adjusted index number that is smaller than the index number by a second value. In the case where the current block has a non-square shape with a height greater than its width, when the index number indicated by the intra-prediction mode information is equal to the index number corresponding to the reference prediction direction or the index number indicated by the intra-prediction mode information is smaller than the index number corresponding to the reference prediction direction, the intra-prediction direction of the current block may be determined in the prediction direction of the intra-prediction mode corresponding to the index number.
[0222] The first value and the second value may be determined based on the number of angular intra prediction modes. Fig.18 As shown in , when the index number of the non-angular intra prediction mode is 0 and 1, and the index number of the angular intra prediction mode is 2 to 66, the first value may be determined as 65, and the second value may be determined as 67.
[0223] The processor 1610 predicts the current block by performing intra prediction on the current block in an intra prediction direction. Then, the processor 1610 reconstructs the current block according to the prediction result of the current block.
[0224] To facilitate understanding of the intra-prediction direction determination method performed by the processor 1610, reference will now be made to Fig.17 and Fig.18 An intra prediction mode indicating an intra prediction scheme is described. Fig.17 35 intra prediction modes according to an embodiment are shown, and Fig.18 95 intra prediction modes according to another embodiment are shown.
[0225] The intra prediction mode according to various embodiments may include a non-angular intra prediction mode and an angular intra prediction mode, the non-angular intra prediction mode including a planar mode and a direct current (DC) mode having no directionality, and the angular intra prediction mode having directionality. The non-angular mode may include a planar mode and a bilinear mode as well as a planar mode and a DC mode.
[0226] refer to Fig.17 , the angular intra prediction mode includes an intra prediction mode that indicates a specific direction between -135 degrees and -180 degrees and within an intra prediction direction range between 45 degrees and 180 degrees with respect to a direction between 45 degrees and -135 degrees. The intra prediction direction range indicates a range of a prediction direction of the angular intra prediction mode of the current block. Typically, the value of the intra prediction direction range is set to 180 degrees.
[0227] refer to Fig.18 , the angular intra prediction mode includes an intra prediction mode indicating a specific direction within the range of intra prediction directions between -135 degrees and -180 degrees and between 45 degrees and 180 degrees with respect to the directions of 45 degrees and -135 degrees. In addition, Fig.18 The angular intra prediction mode may also include an intra prediction mode indicating a specific direction within the intra prediction direction ranges between -90 degrees and -135 degrees and between 0 degrees and 45 degrees.
[0228] In the following description, the angle of the predicted direction in the range between 0 and 180 degrees indicating the direction on quadrants I and II may be represented as +, and the angle of the predicted direction in the range between -180 and 0 degrees indicating the direction on quadrants III and IV may be represented as -. The predetermined angle -a (where "a" is a positive real number) indicating the direction on quadrants III and IV corresponds to the angle (360-a) degrees. For example, the direction of -135 degrees corresponds to the direction of 225 degrees, and the direction of -180 degrees corresponds to the direction of 180 degrees.
[0229] Fig.17 and Fig.18 The prediction direction indicated by the arrow shown in indicates the direction of neighboring pixels to be used in intra prediction with respect to a current pixel of a current block to be intra predicted. Fig.17 and Fig.18 The numbers marked in are examples of intra prediction mode indexes (predModeIntra) according to intra prediction directions. In the following, the intra prediction mode index may also be referred to as predModeIntra. The intra prediction mode index indicates the index number. PredModeIntra for planar mode and predModeIntra for DC mode (planar mode and DC mode are non-angular intra prediction modes) can be set to 0 and 1, respectively.
[0230] refer to Fig.17 , the angular intra prediction mode according to an embodiment may include 33 intra prediction modes obtained by dividing the gap between 45 degrees and -135 degrees by 33. The 33 angular intra prediction modes may sequentially have predModeIntra values of 2 to 34 in a clockwise direction from the direction of -135 degrees. For example, in Fig.17 In the embodiment, the intra-frame prediction mode in which predModeIntra is 2 may indicate an intra-frame prediction mode indicating a diagonal direction in the -135 degree direction, the intra-frame prediction mode in which predModeIntra is 10 may indicate an intra-frame prediction mode indicating a horizontal direction in the -180 (180) degree direction, the intra-frame prediction mode in which predModeIntra is 26 may indicate an intra-frame prediction mode indicating a vertical direction in the 90 degree direction, and the intra-frame prediction mode in which predModeIntra is 34 may indicate an intra-frame prediction mode indicating a diagonal direction in the 45 degree direction.
[0231] refer to Fig.18, the angular intra prediction mode according to another embodiment may include 65 intra prediction modes obtained by dividing the gap between -135 degrees and -180 degrees and the gap between 45 degrees and 180 degrees with respect to the directions of 45 degrees and -135 degrees by 65. The 65 angular intra prediction modes may have predModeIntra values of 2 to 66 in sequence in a clockwise direction from the direction of -135 degrees. For example, in Fig.18 In the embodiment, the intra-frame prediction mode in which predModeIntra is 2 may indicate an intra-frame prediction mode indicating a diagonal direction in the -135 degree direction, the intra-frame prediction mode in which predModeIntra is 18 may indicate an intra-frame prediction mode indicating a horizontal direction in the -180 (180) degree direction, the intra-frame prediction mode in which predModeIntra is 50 may indicate an intra-frame prediction mode indicating a vertical direction in the 90 degree direction, and the intra-frame prediction mode in which predModeIntra is 66 may indicate an intra-frame prediction mode indicating a diagonal direction in the 45 degree direction.
[0232] Fig.18 The angle intra prediction mode may further include modes 67 to 80 whose prediction directions are opposite to those of modes 3 to 16. The prediction directions of modes 67 to 80 are included in the range between 0 degrees and 45 degrees. In addition, Fig.18 The angular intra prediction mode may further include modes No. -14 to No. -1 whose prediction directions are opposite to those of modes No. 52 to No. 65. The prediction directions of modes No. -14 to No. -1 are included in the range between -135 degrees and -90 degrees.
[0233] However, the predModeIntra value of the intra prediction mode is not limited to Fig.17 and Fig.18 The value shown in , and can be changed. For example, the number of angular intra prediction modes in a clockwise direction from a direction of 45 degrees may not be limited to 33 or 65, and may be changed, and the predModeIntra value of the angular intra prediction mode may be set sequentially in a counterclockwise direction from a direction of 45 degrees, and the set predModeIntra value is also changed. The angular intra prediction mode is not limited to this, and may include a predetermined number of intra prediction modes indicating a specific direction within a range between random A degrees (where "A" is a real number) and B degrees (where "B" is a real number).
[0234] Consider the square shape to set Fig.17 Intra prediction mode to Fig.18 However, as mentioned above, Figures 3 to 5As described above, according to an embodiment, the data units including the coding unit, the prediction unit, and the transform unit may each have a square shape or a non-square shape. In addition, according to the 4:2:2 format, even when the luminance block has a square shape, the chrominance component block corresponding thereto may also have a non-square shape. In addition, according to an embodiment, the data unit to be used in the intra prediction may not have a fixed size like a macroblock according to the prior art, but may have various sizes.
[0235] According to an embodiment, when the current block has a non-square shape with a height and a width of m:n (where m and n are integers), Fig.18 Some of the modes 2 to 66 in are not applied to the current block. On the contrary, some of the modes 67 to 80 and the modes -14 to -1 may be applied to the non-square current block. For example, for a current block with a height and width of 1:2, modes 2 to 9 are not applied to the current block. On the contrary, modes 67 to 74 having prediction directions opposite to those of modes 2 to 9 are applied to the current block. As another example, for a current block with a height and width of 2:1, modes 59 to 66 are not applied to the current block. On the contrary, modes -8 to -1 having prediction directions opposite to those of modes 59 to 66 are applied to the current block.
[0236] Determine whether to place the vertices of the current block based on the direction of the vertices of the current block starting from the center of the current block. Fig.18 Which of the modes 2 to 66 is applied to the current block. Similarly, the direction of the vertices of the current block starting from the center of the current block is determined. Fig.18 Which of modes 67 to 80 and modes -14 to -1 is applied to the current block.
[0237] According to an embodiment, Fig.18 The intra prediction direction of is applied not only to square blocks but also to non-square blocks. Therefore, the intra prediction direction for non-square blocks may not be defined separately, such as Fig.18 However, according to an embodiment, the intra prediction direction for a non-square block may be determined in a direction defined separately for the non-square block, without depending on Fig.18 The intra prediction direction.
[0238] According to an embodiment, intra prediction mode candidates to be used in intra prediction of the current block may be adaptively changed considering at least one of the size and shape of the current block.
[0239] Specifically, according to an embodiment, the direction and number of intra-prediction modes to be applied to the current block can be adaptively set in proportion to the size of the current block to be intra-predicted. The number of intra-prediction modes applicable to the current block can be increased in proportion to the size of the current block. In addition, according to an embodiment, blocks can be grouped according to block size, and the number of intra-prediction modes to be applied to a group of larger blocks can be increased. For example, when the size of the current block is equal to or less than 8×8, a minimum number of a intra-prediction modes (where a is a positive integer) can be applied, a number of b intra-prediction modes (where b is a positive integer, b>a) can be applied to 16×16 and 32×32 blocks, and a number of c intra-prediction modes (where c is a positive integer, c>b) can be applied to blocks equal to or greater than 64×64.
[0240] On the other hand, according to another embodiment, the direction and number of intra-frame prediction modes to be applied to the current block can be adaptively set inversely proportional to the size of the current block to be intra-predicted. That is, the number of intra-frame prediction modes applicable to the current block can be reduced in proportion to the size of the current block. In addition, according to an embodiment, blocks can be grouped according to block size, and the number of intra-frame prediction modes to be applied to a group of larger blocks can be reduced. For example, when the size of the current block is equal to or less than 8×8, a maximum of c number of intra-frame prediction modes can be applied, b number of intra-frame prediction modes can be applied to 16×16 and 32×32 blocks, and a number of intra-frame prediction modes can be applied to blocks equal to or greater than 64×64.
[0241] According to another embodiment, the number of intra prediction modes to be applied to blocks of all sizes may be equal regardless of the size of the block.
[0242] According to an embodiment, the number of intra prediction modes may be determined based on an intra prediction mode number flag obtained for a picture unit, a coding tree unit (CTU) unit, or a coding unit (CU).
[0243] In addition, according to another embodiment, the direction and number of intra prediction modes to be applied to the current block may be adaptively set based on the shape of the current block or the height and width of the current block. Specifically, when the current block has a square shape, as described above with reference to Fig.17 and Fig.18 As described above, a predetermined intra prediction mode may be used, and when the current block has a non-square shape, the intra prediction mode may be set to finely indicate one of the height direction and the width direction. Fig.19A and Fig.19B , an embodiment of an intra-frame prediction mode to be applied to a non-square shape will now be described.
[0244] refer to Fig.19A, the intra prediction direction to be applied to the non-square shaped block 1902 may include a first intra prediction direction 1910, which is a direction indicating an upper left vertex from the center of the block 1900; a second intra prediction direction 1920, which is a direction indicating an upper right vertex from the center of the block 1900; and a third intra prediction direction 1930, which is a direction indicating a lower left vertex from the center of the block 1900. In addition, the intra prediction direction to be applied to the non-square shaped block 1902 may include a vertical partial intra prediction direction between the first intra prediction direction 1910 and the second intra prediction direction 1920, and a horizontal partial intra prediction direction between the first intra prediction direction 1910 and the third intra prediction direction 1930.
[0245] According to an embodiment, some intra prediction directions applicable to the square shape block 1900 may also be applied to the non-square shape block 1902. For example, the fourth intra prediction direction 1922, the third intra prediction direction 1930, and the intra prediction direction between the fourth intra prediction direction 1922 and the third intra prediction direction 1930 applicable to the square shape block 1900 may also be applied to the non-square shape block 1902.
[0246] However, since the fifth intra prediction direction 1932 and the intra prediction direction 1940 between the third intra prediction direction 1930 and the fifth intra prediction direction 1932 indicate the lower portion of the non-square shaped block 1902, they are not used for intra prediction of the non-square shaped block 1902. On the other hand, the second intra prediction direction 1920 and the intra prediction direction 1950 between the second intra prediction direction 1920 and the fourth intra prediction direction 1922, which are not applied to the square shaped block 1900, may be applied to the non-square shaped block 1902.
[0247] According to an embodiment, the number of horizontal partial intra prediction directions and the number of vertical partial intra prediction directions may be set based on the width and height of the block. With respect to a non-square shaped block, the number of intra prediction directions indicating the long side may be set to be greater than the number of intra prediction directions indicating the short side. For example, since the block 1902 has a width greater than its height, the number of vertical partial intra prediction directions indicating the top side is set to be greater than the number of horizontal partial intra prediction directions indicating the left side.
[0248] However, since the angular range of the vertical portion intra prediction direction is greater than the angular range of the horizontal portion intra prediction direction, even when the number of vertical portion intra prediction directions is greater than the number of horizontal portion intra prediction directions, the density of the vertical portion intra prediction directions may be equal to the density of the horizontal portion intra prediction directions. The density refers to a value obtained by dividing the number of intra prediction directions by the angular range of the intra prediction directions.
[0249] According to an embodiment, the number of vertical partial intra prediction directions may be set to be equal to the number of horizontal partial intra prediction directions. In the above case, since the angular range of the vertical partial intra prediction directions is greater than the angular range of the horizontal partial intra prediction directions, the density of the vertical partial intra prediction directions is greater than the density of the horizontal partial intra prediction directions.
[0250] In addition, with respect to a non-square shaped block, the number of intra-prediction directions indicating long sides may be set smaller than the number of intra-prediction directions indicating short sides. Fig.19A In the embodiment of the present invention, the number of horizontal portion intra prediction directions may be set to be greater than the number of vertical portion intra prediction directions.
[0251] According to various embodiments, a horizontal intra prediction direction in a 180 degree direction and a vertical intra prediction direction in a 90 degree direction are generally determined as intra prediction directions, so that the intra prediction directions can be set to densely indicate a horizontal direction in a 180 degree direction or a vertical direction in a 90 degree direction.
[0252] According to another embodiment, with respect to a non-square shaped block, an angle between intra prediction directions indicating sides far from the center of the block may be set to be smaller than an angle between intra prediction directions indicating sides close to the center of the block. Fig.19B , the distance between the center and the left side of the block 1902 may be greater than the distance between the center and the top side of the block 1902. Therefore, the angle between the horizontal part intra prediction directions of the block 1902 may be set to be smaller than the angle between the vertical part intra prediction directions of the block 1902.
[0253] For example, two additional horizontal partial intra prediction directions 1960 may be added to the horizontal partial intra prediction directions. The two additional horizontal partial intra prediction directions 1960 may be positioned between the first horizontal intra prediction direction 1970, the second horizontal intra prediction direction 1972, and the third horizontal intra prediction direction 1974. Furthermore, although Fig.19B Not shown in FIG. 19 , instead of adding two additional horizontal partial intra prediction directions 1960 to block 1902 , two of the illustrated vertical intra prediction directions may be excluded from the intra prediction directions of block 1902 .
[0254] refer to Fig.19A , the intra prediction direction is described with respect to a block whose width is greater than its height, and the above technical characteristics can be applied to a block whose height is greater than its width.
[0255] Fig. 20The invention is a flow chart of an embodiment of a method for determining an intra prediction direction candidate to be applied to a current block from a first intra prediction direction candidate and a second intra prediction direction candidate. The first intra prediction direction candidate indicates an intra prediction direction to be applied to a square block. The second intra prediction direction candidate indicates an intra prediction direction to be applied to a non-square block.
[0256] When the second intra prediction direction candidate is not allowed, only Fig.18 The intra prediction modes with index numbers 2 to 66 can be applied to non-square blocks. When the second intra prediction direction candidate is allowed, Fig.18 Modes -14 to -1 and modes 67 to 80 apply to non-square blocks.
[0257] In operation 210, intra-frame prediction direction adjustment information indicating whether the second intra-frame prediction direction candidate is allowed to be used is obtained. The intra-frame prediction direction adjustment information can be obtained for a video unit, a sequence unit, a frame unit, a CTU unit, or a CU unit. According to the intra-frame prediction direction adjustment information, when the second intra-frame prediction direction candidate is not allowed, all blocks are predicted according to the first intra-frame prediction direction candidate.
[0258] In operation 2020, it is determined whether the current block is a square. When the current block is a square, operation 2050 is performed. When the current block is not a square, operation 2030 is performed.
[0259] In operation 2030, it is determined whether the second intra prediction direction candidate is allowed for the current block according to the intra prediction direction adjustment information. When the second intra prediction direction candidate is not allowed, operation 2050 is performed. When the second intra prediction direction candidate is allowed, operation 2040 is performed.
[0260] In operation 2040, it is determined whether the upper left block and / or the lower right block of the current block have been reconstructed. For example, when the width of the current block is greater than its height, it may be determined whether the upper right neighboring block of the current block has been decoded. Alternatively, when the height of the current block is greater than its width, it may be determined whether the lower left neighboring block of the current block has been decoded. When the upper left block and / or the lower right block of the current block have not been reconstructed, operation 2050 is performed. When the upper left block and / or the lower right block of the current block have been reconstructed, operation 2060 is performed.
[0261] In operation 2050, an intra prediction direction according to an intra prediction mode of a current block is determined according to the first intra prediction direction candidate. In operation 2060, an intra prediction direction according to an intra prediction mode of a current block is determined according to a second intra prediction direction candidate.
[0262] According to an embodiment, the order of operations 2020 and 2030 may be exchanged. Therefore, after determining whether the second intra prediction direction candidate is allowed for the current block based on the intra prediction direction adjustment information, when the second intra prediction direction candidate is allowed, it may be determined whether the current block is a square.
[0263] According to an embodiment, operations 2010 and 2030 may be omitted. Therefore, intra prediction direction candidates to be applied to the current block may be determined without intra prediction direction adjustment information.
[0264] According to an embodiment, operation 2040 may be omitted. Therefore, regardless of whether the upper left block and / or the lower right block of the current block has been reconstructed, an intra prediction direction candidate to be applied to the current block may be determined.
[0265] According to an embodiment, an operation of determining intra prediction direction candidates to be applied to the current block according to the size of the current block may be included.
[0266] Hereinafter, a method of determining intra prediction direction candidates for a current block based on a shape of the current block and determining the intra prediction direction of the current block from among the intra prediction direction candidates will now be described.
[0267] The processor 1610 obtains intra prediction mode information of the current block from the bitstream. Then, the processor 1610 determines the intra prediction mode of the current block based on the intra prediction mode information of the current block.
[0268] According to an embodiment, the processor 1610 may configure a most probable mode (MPM) list by using the intra prediction modes of neighboring blocks of the current block. Then, the processor 1610 may determine the intra prediction mode of the current block based on the determined MPM list.
[0269] Hereinafter, an MPM list used when the processor 1610 determines an intra prediction mode will now be described in detail.
[0270] As described above, a total of 35 or 67 intra prediction modes including two non-angle modes of the DC mode and the planar mode, and 33 or 65 angle prediction modes can be used. As the number of intra prediction modes increases, the amount of information indicating the intra prediction mode of the current block may increase. In general, when an image is processed by segmenting into blocks, there is a high possibility that the current block and its neighboring blocks have similar image characteristics. Therefore, there is a high possibility that the intra prediction mode of the intra-predicted current block is equal to or similar to the intra prediction mode of the neighboring block. According to various embodiments, based on the fact that there is a high possibility of similar characteristics between adjacent blocks, an intra prediction mode candidate list including candidate intra prediction modes can be obtained by using the prediction mode information of the neighboring blocks of the current block, and the candidate intra prediction mode has a high possibility of being the intra prediction mode of the current block. In the following, the intra prediction mode candidate list obtained by using the prediction mode information of the neighboring blocks may be referred to as an MPM list.
[0271] When the intra-frame prediction mode of the current block is one of the intra-frame prediction modes in the MPM list, the amount of bits required to signal the intra-frame prediction mode of the current block can be reduced. For example, when the number of all intra-frame prediction modes is 67, at least 7 bits are required to signal one of the 67 intra-frame prediction modes. However, when 5 or 6 MPM lists are used, there is a high possibility that the intra-frame prediction mode of the current block is determined to be one of the intra-frame prediction modes in the MPM list, and even when the intra-frame prediction mode of the current block is not included in the MPM list, except for 5 or 6 MPM lists, the remaining intra-frame prediction modes can be signaled by using only 6 bits. Therefore, when the MPM list is used, the amount of all bits required to signal the intra-frame prediction mode of the block of the intra-frame prediction in the block constituting the picture can be reduced.
[0272] The MPM list may be obtained by using prediction mode A of a left neighboring block and prediction mode B of an upper neighboring block processed before the current block. The left neighboring block may be a block including pixels located to the left of a lower left pixel located at a lower left vertex of the current block.
[0273] In the following, in the embodiment of the MPM list determination method, it is assumed that a total of Fig.18The 67 intra prediction modes including two non-angular intra prediction modes (plane and DC) and 65 angular intra prediction modes are shown, and predmodeIntra of the plane mode is 0, predModeIntra of the DC mode is 1, and predModeIntra of 2 to 66 is set to the angular intra prediction mode in a clockwise direction. As described above, predModeIntra indicating the intra prediction mode of the horizontal direction (H) can be set to 18, and predModeIntra indicating the intra prediction mode of the vertical direction (V) can be set to 50. In addition, it is assumed that 6 intra prediction mode candidates are included in the MPM list.
[0274] According to an embodiment, first, the availability of the left adjacent block and the upper adjacent block is checked. When it is determined that the adjacent block included in the tile or slice different from the current block or the adjacent block of the inter-frame prediction is unavailable, the intra-frame prediction mode of the adjacent block determined to be unavailable is set to the plane mode with predModeIntra being 0 as the default. When the adjacent block is included in the same tile or slice as the current block and is intra-predicted, the intra-frame prediction mode of the adjacent block is unchanged set to the intra-frame prediction mode of the adjacent block. When the intra-frame prediction modes of the left adjacent block and the upper adjacent block are both non-angle intra-frame prediction modes, that is, plane modes or DC modes, the MPM list may include {plane, DC, H, V, V+4, V-4} or may include {plane, DC, H, V, H+4, H-4}. H represents the horizontal intra-frame prediction mode, and V represents the vertical intra-frame prediction mode. For example, in the case where the intra prediction mode of the left neighboring block is the DC intra prediction mode (predModeIntra=1) and the upper neighboring block is the planar mode (predModeIntra=0), the MPM list may include {0, 1, 50, 18, 46, 54} or {0, 1, 50, 18, 14, 22}.
[0275] In the case where one of the intra prediction modes of the left neighboring block and the upper neighboring block is a non-angular intra prediction mode and the other is an angular intra prediction mode, the larger intra prediction mode index of the intra prediction mode indexes A and B of the left neighboring block and the upper neighboring block is set to maxAB. That is, when it is assumed that the predModeIntra of the intra prediction mode of the left neighboring block is A and the predModeIntra of the intra prediction mode of the upper neighboring block is B, maxAB=Max(A,B). In this case, the MPM list may include {plane, maxAB, DC, maxAB-1, maxAB+1, maxAB-2}. For example, in the case where the intra prediction mode of the left neighboring block has an intra prediction mode index of 60 (predModeIntra=60) and the upper neighboring block is a DC mode (predModeInta=1), maxAB=Max(60,1)=60, and the MPM list includes {0,60,1,59,61,58}.
[0276] When the intra prediction modes of the left neighboring block and the upper neighboring block are both angular intra prediction modes and are not the same intra prediction modes, the MPM list can be set based on the angular difference between the intra prediction modes of the left neighboring block and the upper neighboring block. When the value of the difference between the predModeIntra(A) of the left neighboring block and the predModeIntra(B) of the upper neighboring block is within a predetermined range, for example, between 2 and 62, the MPM list may include {plane, A, B, DC, maxAB-1, maxAB+1}. For example, in the case where the intra prediction mode of the left neighboring block has a predModeIntra of 60 and the upper neighboring block has a predModeIntra of 50, the value of the difference between the predModeIntra(A) of the left neighboring block and the predModeIntra(B) of the upper neighboring block is included in the range of 2 to 60, and therefore, the MPM list includes {0, 60, 50, 1, 59, 61}.
[0277] In the case where the value of the difference between the predModeIntra(A) of the left neighboring block and the predModeIntra(B) of the upper neighboring block is less than 2 or greater than 62, the MPM list may include {plane, A, B, DC, maxAB-2, maxAB+2}. For example, in the case where the intra prediction mode of the left neighboring block has a predModeIntra of 3 and the upper neighboring block has a predModeIntra of 4, the MPM list includes {0, 3, 4, 1, 2, 6}.
[0278] When the intra prediction modes of the left neighboring block and the upper neighboring block are both angular intra prediction modes and are the same intra prediction mode, the MPM list may include {plane, A, A-1, A+1, DC mode, A-2} or {plane, B, B-1, B+1, DC mode, B-2}. For example, when all intra prediction modes of the left neighboring block and the upper neighboring block have predModeIntra of 60, the MPM list may include {0, 60, 59, 61, 1, 58}.
[0279] In the process of encoding / decoding the current block, various tools including multi-reference line extension, in which, as reference samples of the current block, not only adjacent samples adjacent to the current block but also adjacent samples away from the current block by a predetermined distance are selectively used; intra-frame sub-division, in which a block to be intra-predicted is divided into sub-partitions; a hybrid prediction method combining inter-frame prediction and intra-frame prediction, etc. can be used. In order to reduce complexity, the MPM list can be selectively set according to the tool used in the encoding process of the current block. For example, when multi-reference line extension is used in the encoding process of the current block, the plane mode and the DC mode can be excluded from the MPM list, and when the intra-frame sub-division is used, the DC mode can be excluded from the MPM list. For blocks for which neither multi-reference line extension nor intra-frame sub-division is used, the plane mode and the DC mode are included in the MPM list, so that the complexity of setting the MPM list can be reduced. However, when the MPM list generation scheme is changed according to whether a specific tool is used, the possibility of selecting an intra-frame prediction mode that is biased towards the specific tool may increase.
[0280] According to an embodiment, the MPM list may be selectively used based on the encoding information of the intra-predicted current block. In other words, according to an embodiment, it is not the case that the MPM list is used for all intra-predicted current blocks or the intra-prediction mode of the current block is determined from the candidate intra-prediction modes included in the MPM list. The MPM list may be used or the intra-prediction mode of the current block may be determined from the candidate intra-prediction modes included in the MPM list only when the encoding information of the current block satisfies a specific condition.
[0281] According to an embodiment, when the encoding information related to the intra-predicted block satisfies a predetermined condition, an MPM list may be generated without separate flag information. When the encoding information related to the intra-predicted block does not satisfy the predetermined condition, separate flag information related to whether the MPM list is generated for the intra-predicted block may be notified by a signal. In addition, according to an embodiment, before generating the MPM list, it may be first determined whether the intra-prediction mode of the current block is a specific intra-prediction mode (e.g., a non-angle mode), and then when the intra-prediction mode of the current block is not a specific intra-prediction mode, an MPM list may be generated, and the intra-prediction mode of the current block may be determined by using an MPM index (MPM idx) indicating one of the candidate intra-prediction modes included in the MPM list. In addition, it may be determined whether the encoding tool to be used for the current block is applied from the intra-prediction mode candidates included in the MPM list. According to another embodiment, the MPM list of the current block may be generated regardless of the encoding information related to the current block. The encoding information may include information on whether to apply a predetermined encoding tool applied to the current block, reference sample information to be used for intra prediction on the current block, and sub-partition information indicating whether to partition the current block into sub-partitions.
[0282] The intra prediction mode included in the MPM list is determined based on the prediction mode of the left neighboring block of the current block and the prediction mode of the upper neighboring block of the current block. When the current block has a non-square shape, the priority of the MPM included in the MPM list can be determined based on the height and width of the current block.
[0283] For example, when the height of the current block is greater than its width, it may be determined that the priority of the MPM of the intra-frame prediction direction toward the left side of the current block is prioritized over the priority of the MPM of the intra-frame prediction direction toward the top of the current block. Conversely, when the height of the current block is greater than its width, it may be determined that the priority of the MPM of the intra-frame prediction direction toward the top of the current block is prioritized over the MPM of the intra-frame prediction direction toward the left side of the current block.
[0284] For example, when the width of the current block is greater than its height, it may be determined that the priority of the MPM of the intra-frame prediction direction toward the top of the current block takes precedence over the MPM of the intra-frame prediction direction toward the left of the current block. Conversely, when the width of the current block is greater than its height, it may be determined that the priority of the MPM of the intra-frame prediction direction toward the left of the current block takes precedence over the MPM of the intra-frame prediction direction toward the top of the current block. According to an embodiment, the number of MPMs included in the MPM list may be determined regardless of the size of the current block. According to another embodiment, the number of MPMs included in the MPM list may be determined according to the size of the current block. In addition, when a specific intra-frame mode tool is applied to the current block, the number of MPMs included in the MPM list may be determined according to the size of the current block. For example, when a matrix-based intra-frame prediction (MIP) mode is applied to the current block, the number of MPMs included in the MPM list may be determined according to the size and / or shape of the current block.
[0285] According to an embodiment, the number of MPMs included in the MPM list may be determined according to whether a specific intra mode tool is to be applied to the current block. For example, when the MIP mode is to be applied to the current block, the number of MPMs included in the MPM list may be determined. When the MIP mode is not to be applied to the current block, 5 MPMs may be included in the MPM list. Alternatively, when the MIP mode is not to be applied to the current block, 5 MPMs in the intra prediction mode other than the plane mode may be included in the MPM list. Whether the plane mode is to be applied to the current block may be determined based on the plane mode flag, and when the plane mode is not to be applied, the intra prediction mode of the current block may be determined based on the MPM list.
[0286] When the MIP mode is to be applied to the current block, 3 MPMs may be included in the MPM list. Alternatively, when the MIP mode is to be applied to the current block, the intra prediction mode may be encoded without generating the MPM list.
[0287] In the case where 65 or more intra prediction modes are used in intra prediction of the current block, the remaining intra prediction modes except the intra prediction modes of the MPM list may be represented as 6 bits. Alternatively, the remaining intra prediction modes except the intra prediction modes of the MPM list may be divided into two groups. Then, the intra prediction modes of one group may be represented as 5 bits, and the intra prediction modes of the other group may be represented as 6 bits.
[0288] The auxiliary MPM list may be additionally determined from the remaining intra-frame prediction modes other than the intra-frame prediction modes of the MPM list. The remaining intra-frame prediction modes other than the intra-frame prediction modes of the MPM list and the auxiliary MPM list may be represented as 6 bits. In addition, the remaining intra-frame prediction modes other than the intra-frame prediction modes of the MPM list and the auxiliary MPM list may be divided into two groups, and the intra-frame prediction modes of one group may be represented as 5 bits, while the intra-frame prediction modes of the other group may be represented as 6 bits. Therefore, the intra-frame prediction mode with a relatively high usage frequency may be set to be represented as 5 bits.
[0289] According to an embodiment, in Fig.18 In the case where 67 intra prediction modes are used in intra prediction of the current block, when the number of MPMs is greater than 3, the number of remaining intra prediction modes other than MPMs is less than 64. For example, when the number of MPMs is 6, the number of remaining intra prediction modes other than MPMs is 61. On the other hand, when the remaining intra prediction modes are represented as 6 bits, the remaining intra prediction modes may include 64 intra prediction modes. Therefore, the remaining intra prediction modes may be additionally included in Fig.18 There are 3 intra prediction modes not defined in .
[0290] According to an embodiment, by combining the prediction values of two or more intra prediction modes, the remaining intra prediction modes may include a combined prediction mode for predicting the current block. For example, according to the combined prediction mode in which the vertical mode and the horizontal mode are combined, the prediction value of the corresponding sample may be determined by averaging the prediction value according to the vertical mode and the prediction value according to the horizontal mode. Alternatively, the prediction value of the corresponding sample may be determined by weighted averaging the prediction value according to the vertical mode and the prediction value according to the horizontal mode.
[0291] The combined prediction mode may correspond to a combination of an angular intra prediction mode and a DC mode. Alternatively, the combined prediction mode may correspond to a combination of an angular intra prediction mode and a plane mode. The combined prediction mode may correspond to a combination of two or more intra prediction modes in the MPM list. Alternatively, the combined prediction mode may correspond to a combination of two or more intra prediction modes having the highest frequency among intra prediction modes of a block decoded before the current block.
[0292] The combined prediction mode may correspond to a combination of an intra-frame prediction mode indicating the rightmost direction within the intra-frame prediction direction range and an intra-frame prediction mode indicating the leftmost direction within the intra-frame prediction direction range. Fig.18 In the case where the current block has a non-square shape with a ratio of its height to width of 1:2, the combined prediction mode can be Fig.18The pattern corresponds to the combination of pattern 10 and pattern 74.
[0293] According to an embodiment, the remaining intra prediction modes may include intra prediction modes not included in the intra prediction direction range. For example, when the current block has a square shape, the remaining intra prediction modes may include a plurality of intra prediction modes from mode 67 to mode 80 and mode -14 to mode -1.
[0294] The processor 1610 may determine the intra prediction mode of the current block according to the intra prediction mode information and the size of the current block.
[0295] According to an embodiment, when the intra prediction mode of the current block is the angular intra prediction mode, the processor 1610 determines the intra prediction direction of the current block corresponding to the intra prediction mode of the current block based on the height and width of the current block.
[0296] When the current block has a square shape having equal width and height, the processor 1610 determines a first intra prediction direction candidate indicated by an intra prediction mode from among a plurality of first intra prediction direction candidates set based on the square shape as an intra prediction direction of the current block.
[0297] When the current block has a non-square shape with unequal width and height, the processor 1610 determines a second intra prediction direction candidate indicated by the intra prediction mode from among a plurality of second intra prediction direction candidates set based on the non-square shape as the intra prediction direction of the current block.
[0298] According to an embodiment, when the current block has a non-square shape whose width is greater than its height, instead of the preset number of intra-prediction directions selected in the lower left direction among the first intra-prediction direction candidates, the second intra-prediction direction candidates may include intra-prediction directions set in the upper right direction in addition to the intra-prediction directions included in the first intra-prediction direction candidates. In addition, when the current block has a non-square shape whose height is greater than its width, instead of the preset number of intra-prediction directions selected in the upper right direction among the first intra-prediction direction candidates, the second intra-prediction direction candidates may include intra-prediction directions set in the lower left direction in addition to the intra-prediction directions included in the first intra-prediction direction candidates.
[0299] According to an embodiment, in addition to the intra prediction direction included in the first intra prediction direction candidate, the intra prediction direction included in the second intra prediction direction candidate may indicate a direction opposite to a specific direction indicated by the replacement intra prediction direction included in the first intra prediction direction candidate.
[0300] According to an embodiment, when the current block has a non-square shape whose width is greater than its height, in addition to the first intra-frame prediction direction candidate, the second intra-frame prediction direction candidate may further include an intra-frame prediction direction indicating a direction close to the horizontal direction. In addition, when the current block has a non-square shape whose height is greater than its width, in addition to the first intra-frame prediction direction candidate, the second intra-frame prediction direction candidate may further include an intra-frame prediction direction indicating a direction close to the vertical direction.
[0301] According to an embodiment, the second intra prediction direction candidate may be determined according to a ratio of a height and a width of a current block having a non-square shape. Fig.19A and Fig.19B In the example, the ratio of the height and width of the block 1902 is 1:2, and the intra prediction direction candidates of the block 1902 are determined by deleting unnecessary intra prediction directions from the intra prediction direction candidates of the block 1902 and adding necessary intra prediction directions thereto. When the ratio of the height and width of the block includes 1:4, 1:8, 1:16, 2:1, 4:1, 8:1, and 16:1, the intra prediction direction candidates of the block 1902 may be determined according to the reference Fig.19A and Fig.19B In addition, when the ratio of the height and width of the block includes 2^n:1 and 1:2^n (where n is an integer), it can be predetermined according to the reference Fig.19A and Fig.19B The described method indicates an intra prediction direction lookup table of intra prediction direction candidates.
[0302] Even when the ratio of the height and width of the block includes 2^n:m and m:2^n (where n is an integer and m is an odd number other than 1), the intra-prediction direction lookup table can be set and used. However, when the intra-prediction direction lookup table is set even when the ratio of the height and width of the block includes 2^n:m and m:2^n, the coding complexity will increase. Therefore, for the above situation, an intra-prediction direction lookup table predetermined for a similar ratio of height and width can be used. For example, when the ratio of the height and width of the block is 3:4, 4:3, 7:8 or 8:7, the intra-prediction direction lookup table used when the ratio of the height and width of the block is 1:1 can be used for the block. As another example, when the ratio of the height and width of the block is 3:8 or 5:8, the intra-prediction direction lookup table used when the ratio of the height and width of the block is 1:2 can be used for the block. In addition, when the ratio of the height and width of the block is 8:3 or 8:5, the intra prediction direction lookup table used when the ratio of the height and width of the block is 2:1 may be used for the block.
[0303] According to another embodiment, when the difference between the size of the height and width of the block is large, a specific intra-prediction direction lookup table may be used. For example, when the difference between the size of the height and width of the current block is at least 8 times, the intra-prediction direction lookup table used when the ratio of the height and width of the block is 4:1 or 1:4 may be used for the current block. As another example, when the difference between the size of the height and width of the current block is at least 16 times, the intra-prediction direction lookup table used when the ratio of the height and width of the block is 8:1 or 1:8 may be used for the current block.
[0304] According to an embodiment, when the current block has a square shape, the priority of the MPM included in the MPM list may be determined according to the density of the horizontal intra prediction direction group and the vertical intra prediction direction group. The horizontal intra prediction direction group includes a horizontal partial intra prediction direction indicating the left or right side of the current block. The vertical intra prediction direction group includes a vertical partial intra prediction direction indicating the top side of the current block. Therefore, the first intra prediction direction candidate is divided into a horizontal intra prediction direction group and a vertical intra prediction direction group.
[0305] Density refers to a value obtained by dividing the number of intra-frame prediction direction candidates by the angular range of the intra-frame prediction direction candidates. For example, when the length of an edge is small and the number of intra-frame prediction direction candidates for the edge is large, the density of intra-frame prediction direction candidates for the edge is large. On the other hand, when the length of an edge is large and the number of intra-frame prediction direction candidates for the edge is small, the density of intra-frame prediction direction candidates for the edge is small.
[0306] According to an embodiment, when the current block has a non-square shape with unequal width and height and the number of intra-prediction directions in the horizontal intra-prediction direction group and the number of intra-prediction directions in the vertical intra-prediction direction group are equal, the density of the intra-prediction direction group of the small side is greater than the density of the intra-prediction direction group of the large side. In the above case, the MPM from the intra-prediction direction group of the small side may be set to be prioritized over the MPM from the intra-prediction direction group of the large side in the MPM list. In addition, according to an embodiment, the priorities of the MPMs may be determined inversely.
[0307] According to an embodiment, when the current block has a non-square shape with unequal width and height and the density of the horizontal intra prediction direction group and the vertical intra prediction direction group is equal, the number of intra prediction directions of the intra prediction direction group of the large side is greater than the number of intra prediction directions of the intra prediction direction group of the small side. In the above case, the MPM from the intra prediction direction group of the large side may be set to be prioritized over the MPM from the intra prediction direction group of the small side in the MPM list. In addition, according to an embodiment, the priorities of the MPMs may be determined oppositely.
[0308] According to an embodiment, when the current block has a non-square shape with unequal width and height, the density of the horizontal intra-frame prediction direction group and the vertical intra-frame prediction direction group may be set to be different from each other, and the number of intra-frame prediction directions in the horizontal intra-frame prediction direction group and the number of intra-frame prediction directions in the vertical intra-frame prediction direction group may be set to be different from each other. In this regard, when the density of the intra-frame prediction direction group of the small side is less than a predetermined threshold, the MPM of the intra-frame prediction direction group from the large side may be set to be prioritized over the MPM of the intra-frame prediction direction group from the small side in the MPM list. In addition, when the density of the intra-frame prediction direction group of the small side is greater than the predetermined threshold, the MPM of the intra-frame prediction direction group from the small side may be set to be prioritized over the MPM of the intra-frame prediction direction group from the large side in the MPM list.
[0309] According to an embodiment, the processor 1610 may obtain intra-prediction mode group information indicating an intra-prediction direction group including an intra-prediction direction of an intra-prediction mode of a current block. Then, the processor 1610 may determine an intra-prediction direction group of the current block according to the intra-prediction mode group information. The intra-prediction direction group may include a left intra-prediction direction group and an upper intra-prediction direction group. Alternatively, the intra-prediction direction group may include a right intra-prediction direction group instead of a left intra-prediction direction group, depending on the coding order.
[0310] The processor 1610 may obtain intra prediction mode information indicating the intra prediction mode of the current block from the intra prediction direction group of the current block. Then, the processor 1610 may determine the intra prediction mode of the current block from the intra prediction direction group of the current block based on the intra prediction mode information.
[0311] For example, when the left intra prediction direction group is selected according to the intra prediction mode group information, the processor 1610 may determine the MPM list according to the intra prediction mode and the non-angle intra prediction mode of the left intra prediction direction group. Then, the processor 1610 may predict the current block by using the intra prediction mode of the MPM list. Alternatively, when the intra prediction mode of the MPM list is not used, the processor 1610 may determine the intra prediction mode of the current block from the intra prediction mode of the left intra prediction direction group and the non-angle intra prediction mode of the intra prediction mode not included in the MPM list.
[0312] Similarly, when the upper intra prediction direction group is selected according to the intra prediction mode group information, the processor 1610 may determine the MPM list according to the intra prediction mode and the non-angle intra prediction mode of the upper intra prediction direction group. Then, the processor 1610 may predict the current block by using the intra prediction mode of the MPM list. Alternatively, when the intra prediction mode of the MPM list is not used, the processor 1610 may determine the intra prediction mode of the current block from the intra prediction mode of the intra prediction mode and the non-angle intra prediction mode of the intra prediction mode from the upper intra prediction direction group that is not included in the MPM list.
[0313] According to an embodiment, when the MPM list is not completed by the intra prediction blocks of the left and right blocks of the current block, a default intra prediction mode may be included in the MPM list. For example, when 3 intra prediction modes are included in the MPM list, the MPM list may include 1 to 3 default intra prediction modes and the intra prediction blocks of the left and right blocks of the current block. The default intra prediction mode may include a non-angular intra prediction mode such as a DC mode and a planar mode. In addition, the default intra prediction mode may include not only a non-angular intra prediction mode, but also a planar mode such as a DC mode. Fig.21 Angular intra prediction modes of the intra prediction mode group are shown.
[0314] Fig.21 An angular intra prediction mode included in the default intra prediction mode is shown.
[0315] The MPM list may first include the intra prediction modes of the upper and left blocks of the current block, and may include the non-angular intra prediction mode in the default intra prediction mode. Then, the MPM list may include the angular intra prediction mode in the default intra prediction mode.
[0316] The default intra prediction mode may include non-angular intra prediction modes such as DC mode and planar mode as well as Fig.21 . When the intra prediction mode group is the left intra prediction mode group, the five intra prediction modes 2100, 2102, 2104, 2106, and 2108 may be sequentially included in the default intra prediction mode. When the intra prediction mode group is the upper intra prediction mode group, the five intra prediction modes 2110, 2112, 2104, 2114, and 2116 may be sequentially included in the default intra prediction mode.
[0317] For example, when the 3 angular intra prediction modes in the default intra prediction mode must be included in the MPM list and the intra prediction mode group is a left intra prediction mode group, the 3 intra prediction modes 2100, 2102, and 2104 may be sequentially included in the MPM list. In the same case as above, when the intra prediction mode group is an upper intra prediction mode group, the 3 intra prediction modes 2110, 2112, and 2104 may be sequentially included in the MPM list.
[0318] Fig.21 The embodiments are exemplary, and the angular intra prediction mode to be included in the default intra prediction mode may vary.
[0319] According to an embodiment, a default intra-frame prediction mode may be determined from intra-frame prediction modes for a plurality of blocks in a current picture, the plurality of blocks having been decoded before the current block. For example, an intra-frame prediction mode to be included in the default intra-frame prediction mode may be determined from intra-frame prediction modes for a plurality of blocks decoded before the current block according to the frequency of use. The most frequently used intra-frame prediction mode among the intra-frame prediction modes for blocks decoded before the current block may be included in the default intra-frame prediction mode. In addition, an intra-frame prediction mode with a high frequency of use may be determined as a high-priority default intra-frame prediction mode.
[0320] According to an embodiment, a default intra-frame prediction mode may be determined from intra-frame prediction modes for a plurality of blocks in a current picture, the plurality of blocks having the same shape as the current block and having been decoded before the current block. For example, when the current block has a rectangular shape with a height-to-width ratio of 1:2, the intra-frame prediction mode to be included in the default intra-frame prediction mode may be determined from intra-frame prediction modes for blocks with a height-to-width ratio of 1:2 and having been decoded before the current block according to the frequency of use. When the current block has a rectangular shape with a height-to-width ratio of 1:2, the most frequently used intra-frame prediction mode in the intra-frame prediction modes for blocks with a height-to-width ratio of 1:2 and having been decoded before the current block may be included in the default intra-frame prediction mode. In addition, an intra-frame prediction mode with a high frequency of use may be determined as a high-priority default intra-frame prediction mode.
[0321] According to an embodiment, an MPM flag indicating whether to apply the intra prediction mode of the MPM list to the current block may be obtained before the intra prediction mode group information. Therefore, when the intra prediction mode of the MPM list is to be applied to the current block, the intra prediction mode group information may be omitted.
[0322] According to an embodiment, when the intra prediction mode of the neighboring block of the current block or the intra prediction mode of the MPM list of the neighboring block is included in a specific intra prediction mode group, and the specific intra prediction mode group includes the intra prediction mode indicating the small side of the current block, the intra prediction mode group information can be omitted. For example, the intra prediction mode of the MPM list of the left block and the upper block of the current block is the left intra prediction mode group, and the height of the current block is less than its width, the intra prediction mode group information can be omitted.
[0323] According to an embodiment, the intra-frame prediction mode group information may be omitted according to the availability of the reference samples of the current block. For example, when all the upper reference samples of the current block are unavailable, it is very likely that the intra-frame prediction mode of the upper intra-frame prediction mode group will not be used in the current block. Therefore, without obtaining the intra-frame prediction mode group information, the current block may be predicted according to the intra-frame prediction mode of the left intra-frame prediction mode group. Similarly, when all the left reference samples of the current block are unavailable, it is very likely that the intra-frame prediction mode of the left intra-frame prediction mode group will not be used in the current block. Therefore, without obtaining the intra-frame prediction mode group information, the current block may be predicted according to the intra-frame prediction mode of the upper intra-frame prediction mode group. Therefore, when all the upper reference samples or all the left reference samples of the current block are unavailable, the intra-frame prediction mode group information may be omitted.
[0324] The intra prediction mode group information may be applied to all of the luminance block and the chrominance blocks corresponding to the luminance block. Alternatively, a plurality of pieces of intra prediction mode group information may be obtained for the luminance block and the chrominance blocks, respectively.
[0325] According to an embodiment, the processor 1610 may differently determine the number of MPMs of the MPM list determined in response to the selection of the left intra-frame prediction direction group and the number of MPMs of the MPM list determined in response to the selection of the upper intra-frame prediction direction group. For example, the number of MPMs of the MPM list may be determined according to the number of intra-frame prediction directions included in the intra-frame prediction direction group. For example, when the size of the current block is 32×8, the number of MPMs of the MPM list of the upper intra-frame prediction direction group may be determined to be 3, and the number of MPMs of the MPM list of the left intra-frame prediction direction group may be determined to be 1. In addition, the number of intra-frame prediction directions included in the intra-frame prediction direction group may be proportional to the number of MPMs of the MPM list.
[0326] The embodiments of the MPM list in this specification may be applied to all blocks. Alternatively, the embodiments of the MPM list in this specification may be applied only to non-square blocks. The processor 1610 may entropy decode the information of the MPM list according to the context model corresponding to the shape of the block. For example, the processor 1610 may entropy decode the MPM flag indicating whether to use the MPM in the MPM list, the MPM index indicating the intra-frame prediction mode of the current block in the MPM list, and the remaining intra-frame mode flags indicating the intra-frame prediction mode of the current block other than the MPM list in the intra-frame prediction mode, etc. according to the context model corresponding to the shape of the block. In addition, the processor 1610 may entropy decode the intra-frame prediction mode group information, the intra-frame prediction mode information, etc. according to the context model corresponding to the shape of the block.
[0327] The context model associated with the MPM list can be divided into a context model associated with a square block and a context model associated with a non-square block. In addition, the context model associated with the MPM list can be classified into multiple context models according to the ratio of the height and width of the block. In addition, the context model associated with the MPM list can be divided into a context model associated with a non-square block long in the horizontal direction and a context model associated with a non-square block long in the vertical direction. Alternatively, the context model can be equally applied to non-square blocks long in the horizontal direction and non-square blocks long in the vertical direction.
[0328] According to an embodiment, the processor 1610 may obtain intra-frame prediction direction adjustment information of a video unit, a sequence unit, a frame unit, a CTU unit, or a CU unit, and the intra-frame prediction direction adjustment information indicates whether the second intra-frame prediction direction candidate is allowed to be used. Alternatively, the processor 1610 may not obtain the intra-frame prediction direction adjustment information, and may determine whether the second intra-frame prediction direction candidate is allowed to be used according to the size of the current block. Alternatively, the processor 1610 may not obtain the intra-frame prediction direction adjustment information, and may determine whether the second intra-frame prediction direction candidate is allowed to be used according to whether the second intra-frame prediction direction candidate is allowed to be used for the neighboring blocks of the current block.
[0329] According to an embodiment, the intra prediction direction adjustment information may be applied to all of the luminance block and the chrominance blocks corresponding to the luminance block. Alternatively, a plurality of pieces of intra prediction mode group information may be obtained for the luminance block and the chrominance block, respectively.
[0330] According to an embodiment, the processor 1610 may determine whether to allow the use of the second intra-frame prediction direction candidate according to whether the neighboring blocks of the current block have been decoded. For example, whether the second intra-frame prediction direction candidate is allowed may be determined according to whether at least one of the upper right neighboring block and the lower left neighboring block of the current block has been decoded. In another embodiment, when the width of the current block is greater than its height, it may be determined whether the second intra-frame prediction direction candidate is allowed according to whether the upper right neighboring block has been decoded. Alternatively, when the height of the current block is greater than its width, it may be determined whether the second intra-frame prediction direction candidate is allowed according to whether the lower left neighboring block has been decoded.
[0331] According to an embodiment, when the right block of the current block is decoded first according to the segmentation unit coding order (SUCO) mode, the processor 1610 can determine whether to allow the second intra-frame prediction direction candidate according to whether at least one of the lower right neighboring block and the upper left neighboring block of the current block has been decoded.
[0332] According to an embodiment, the condition for allowing the second intra prediction direction candidate for the luma block may be different from the condition for allowing the second intra prediction direction candidate for the chroma block. For example, when the second intra prediction direction candidate is allowed for a block having at least a predetermined size, the predetermined size of the luma block may be set to be different from the predetermined size of the chroma block.
[0333] The processor 1610 obtains a prediction block of the current block by performing intra prediction on the current block in the intra prediction direction of the current block. Then, the processor 1610 reconstructs the current block based on the prediction block.
[0334] According to an embodiment, the processor 1610 may use a reference sample after smoothing filtering in the intra prediction of the current sample according to the type of the intra prediction direction candidate to be applied to the current block. Compared with the case where the first intra prediction direction candidate is applied to the current block, when the second intra prediction direction candidate is applied to the current block, a further strong smoothing filtering may be performed on the reference sample. For example, when the first intra prediction direction candidate is applied to the current block, a smoothing filtering according to a 4-tap smoothing filter may be performed on the reference sample. However, when the second intra prediction direction candidate is applied to the current block, a smoothing filtering according to a 6-tap smoothing filter may be performed on the reference sample.
[0335] According to an embodiment, the processor 1610 may use the reference sample after smoothing filtering in the intra-frame prediction of the current sample according to the distance between the current sample and the reference sample. When the distance between the current sample and the reference sample is less than a threshold, smoothing filtering may not be applied. On the other hand, when the distance between the current sample and the reference sample is equal to or greater than the threshold, smoothing filtering may be applied. In addition, as the distance between the current sample and the reference sample increases, the processor 1610 may be set to apply a stronger smoothing filter to the reference sample.
[0336] According to an embodiment, when the current sample refers to a subsample at a fractional position, the processor 1610 may determine the subsample interpolated by the smoothing filter as a reference sample. The weight of the smoothing filter used in the interpolation of the sample at the integer position may be determined by adjusting the weight of the smoothing filter used in the interpolation of the subsample.
[0337] In the intra prediction of the current block as described above performed by the processor 1610, it is possible to apply Figures 17 to 21 Technical characteristics regarding the intra-frame prediction direction.
[0338] refer to Fig. 22 , a method of determining an MPM of a non-square block according to an embodiment will now be described.
[0339] According to an embodiment, in order to determine the prediction mode of the left neighboring block, samples 2202, 2204, 2206, and 2208 located on the left side of the current block 2200 may be scanned from top to bottom. When the intra prediction mode can be extracted from the block located at the sample 2202, the intra prediction mode is extracted from the block located at the sample 2202, and when the intra prediction mode cannot be extracted from the block located at the sample 2202, it may be determined whether the intra prediction mode can be extracted from the block located at the sample 2224. Similarly, when the intra prediction mode cannot be extracted from the block located at the sample 2204, it is determined whether the intra prediction mode can be extracted with respect to the block located at the sample 2226 and the block located at the sample 2228 in sequence.
[0340] According to an embodiment, samples 2202, 2204, 2206, and 2208 may be scanned from bottom to top. Fig. 22 Differently, the number of samples to be scanned may be determined to be equal to or less than 3 or equal to or greater than 5.
[0341] According to an embodiment, in order to determine the prediction mode of the upper neighboring block, samples 2210, 2212, and 2214 located above the current block 2200 may be scanned sequentially from left to right. The samples 2210, 2212, and 2214 located above may be scanned until a block from which an intra prediction mode cannot be detected is found. According to an embodiment, the samples 2210, 2212, and 2214 located above may be scanned sequentially from right to left. Alternatively, Fig. 22 Differently, the number of samples to be scanned may be determined to be equal to or less than 2 or equal to or greater than 4.
[0342] exist Fig. 22 In FIG. 2 , since the height of block 2200 is greater than its width, the number of samples 2202, 2204, 2206, and 2208 located on the left side required to determine the MPM is greater than the number of samples 2210, 2212, and 2214 located on the top. Fig. 22 Differently, when the width of the block is greater than its height, the number of samples located above that are required to determine the MPM may be determined to be greater than the number of samples located on the left. Alternatively, according to an embodiment, regardless of the height and width of the block, the number of samples located on the left that are required to determine the MPM may be determined to be equal to the number of samples located above.
[0343] According to an embodiment, with respect to a non-square block, two or more intra prediction modes may be extracted from the longer side of the height and width. For example, since the height of the block 2200 is greater than its width, two or more intra prediction modes may be extracted from the samples 2202, 2204, 2206, and 2208 located on the left. Then, based on the two or more intra prediction modes extracted from the samples 2202, 2204, 2206, and 2208 located on the left and one intra prediction mode extracted from the samples 2210, 2212, and 2214 located above, an MPM list may be determined. In addition, according to an embodiment, two or more intra prediction modes may be extracted from the samples 2210, 2212, and 2214 located above. Then, an MPM list may be determined based on the two or more intra prediction modes extracted from the samples 2210, 2212, and 2214 located above.
[0344] According to an embodiment, regarding a non-square block, in the MPM list, an intra prediction mode extracted from a longer side of the height and the width takes precedence over an intra prediction mode extracted from a shorter side. For example, since the height of the block 2200 is greater than its width, in the MPM list, an intra prediction mode extracted from samples 2202, 2204, 2206, and 2208 located on the left may take precedence over an intra prediction mode extracted from samples 2210, 2212, and 2214 located above.
[0345] According to an embodiment, an MPM index used in intra-frame prediction of an adjacent block can be obtained from an adjacent block adjacent to the current block. Then, based on the MPM index of the adjacent block, the priority of the MPM in the MPM list of the current block can be changed. For example, when multiple MPM indexes extracted from multiple adjacent blocks adjacent to block 2200 indicate MPM No. 2, the MPM list can be changed so that MPM No. 2 has a higher priority in the MPM list of block 2200.
[0346] According to an embodiment, the MPM may be configured by referring not only to the left and right blocks of the current block but also to other neighboring blocks of the current block. For example, the MPM may be configured by referring to a neighboring block located at the upper left vertex of the current block. Alternatively, the MPM may be configured by referring to a non-neighboring block such as a left block of the left block of the current block or an upper block of the upper block of the current block.
[0347] According to an embodiment, the MPM list of the current block may be determined to be equal to the MPM list of the left block of the current block or the MPM list of the upper block of the current block. In this embodiment, the current block may obtain MPM list index information indicating which block's MPM list to refer to. Then, the MPM list of the current block may be determined by copying the MPM list of the left block or the upper block according to the MPM list index information.
[0348] The above MPM list can be applied only to luma blocks. Alternatively, a Multiple Direct Mode Signaling (MDMS) list can be set for chroma blocks. The MDMS list can include DM mode, planar mode, DC mode, vertical mode and horizontal mode. DM mode refers to the intra-frame prediction mode of the luma block corresponding to the chroma block.
[0349] According to an embodiment, a luma block corresponding to a chroma block may be determined according to a sample position at the lower left vertex of the chroma block or a sample position at the center thereof. A DM mode is determined according to the luma block. When a DM mode corresponds to an angular intra prediction mode, the MDMS list may include an intra prediction mode of a prediction direction adjacent to the prediction direction of the DM mode.
[0350] According to an embodiment, the MDMS list may include intra prediction modes of neighboring blocks of the current block. When the intra prediction mode of the neighboring block is an angular intra prediction mode, the MDMS list may include intra prediction modes of prediction directions adjacent to the prediction direction of the intra prediction mode of the neighboring block.
[0351] According to an embodiment, the priorities of the DM mode, the plane mode, the DC mode, the vertical mode, and the horizontal mode of the MDMS list may be determined. In the MDMS list, the DM mode may have the highest priority. The priorities of the plane mode, the DC mode, the vertical mode, and the horizontal mode in the MDMS list may vary according to the shape of the current block. Alternatively, the priorities of the plane mode, the DC mode, the vertical mode, and the horizontal mode in the MDMS list may vary according to whether the hierarchical structure of the luminance block and the hierarchical structure of the chrominance block are determined independently.
[0352] In the following, reference Figure 23 to Figure 26 , intra-frame prediction tools applicable to intra-frame prediction will now be described.
[0353] Fig.23 An embodiment of determining weights of reference samples when bidirectional prediction is applied to the current block 2300 is shown.
[0354] When bidirectional prediction is applied to the current block 2300 , the processor 1610 may determine a prediction value of the current sample 2302 from reference samples included in the reference region 2310 in a prediction direction 2320 of the intra prediction mode and in a reverse direction 2330 of the prediction direction.
[0355] For example, the prediction direction 2320 of the intra prediction mode of the current sample 2302 may be determined based on the reference sample a. 0 and a 1 Then, the first median prediction value can be determined based on the reference sample b located in the opposite direction 2330 of the prediction direction of the intra prediction mode. 0 and b 1 Then, the prediction value of the current sample 2302 can be determined by averaging or weighted averaging the first median prediction value and the second median prediction value.
[0356] For bidirectional prediction, a lot of calculations are required in the filtering and interpolation of reference samples. Therefore, in order to reduce the amount of calculations required for video encoding, bidirectional prediction can be allowed only for specific cases.
[0357] According to an embodiment, bidirectional prediction may not be allowed for a specific intra-frame prediction mode. For example, for an intra-frame prediction mode in the horizontal direction or in a direction adjacent to the horizontal direction, it may be difficult to obtain reference samples required for bidirectional prediction. Therefore, bidirectional prediction may not be allowed for an intra-frame prediction mode in the horizontal direction or in a direction adjacent to the horizontal direction. Similarly, bidirectional prediction may not be allowed for an intra-frame prediction mode in the vertical direction or in a direction adjacent to the vertical direction.
[0358] According to an embodiment, whether bidirectional prediction is allowed may be determined based on the size of the current block 2300. When the size of the current block 2300 is greater than a predetermined value, bidirectional prediction may be allowed. Conversely, when the size of the current block 2300 is less than the predetermined value, bidirectional prediction may not be allowed.
[0359] According to an embodiment, whether bidirectional prediction is allowed may be determined based on the distance between the current sample and the reference sample. For example, when a value obtained by summing the distance between the current sample and the reference sample in the prediction direction 2320 of the intra prediction mode and the distance between the current sample and the reference sample in the opposite direction 2330 of the prediction direction of the intra prediction mode is less than a predetermined value, bidirectional prediction may be allowed. For example, when the intra prediction mode of the current block 2300 is Fig.18 In the case of mode No. 66 (upper right direction), bidirectional prediction can be allowed when the value obtained by summing the distance between the current sample and the reference sample in the prediction direction 2320 of the intra-frame prediction mode and the distance between the current sample and the reference sample in the opposite direction 2330 of the prediction direction of the intra-frame prediction mode is less than the diagonal length of the block.
[0360] According to an embodiment, bidirectional prediction may be allowed only for a portion of the current block 2300. When the current block 2300 is divided into four sub-blocks with half the height and width, the area of the upper left sub-block 2340 close to both the left reference sample and the upper reference sample may be determined as a bidirectional prediction area. Then, bidirectional prediction may be applied only to samples in the bidirectional prediction area.
[0361] Fig.24 An embodiment of an intra prediction method according to a multi-reference line intra prediction mode is shown.
[0362] The processor 1610 may determine a prediction value of the current sample 2402 based on a reference sample of the reference area 2410 located in a prediction direction 2420 of an intra prediction mode from the current sample 2402 .
[0363] exist Fig.24 In the embodiment, samples within three sample units from the current block 2400 are included in the reference region 2410, but in another embodiment, samples within only two sample units may be included in the reference region 2410. Alternatively, in another embodiment, samples farther than four sample units may be included in the reference region 2410.
[0364] According to an embodiment, the reference area may be divided into a plurality of line reference areas according to the distance relative to the current block. The line reference area is determined according to the distance relative to the current block. Fig.24, according to the distance from the current block, the reference region 2410 may be divided into a first line reference region 2412, a second line reference region 2414, and a third line reference region 2416. In addition, according to the reference region index information, a line reference region to be used in prediction of the current block may be determined from among the first line reference region 2412, the second line reference region 2414, and the third line reference region 2416. The reference region index information indicates a line reference region to be used in prediction of the current block among a plurality of line reference regions.
[0365] According to an embodiment, according to the left reference region index information, a line reference region to be used in horizontal prediction of the current block can be determined from the line reference region on the left side of the current block. In addition, according to the upper reference region index information, a line reference region to be used in vertical prediction of the current block can be determined from the line reference region above the current block.
[0366] According to an embodiment, when the intra prediction mode of the current block is a horizontal mode or an angular intra prediction mode in a direction adjacent to the horizontal mode, only the left reference area index information may be obtained, and the upper reference area index information may not be obtained. Therefore, when the left reference sample of the current block is needed, the left reference sample of the current block may be determined from the line reference area indicated by the left reference area index information and from the line reference area of the current block. The upper reference sample of the current block may be determined from the first line reference area 2412.
[0367] According to an embodiment, when the intra prediction mode of the current block is a vertical mode or an angular intra prediction mode in a direction adjacent to the vertical mode, only the upper reference area index information may be obtained, and the left reference area index information may not be obtained. Therefore, when the upper reference sample of the current block is needed, the upper reference sample of the current block may be determined from a line reference area indicated by the upper reference area index information and from a line reference area of the current block. The left reference sample of the current block may be determined from the first line reference area 2412.
[0368] According to an embodiment, when the current block is a non-square block whose width is greater than its height, only the left reference area index information may be obtained, and the upper reference area index information may not be obtained. Therefore, when the left reference sample of the current block is needed, the left reference sample of the current block may be determined from the line reference area indicated by the left reference area index information and from the line reference area of the current block. The upper reference sample of the current block may be determined from the first line reference area 2412. On the contrary, when the current block is a non-square block whose width is greater than its height, only the upper reference area index information may be obtained, and the left reference area index information may not be obtained.
[0369] According to an embodiment, when the current block is a non-square block whose height is greater than its width, only the upper reference area index information may be obtained, and the left reference area index information may not be obtained. Therefore, when the upper reference sample of the current block is needed, the upper reference sample of the current block may be determined from the line reference area indicated by the upper reference area index information and from the line reference area of the current block. The left reference sample of the current block may be determined from the first line reference area 2412. On the contrary, when the current block is a non-square block whose height is greater than its width, only the left reference area index information may be obtained, and the upper reference area index information may not be obtained.
[0370] According to an embodiment, without obtaining reference area index information, a line reference area to be used in prediction of the current block may be determined according to the intra prediction mode of the current block. Alternatively, when two or more intra prediction modes are applied to the current block, the reference sample of the first line reference area 2412 may be applied to prediction according to the first intra prediction mode, and the reference sample of the second line reference area 2414 may be applied to prediction according to the second intra prediction mode. Then, the prediction value of the current sample may be determined by averaging or weighted averaging the prediction value according to the first intra prediction mode and the second prediction value according to the second intra prediction mode.
[0371] According to an embodiment, when the current block is a non-square block whose height is greater than its width and the intra prediction mode of the current block is a horizontal mode or an angular intra prediction mode in a direction adjacent to the horizontal mode, the reference area index information may not be obtained. Therefore, only the reference samples of the first line reference area 2412 are used for prediction of the current block.
[0372] According to an embodiment, when the current block is a non-square block whose width is greater than its height and the intra prediction mode of the current block is a vertical mode or an angular intra prediction mode in a direction adjacent to the vertical mode, the reference area index information may not be obtained. Therefore, only the reference samples of the first line reference area 2412 are used for prediction of the current block.
[0373] According to an embodiment, the line reference region to be referenced by the current sample may be determined based on the position of the current sample. For example, the farther the current sample is from the reference region 2410, the line reference region away from the current block 2400 may be determined as the line reference region to be referenced by the current sample. Alternatively, when the current sample is at least a predetermined distance away from the reference region 2410, the current sample may be predicted by weighted averaging the reference samples included in the line reference region.
[0374] According to an embodiment, the reference samples of the first line reference area 2412, the second line reference area 2414, and the third line reference area 2416 may all be used for prediction of the current block. When the current block is to be predicted according to the angular intra prediction mode, the prediction value of the current sample may be determined by averaging or weighted averaging the reference samples 2422 of the first line reference area 2412, the reference samples 2424 of the second line reference area 2414, and the reference samples 2426 of the third line reference area 2416 according to the prediction direction 2420 of the intra prediction mode. When the current block is to be predicted according to the DC mode, the prediction value of the current sample may be determined by averaging or weighted averaging the DC value of the first line reference area 2412, the DC value of the second line reference area 2414, and the DC value of the third line reference area 2416.
[0375] When referring to reference samples of a plurality of lines, reference samples above the current block are stored in the memory 1620. Unlike the reference samples of one line, when the reference samples of a plurality of lines are stored in the memory 1620, the data size allocated to the memory 1620 with respect to the reference samples may be excessive. Therefore, instead of storing all sample values of the reference samples of a plurality of lines in the memory 1620, a weighted average line reference area of a weighted average of sample values of reference samples of the same row or column is stored in the memory 1620, so that the data size allocated to the memory 1620 with respect to the reference samples can be reduced.
[0376] For example, instead of the reference samples 2432, 2434, and 2436, a weighted average of the reference samples 2432, 2434, and 2436 may be stored in the memory 1620. The weight of the weighted average may be determined according to the distance between the current block and the line reference region. As the line reference region becomes closer to the current block, it may be determined that the weight is greater.
[0377] According to an embodiment, a weighted average of reference samples included in the first line reference area 2412 and the second line reference area 2414 or a weighted average of reference samples included in the first line reference area 2412 and the third line reference area 2416 may be stored in the memory 1620 .
[0378] According to an embodiment, a weighted average of reference samples included in the outer line reference area other than the first line reference area 2412 may be stored in the memory 1620 together with the first line reference area 2412. For example, Fig.24As shown, when there are three line reference areas, the samples of the outer line reference area can be determined by averaging or weighted averaging the reference samples 2424 of the second line reference area 2414 and the reference samples 2426 of the third line reference area 2416. For example, the outer line reference area may include samples whose sample values are the average or weighted average of the reference samples 2434 and 2436.
[0379] According to an embodiment, the multi-reference line intra prediction mode may be applied to the current block only when the current block is predicted according to the angular intra prediction mode. When the current block is predicted according to the vertical mode or the horizontal mode, the multi-reference line intra prediction mode may not be applied to the current block. According to an embodiment, when the intra prediction mode of the current block is included in the MPM list, the multi-reference line intra prediction mode may be applied to the current block.
[0380] According to an embodiment, when the LM chroma mode is applied to a current chroma block, a reference area of the current chroma block may be determined according to a line reference area applied to a luma block corresponding to the current chroma block.
[0381] According to an embodiment, when the first line reference area 2412 is not used for the current block, it can be set so that the position-dependent intra prediction combination (PDPC) mode is not applied to the current block. Alternatively, when the PDPC mode is applied to the current block, it can be set so that the first line reference area 2412 will be applied to the current block. Alternatively, when the PDPC mode is applied to the current block, it can be set so that the current block will be predicted based on a weighted average of reference samples included in multiple line reference areas.
[0382] According to an embodiment, an intra prediction mode may be induced from a line reference region of a current block. For example, an angular intra prediction mode may be induced from a gradient between reference samples of a line reference region. The angular intra prediction mode induced from a line reference region of a current block may be included in the MPM list. Alternatively, the angular intra prediction mode induced from a line reference region of a current block may be determined as the intra prediction mode of the current block.
[0383] Fig.25 is a diagram for describing an intra prediction method according to the LM chroma mode. The LM chroma mode refers to a prediction mode for predicting a chroma block from a collocated luminance block. In the LM chroma mode, an LM chroma reference area in which both luminance samples and chroma samples are decoded is determined, a correlation between the luminance sample and the chroma sample is obtained from the LM chroma reference area, and the chroma block is predicted based on a sample value of a luminance block corresponding to the chroma block and the correlation between the luminance sample and the chroma sample.
[0384] In LM chroma mode, a luma-chroma linear model is induced from the correlation between sample values of luma samples and sample values of chroma samples obtained from the LM chroma reference region. According to the luma-chroma linear model, a chroma block is predicted from a collocated luma block.
[0385] Fig.25 The LM chromaticity reference region 2510 for the LM chromaticity model for inducing the luminance-chromaticity linear model is illustrated. Fig.25 , the LM chrominance reference area 2510 is set in the left, top, and upper-left directions from the current block 2500. The width of the LM chrominance reference area 2510 is determined according to the LM chrominance reference area offset. The reference area offset may be determined by the size of the current block 2500 or encoding information obtained from a bitstream.
[0386] When a luma-chroma linear model is induced, luma-chroma pairs are determined based on sample values of luma samples and chroma samples at the same position in the LM chroma reference region. Then, correlations between luma samples and chroma samples are determined from a plurality of luma-chroma pairs determined in the reference region. Alternatively, luma samples and chroma samples at only specific positions in the LM chroma reference region may be used to determine luma-chroma pairs.
[0387] According to an embodiment, the luma samples of the LM chroma reference area may be divided into a plurality of groups according to sample values. Then, a luma-chroma pair may be determined according to an average value of the luma samples in each group and an average value of the chroma samples corresponding to the luma samples. Then, a correlation between the luma sample and the chroma sample is determined according to a plurality of luma-chroma pairs determined from the plurality of groups.
[0388] For example, the luma samples may be divided into two groups based on the sample value average of the luma samples. In particular, the luma samples may be divided into two groups, the first group including luma samples having sample values greater than the sample value average, and the second group including luma samples having sample values less than the sample value average. A first luma-chroma pair may be determined based on the average value of the luma samples of the first group and the average value of the chroma samples corresponding to the luma samples of the first group. A second luma-chroma pair may be determined based on the average value of the luma samples of the second group and the average value of the chroma samples corresponding to the luma samples of the second group. Then, a correlation between the luma sample and the chroma sample may be determined based on the first luma-chroma pair and the second luma-chroma pair.
[0389] According to an embodiment, the luma-chroma pair may be determined according to the most probable value of the luma sample and the most probable value of the chroma sample. In addition, the luma-chroma pair may be determined according to the median value of the luma sample and the median value of the chroma sample.
[0390] According to an embodiment, the LM chrominance reference area 2510 may be limited according to a block size and an intra mode of a luma block.
[0391] Fig.26 A method for predicting a current block according to a position-dependent intra prediction combination (PDPC) mode is shown. In the PDPC mode, two or more reference samples required to predict the current sample are determined according to the position of the current sample. The prediction value of the current sample is determined as a weighted average of sample values of the two or more reference samples. The weight used to determine the weighted average is determined based on the distance between the current sample and the reference sample.
[0392] According to an embodiment, the current block 2600 may be predicted according to the PDPC mode based on the left reference sample and the upper reference sample of the current block 2600. The prediction value of the sample 2602 is determined as a weighted average of the sample values of the left reference sample 2604 and the upper reference sample 2606 of the sample 2602. The weights to be applied to the left reference sample 2604 and the upper reference sample 2606 are determined according to the distance between the sample 2602 and the left reference sample 2604 and the distance between the sample 2602 and the upper reference sample 2606.
[0393] For example, the weight to be applied to the left reference sample 2604 may be determined in proportion to the distance between the sample 2602 and the upper reference sample 2606. The weight to be applied to the upper reference sample 2606 may be determined in proportion to the distance between the sample 2602 and the left reference sample 2604. Therefore, the weight to be applied to the left reference sample 2604 may be determined to be 2, and the weight to be applied to the upper reference sample 2606 may be determined to be 3. When the sample value of the left reference sample 2604 is 130 and the sample value of the upper reference sample 2606 is 80, the predicted value of the sample 2602 is determined to be 100, which is a weighted average according to the weights ((130×2+80×3) / (2+3)=100).
[0394] According to an embodiment, the current block 2600 may be predicted according to the PDPC mode based on a prediction direction of an angular intra prediction mode of the current block 2600 .
[0395] According to an embodiment, in the PDPC mode, two or more reference samples required to predict the current sample may be determined according to the position of the current sample and the intra prediction mode of the current block. For example, when the intra prediction mode of the current block is an angular intra prediction mode, the current sample may be predicted according to a reference sample in a prediction direction of the angular intra prediction mode of the current sample and a reference sample in an opposite direction to the prediction direction of the angular intra prediction mode of the current sample. Therefore, when the intra prediction mode of the current block is an angular intra prediction mode, as in Fig.23 As in the bidirectional prediction of , the reference sample of the current sample is determined.
[0396] According to an embodiment, when the intra prediction mode of the current block is an angular intra prediction mode, the current sample may be predicted based on a weighted average of a reference sample in a prediction direction of the angular intra prediction mode of the current sample and a reference sample in an opposite direction to the prediction direction of the angular intra prediction mode of the current sample. The weight of the weighted average may be determined based on the position of the current sample. For example, the weight may be determined based on a ratio of a distance between the current sample and the reference sample in the prediction direction of the angular intra prediction mode and a distance between the current sample and the reference sample in the opposite direction to the prediction direction of the angular intra prediction mode.
[0397] According to an embodiment, in the PDPC mode, two or more filtered reference samples for predicting the current sample are determined according to the position of the current sample. According to the size of the current block and the intra prediction mode, it can be determined which reference sample of the unfiltered reference sample and the filtered reference sample will be used in the PDPC mode. Alternatively, when the current block has a non-square shape, the reference samples adjacent to the short side of the current block may not be filtered, but the reference samples adjacent to the long side of the current block may be filtered.
[0398] Fig. 27 A flowchart of a video decoding method for determining an intra prediction direction of a current block according to a shape of the current block and intra prediction mode information according to an embodiment is shown.
[0399] In operation 2702, intra prediction mode information indicating an intra prediction mode of a current block is obtained.
[0400] In operation 2704, an intra prediction direction indicated by the intra prediction mode information is determined according to the shape of the current block.
[0401] When the current block has a square shape, the intra prediction direction of the current block is determined in the prediction direction indicated by the intra prediction mode information. When the current block has a non-square shape, the intra prediction direction of the current block is determined based on a comparison result between a reference prediction direction determined according to a ratio of a width and a height of the current block and indicated by the intra prediction mode information and the prediction direction.
[0402] When the current block has a non-square shape whose width is greater than its height, the reference prediction direction is determined as a direction indicating a lower left vertex of the current block from the center of the current block, and when the current block has a non-square shape whose height is greater than its width, the reference prediction direction is determined as a direction indicating an upper right vertex of the current block from the center of the current block.
[0403] According to an embodiment, in the case where the current block has a non-square shape whose width is greater than its height, when the prediction direction indicated by the intra-prediction mode information is closer to the lower direction than the reference prediction direction, the intra-prediction direction of the current block is determined in the opposite direction of the prediction direction indicated by the intra-prediction mode information. In the case where the current block has a non-square shape whose width is greater than its height, when the reference prediction direction is equal to the prediction direction indicated by the intra-prediction mode information or the reference prediction direction is closer to the lower direction than the prediction direction indicated by the intra-prediction mode information, the intra-prediction direction of the current block is determined in the prediction direction indicated by the intra-prediction mode information.
[0404] In the case where the current block has a non-square shape whose height is greater than its width, when the prediction direction indicated by the intra-prediction mode information is closer to the right direction than the reference prediction direction, the intra-prediction direction of the current block is determined in the opposite direction of the prediction direction indicated by the intra-prediction mode information. In the case where the current block has a non-square shape whose height is greater than its width, when the reference prediction direction is equal to the prediction direction indicated by the intra-prediction mode information or the reference prediction direction is closer to the right direction than the prediction direction indicated by the intra-prediction mode information, the intra-prediction direction of the current block is determined in the prediction direction indicated by the intra-prediction mode information.
[0405] According to an embodiment, the intra prediction mode information indicates an index number of the intra prediction mode of the current block. The intra prediction direction of the current block may be determined based on the index number indicated by the intra prediction mode information.
[0406] In the case where the current block has a non-square shape with a width greater than its height, when the index number is less than the reference index number corresponding to the reference prediction direction, the intra prediction direction of the current block is determined in the prediction direction of the intra prediction mode corresponding to the adjusted index number greater than the index number by a first value. In the case where the current block has a non-square shape with a width greater than its height, when the index number indicated by the intra prediction mode information is equal to the index number corresponding to the reference prediction direction or the index number indicated by the intra prediction mode information is greater than the index number corresponding to the reference prediction direction, the intra prediction direction of the current block is determined in the prediction direction of the intra prediction mode corresponding to the index number.
[0407] In the case where the current block has a non-square shape whose height is greater than its width, when the index number is greater than the reference index number corresponding to the reference prediction direction, the intra prediction direction of the current block is determined in the prediction direction of the intra prediction mode corresponding to the adjusted index number that is smaller than the index number by a second value. In the case where the current block has a non-square shape whose height is greater than its width, when the index number indicated by the intra prediction mode information is equal to the index number corresponding to the reference prediction direction or the index number indicated by the intra prediction mode information is less than the index number corresponding to the reference prediction direction, the intra prediction direction of the current block is determined in the prediction direction of the intra prediction mode corresponding to the index number.
[0408] In operation 2706 , the current block is predicted by intra-predicting the current block in an intra-prediction direction.
[0409] In operation 2708, the current block is reconstructed according to the prediction result with respect to the current block.
[0410] Depend on Fig.16 The technical features implemented by the processor 1610 can be Fig. 27 The method is implemented in the video decoding method.
[0411] Fig.28 A block diagram of a video encoding apparatus 2800 that performs video encoding according to a block intra prediction method is shown.
[0412] refer to Fig.28 , the video encoding device 2800 according to an embodiment may include a processor 2802 and a memory 2804.
[0413] The processor 2802 according to an embodiment may generally control the video encoding apparatus 2800. The processor 2802 according to an embodiment may execute one or more programs stored in the memory 2804.
[0414] The memory 2804 according to an embodiment may store various data, programs, or applications for driving and controlling the video encoding device 2800. The program stored in the memory 2804 may include one or more instructions. The program (one or more instructions) or application stored in the memory 2804 may be executed by the processor 2802.
[0415] Hereinafter, a video encoding method of determining intra prediction direction candidates of a current block based on a shape of the current block and determining an intra prediction direction of the current block will now be described.
[0416] The processor 2802 determines an intra prediction direction to be used in prediction of a current block from among a plurality of intra prediction directions.
[0417] The processor 2802 determines intra prediction mode information indicating an intra prediction mode of the current block according to the shape and the intra prediction direction of the current block.
[0418] When the current block has a square shape, the intra prediction mode information is determined according to the intra prediction mode corresponding to the intra prediction direction. When the current block has a non-square shape, the intra prediction mode information of the current block is determined based on a comparison result between a reference prediction direction and the intra prediction direction, the reference prediction direction being determined according to a ratio of a width and a height of the current block.
[0419] According to an embodiment, in the case where the current block has a non-square shape with a width greater than its height, when the intra-prediction direction of the current block is closer to the right direction than the upper right prediction direction, the intra-prediction mode information of the current block is determined in the opposite direction of the intra-prediction direction of the current block. In the case where the current block has a non-square shape with a width greater than its height, when the intra-prediction direction of the current block is in the upper right prediction direction or the upper right prediction direction is closer to the right direction than the intra-prediction direction of the current block, the intra-prediction mode information of the current block is determined according to the intra-prediction direction of the current block. The upper right prediction direction refers to a 45-degree direction between the upper direction (90 degrees) and the right direction (0 degrees).
[0420] According to an embodiment, in the case where the current block has a non-square shape whose height is greater than its width, when the intra-prediction direction of the current block is closer to the lower direction than the lower left prediction direction, the intra-prediction mode information of the current block may be determined in the direction opposite to the intra-prediction direction of the current block. In the case where the current block has a non-square shape whose height is greater than its width, when the intra-prediction direction of the current block is in the lower left prediction direction or the lower left prediction direction is closer to the lower direction than the intra-prediction direction of the current block, the intra-prediction mode information of the current block is determined in the intra-prediction direction of the current block. The lower left prediction direction refers to a -135 degree direction between the lower direction (-90 degrees) and the left direction (-180 degrees).
[0421] According to an embodiment, the intra prediction mode information indicates an index number of the intra prediction mode of the current block. Fig.17 and Fig.18 Describes the index number of the intra prediction mode. Alternatively, Fig.17 and Fig.18 There are different ways to determine the index number of the intra prediction mode.
[0422] In the case where the current block has a non-square shape with a width greater than its height, when the intra-prediction direction of the current block is closer to the right direction than the upper-right prediction direction, the intra-prediction mode information of the current block is determined according to an index number that is smaller than the index number of the intra-prediction mode corresponding to the intra-prediction direction of the current block by a first value. In the case where the current block has a non-square shape with a width greater than its height, when the intra-prediction direction of the current block is in the upper-right prediction direction or the upper-right prediction direction is closer to the right direction than the intra-prediction direction of the current block, the intra-prediction mode information of the current block is determined according to the index number of the intra-prediction mode corresponding to the intra-prediction direction of the current block.
[0423] In the case where the current block has a non-square shape with a height greater than its width, when the intra-prediction direction of the current block is closer to the lower direction than the lower left prediction direction, the intra-prediction mode information of the current block is determined according to an index number that is a second value greater than the index number of the intra-prediction mode corresponding to the intra-prediction direction of the current block. In the case where the current block has a non-square shape with a height greater than its width, when the intra-prediction direction of the current block is in the lower left prediction direction or the lower left prediction direction is closer to the lower direction than the intra-prediction direction of the current block, the intra-prediction mode information of the current block is determined according to the index number of the intra-prediction mode corresponding to the intra-prediction direction of the current block.
[0424] Processor 2802 may output a bitstream including intra prediction mode information.
[0425] The technical characteristics of video decoding described with reference to the video decoding device 1600 can be applied to the video encoding device 2800. The functions of the processor 2802 can be Figure 1A The encoder 110 is executed.
[0426] Fig.29 The invention shows a flowchart of a video encoding method for determining intra-frame prediction mode information of a current block according to the shape and intra-frame prediction direction of the current block.
[0427] In operation 2902, an intra prediction direction to be used in prediction of a current block is determined from among a plurality of intra prediction directions.
[0428] In operation 2904, intra prediction mode information indicating an intra prediction mode of the current block is determined according to the shape and the intra prediction direction of the current block.
[0429] In operation 2906, a bitstream including the intra prediction mode information is output.
[0430] Depend on Fig.28 The technical features implemented by the processor 2802 can be found in Fig.29 The method is implemented in the video encoding method.
[0431] According to reference Figures 1A to 29 The video encoding scheme based on the coding unit with a tree structure is described, and the image data in the spatial domain is encoded for each coding unit with a tree structure, and according to the video decoding scheme based on the coding unit with a tree structure, decoding is performed on each of the maximum coding units, and the image data in the spatial domain is reconstructed, so that a video such as a picture and a picture sequence can be reconstructed. The reconstructed video can be reproduced by a reproduction device, can be stored in a storage medium, or can be transmitted over a network.
[0432] Meanwhile, the embodiments of the present disclosure can be implemented as a computer-executable program and can be implemented in a general-purpose digital computer that operates the program using a computer-readable recording medium.
[0433] Although the preferred embodiments of the present disclosure have been described, it will be appreciated by those skilled in the art that various substitutions, modifications, and alterations may be made to one or more embodiments. That is, substitutions, modifications, and alterations do not depart from the scope of the present disclosure and are to be construed as being included in the present disclosure. Therefore, the embodiments should be considered in a descriptive sense only, and not for purposes of limitation.
Claims
1. A video decoding method, include: obtaining intra prediction mode information indicating an intra prediction mode of a current block; When the current block has a non-square shape with a ratio of width to height of 8:1 and a prediction index of a prediction direction indicated by the intra-prediction mode information is less than a first reference index of a first reference prediction direction, determining an intra-prediction direction of the current block in a direction having an index greater by a first value than the prediction index of the prediction direction indicated by the intra-prediction mode information, the first reference prediction direction being a direction indicating a lower left vertex of the current block, wherein when the current block has a non-square shape with a ratio of width to height of 4:1, the first reference direction is different from the first reference prediction direction indicating a direction of a lower left vertex of the current block; When the current block has a non-square shape with a ratio of width to height of 1:8 and the prediction index of the prediction direction indicated by the intra-prediction mode information is greater than a second reference index of a second reference prediction direction, determining the intra-prediction direction of the current block in a direction having an index smaller than the prediction index of the prediction direction indicated by the intra-prediction mode information by a second value, the second reference prediction direction being a direction indicating an upper right vertex of the current block, wherein when the current block has a non-square shape with a ratio of width to height of 1:4, the second reference direction is different from the second reference prediction direction indicating a direction of an upper right vertex of the current block; Obtaining prediction samples of pixels included in the current block by performing intra prediction according to the determined intra prediction direction; The intra-frame prediction mode information includes information of a most probable mode (MPM) of a prediction mode of a neighboring block of the current block.
2. A video encoding method, include: determining an intra prediction direction to be used in intra prediction of a current block from among a plurality of intra prediction directions; Obtaining prediction samples of pixels included in the current block by performing intra prediction according to the determined intra prediction direction; When the current block has a non-square shape with a ratio of 8:1 in width to height and a prediction index of the determined intra-prediction direction is greater than a first reference index of a first reference prediction direction, generating intra-prediction mode information indicating the intra-prediction direction of the current block in a direction having an index smaller than the prediction index of the determined intra-prediction direction by a first value, the first reference prediction direction being a direction indicating 45 degrees from a center of the current block, wherein the prediction direction as a direction indicating a lower left vertex of the current block when the current block has a non-square shape with a ratio of 8:1 in width to height is different from the prediction direction as a direction indicating a lower left vertex of the current block when the current block has a non-square shape with a ratio of 4:1 in width to height; generating intra prediction mode information indicating the intra prediction direction of the current block in a direction having an index greater than the prediction index of the determined intra prediction direction by a second value when the current block has a non-square shape having a ratio of width to height of 1:8 and the prediction index of the determined intra prediction direction is less than a second reference index of a second reference prediction direction, the second reference prediction direction being a direction indicating -135 degrees from a center of the current block, wherein the prediction direction as a direction indicating an upper right vertex of the current block when the current block has a non-square shape having a ratio of width to height of 1:8 is different from the prediction direction as a direction indicating an upper right vertex of the current block when the current block has a non-square shape having a ratio of width to height of 1:4; The intra-frame prediction mode information includes information of a most probable mode (MPM) of a prediction mode of a neighboring block of the current block.
3. A non-transitory computer-readable medium for recording a bit stream, the bit stream being decoded by a decoding method, the decoding method include: obtaining intra prediction mode information indicating an intra prediction mode of a current block; When the current block has a non-square shape with a ratio of width to height of 8:1 and a prediction index of a prediction direction indicated by the intra-prediction mode information is less than a first reference index of a first reference prediction direction, determining an intra-prediction direction of the current block in a direction having an index greater by a first value than the prediction index of the prediction direction indicated by the intra-prediction mode information, the first reference prediction direction being a direction indicating a lower left vertex of the current block, wherein when the current block has a non-square shape with a ratio of width to height of 4:1, the first reference direction is different from the first reference prediction direction indicating a direction of a lower left vertex of the current block; When the current block has a non-square shape with a ratio of width to height of 1:8 and the prediction index of the prediction direction indicated by the intra-prediction mode information is greater than a second reference index of a second reference prediction direction, determining the intra-prediction direction of the current block in a direction having an index smaller than the prediction index of the prediction direction indicated by the intra-prediction mode information by a second value, the second reference prediction direction being a direction indicating an upper right vertex of the current block, wherein when the current block has a non-square shape with a ratio of width to height of 1:4, the second reference direction is different from the second reference prediction direction indicating a direction of an upper right vertex of the current block; Obtaining prediction samples of pixels included in the current block by performing intra prediction according to the determined intra prediction direction; The intra-frame prediction mode information includes information of a most probable mode (MPM) of a prediction mode of a neighboring block of the current block.
