Video encoding method and apparatus, and video decoding method and apparatus

Adaptive intra prediction mode configuration based on block shape addresses inefficiencies in non-square blocks, improving prediction efficiency and decoding performance.

JP2024156977AActive Publication Date: 2024-11-06SAMSUNG ELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2024134357
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2018-04-24
Filing Date
2024-08-09
Publication Date
2024-11-06
Estimated Expiration
2039-04-24

AI Technical Summary

Technical Problem

Intra prediction efficiency is reduced when applying a square-shaped intra prediction mode to non-square blocks, as surrounding pixels are not usable for prediction.

Method used

Adaptively configure the intra prediction mode based on the shape of the current block, using different sets of intra prediction candidates for square and non-square blocks.

Benefits of technology

Improves intra prediction efficiency by optimizing the prediction mode according to the block's shape, enhancing decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024156977000001_ABST
    Figure 2024156977000001_ABST
Patent Text Reader

Abstract

To provide video encoding and decoding methods for improving efficiency of intra prediction by adaptively configuring an intra prediction mode according to the type of a current block.SOLUTION: A video decoding method includes the steps of determining an intra prediction mode of a current block on the basis of a width and a height of the current block, determining the intra prediction mode of the current block from among first intra prediction mode candidates including a plurality of pre-set intra prediction directions when the current block has a square shape having the same width and height, and determining the intra prediction mode of the current block from among second intra prediction mode candidates set on the basis of the non-square shape when the current block has a non-square shape having different width and height.SELECTED DRAWING: Figure 1B
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to a video decoding method / apparatus and a video encoding method / apparatus, and more particularly to intra prediction that adaptively configures an intra prediction mode to be applied based on a block type. [Background technology]

[0002] Video data is encoded using a codec based on a certain data compression standard, for example, the Moving Picture Experts Group (MPEG) standard, and then stored in a recording medium or transmitted through a communication channel in the form of a bit stream. th With the evolution of wired and wireless communication infrastructure such as 4K / 8K UHD (ultra high definition) video, 360° video, and VR (virtual reality) video, there is a growing demand for technology that can efficiently compress not only existing traditional video media, but also next-generation media such as 4K / 8K UHD (ultra high definition) video, 360° video, and VR (virtual reality) video. Summary of the Invention [Problem to be solved by the invention]

[0003] The present invention solves the problem that when an intra prediction mode applied to a block having a square shape is applied to a block having a non-square shape, there are surrounding pixels that cannot be used for intra prediction of the current pixel, resulting in reduced intra prediction efficiency. [Means for solving the problem]

[0004] According to various embodiments, if the current block has a non-square shape, the intra prediction mode applied to the square shaped block may be adaptively changed to configure the intra prediction mode applied to the non-square shaped block. Effect of the Invention

[0005] According to various embodiments, the intra prediction mode may be adaptively configured according to the type of the current block, thereby improving intra prediction efficiency. [Brief description of the drawings]

[0006] [Figure 1A] 2 is a block diagram of a video decoding device according to various embodiments. [Figure 1B] 4 is a flowchart of a video decoding method according to various embodiments. [Figure 1C] 4A and 4B are block diagrams of a video decoder according to various embodiments. [Figure 1D] 2 is a block diagram of a video decoding device according to various embodiments. [Figure 2A] 1 is a block diagram of a video encoding device according to various embodiments; [Figure 2B] 4 is a flowchart of a video encoding method according to various embodiments. [Figure 2C] 4A and 4B are block diagrams of a video decoder according to various embodiments. [Figure 2D] 1 is a block diagram of a video encoding device according to various embodiments; [Diagram 3] 1 is a diagram illustrating a process in which a video decoding apparatus divides a current coding unit and determines at least one coding unit, according to an embodiment. [Figure 4] 1 is a diagram illustrating a process in which a video decoding apparatus divides a non-square coding unit and determines at least one coding unit, according to an embodiment. [Diagram 5] 1 is a diagram illustrating a process in which a video decoding apparatus divides a coding unit based on at least one of block configuration information and partition configuration mode information, according to an embodiment. [Figure 6] 1 is a diagram illustrating a method for a video decoding apparatus to determine a predetermined coding unit among an odd number of coding units, according to an embodiment. [Figure 7]1 is a diagram illustrating an order in which a plurality of coding units are processed when a video decoding apparatus divides a current coding unit to determine the plurality of coding units, according to an embodiment; [Figure 8] 11 is a diagram illustrating a process in which a video decoder determines to divide a current coding unit into an odd number of coding units when the coding units cannot be processed in a predetermined order, according to an embodiment. [Figure 9] 1 is a diagram illustrating a process in which a video decoding apparatus divides a first coding unit and determines at least one coding unit, according to an embodiment. [Figure 10] 11 is a diagram illustrating that, according to one embodiment, a video decoding device restricts the manner in which a second coding unit may be divided when a non-square second coding unit determined by dividing a first coding unit satisfies a certain condition. [Figure 11] 13 is a diagram illustrating a process in which a video decoding device divides a square-shaped coding unit when division mode information does not indicate division into four square-shaped coding units, according to one embodiment. [Figure 12] 1 is a diagram illustrating that a processing order among a plurality of coding units may differ depending on a division process of the coding units, according to an embodiment. [Figure 13] 11 is a diagram illustrating a process of determining a depth of a coding unit according to changes in the shape and size of the coding unit when a coding unit is recursively divided to determine a plurality of coding units, according to one embodiment. [Figure 14] 1 is a diagram illustrating a depth and a part index (PID) for a coding unit partition determined according to a type and a size of a coding unit, according to an embodiment. [Figure 15] 1 is a diagram illustrating a plurality of coding units being determined according to a plurality of predetermined data units included in a picture, according to an embodiment; [Figure 16] 1 is a diagram illustrating processing blocks that are used as a reference to determine a determination order of reference coding units included in a picture, according to an embodiment; [Figure 17] 1 is a diagram illustrating intra-prediction modes according to an embodiment. [Figure 18] 13 is a diagram illustrating intra prediction modes according to another embodiment. [Figure 19] 1 is a diagram illustrating luma and chroma sample positions according to a 4:2:2 format, according to one embodiment. [Figure 20A] 1 is a diagram illustrating intra-prediction mode candidates applied to a square-shaped current block according to an embodiment. [Figure 20B] 10 is a diagram illustrating a method for changing an intra prediction mode applied to a square block and configuring an intra prediction mode applied to a current block whose width is greater than its height, according to an embodiment. [Figure 20C] 11 is a diagram illustrating a method for changing an intra prediction mode applied to a square block and configuring an intra prediction mode applied to a current block whose height is greater than its width, according to an embodiment. [Figure 21] 1 is a diagram illustrating a method for configuring an intra prediction mode to be applied to a current block whose width is greater than its height, according to an embodiment. [Figure 22] 1 is a diagram illustrating a scheme for configuring an intra prediction mode to be applied to a current block whose height is greater than its width, according to an embodiment. [Figure 23] 1 is a reference diagram illustrating positions of neighboring pixels according to the prediction direction of an intra prediction mode when the intra prediction mode applied to a square block is applied to a current block whose width is greater than its height. [Figure 24] 1 is a reference diagram illustrating positions of neighboring pixels according to a prediction direction of an intra prediction mode when the intra prediction mode applied to a square block is applied to a current block whose height is greater than its width. [Figure 25A] 11 is a diagram illustrating a scheme for configuring an intra prediction mode to be applied to a current block whose width is greater than its height, according to another embodiment. [Figure 25B]11 is a diagram illustrating a scheme for configuring an intra prediction mode to be applied to a current block whose height is greater than its width, according to another embodiment. [Figure 26A] 11 is a diagram illustrating a method for classifying intra prediction modes applied to a block into a horizontal part and a vertical part according to various embodiments. [Figure 26B] 13 is a diagram illustrating a scheme for configuring an intra prediction mode to be applied to a current block whose width is greater than its height, according to yet another embodiment. [Figure 26C] 11 is a diagram illustrating a scheme for configuring an intra prediction mode to be applied to a current block whose height is greater than its width, according to yet another embodiment. [Figure 27] 1 is a look-up table showing a mapping relationship between an intra-prediction mode index (predModeIntra) and an angle parameter (IntraPredAngle) according to an intra-prediction mode according to one embodiment. [Figure 28] 13 is a lookup table showing a mapping relationship between an intra-prediction mode index (predModeIntra) and an angle parameter (IntraPredAngle) according to an intra-prediction mode according to another embodiment. [Figure 29] 11 is a reference diagram for explaining an angle parameter (IntraPredAngle) related to an intra prediction mode direction according to an embodiment. [Diagram 30] 13 is a diagram illustrating a method for determining reference samples required for a directional intra-prediction mode. [Diagram 31] 13 is a diagram illustrating a method for determining an intra prediction mode of a neighboring block when a most probable mode (MPM) is applied. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0007] According to an embodiment, a video decoding method includes: obtaining information related to an intra prediction mode of a current block from a bitstream; determining an intra prediction mode of the current block using a width and height of the current block and information related to the intra prediction mode of the current block; performing intra prediction according to the determined intra prediction mode of the current block to obtain a prediction sample of each pixel included in the current block; obtaining a residual sample of each pixel included in the current block from the bitstream; and restoring the current block, wherein determining an intra prediction mode for the current block includes determining, when the current block has a square shape having the same width and height, an intra prediction mode for the current block from among first intra prediction mode candidates including a plurality of pre-defined intra prediction directions, based on information related to the intra prediction mode; and, when the current block has a non-square shape having different width and height, determining, when the current block has a non-square shape having different width and height, an intra prediction mode for the current block from among second intra prediction mode candidates set based on the non-square shape, based on the information related to the intra prediction mode.

[0008] According to one embodiment, when the current block has a non-square shape with its width greater than its height, the second intra prediction mode candidate may include a predetermined number of intra prediction modes indicating a specific direction set based on a top-right direction other than the direction indicated by the intra prediction modes included in the first intra prediction mode candidate, instead of a predetermined number of intra prediction modes selected based on a bottom-left direction among the first intra prediction mode candidates, and when the current block has a non-square shape with its height greater than its width, the second intra prediction mode candidate may include a predetermined number of intra prediction modes indicating a specific direction set based on a bottom-left direction other than the direction indicated by the first intra prediction mode candidate, instead of a predetermined number of intra prediction modes selected based on a top-right direction among the first intra prediction mode candidates.

[0009] According to one embodiment, among the first intra prediction mode candidates, a predetermined number of intra prediction modes selected based on the lower-left direction are selected in an order indicating a direction close to -135° based on the -135° direction, and instead of the predetermined number of intra prediction modes selected based on the lower-left direction, the intra prediction modes included in the second intra prediction mode candidates are selected in an order indicating a direction close to 45° among specific directions between 0° and 45°, and among the first intra prediction mode candidates, a predetermined number of intra prediction modes selected based on the upper-right direction are selected in an order indicating a direction close to 45° based on the 45° direction, and instead of the predetermined number of intra prediction modes selected based on the upper-right direction, the intra prediction modes included in the second intra prediction mode candidates are also selected in an order indicating a direction close to -135° among specific directions between -90° and -135°.

[0010] In one embodiment, instead of the intra prediction mode included in the first intra prediction mode candidate, the intra prediction mode included in the second intra prediction mode candidate may indicate a direction opposite to a specific direction indicated by the alternative intra prediction mode included in the first intra prediction mode candidate.

[0011] According to one embodiment, the first intra prediction mode candidate and the second intra prediction mode candidate are set using a look-up table indicating a parameter (IntraPredAngle) related to a specific direction according to an intra prediction mode index (predModeIntra), and the specific direction is indicated using a fixed number in the horizontal direction and the parameter (IntraPredAngle) in the vertical direction, or the parameter (IntraPredAngle) in the horizontal direction and a fixed number in the vertical direction, and the fixed number may have a value of a power of 2.

[0012] According to one embodiment, the second intra prediction mode candidate may further include an intra prediction mode that is added to the first intra prediction mode candidate when the current block has a non-square shape in which the width is greater than the height and indicates a direction close to the horizontal direction, and may further include an intra prediction mode that is added to the first intra prediction mode candidate when the current block has a non-square shape in which the height is greater than the width and indicates a direction close to the vertical direction.

[0013] According to an embodiment, the first intra prediction mode candidates include a vertical part intra prediction mode configured by sequentially dividing an angle between 45° and 135° based on a first intra prediction mode in a 45° direction, a second intra prediction mode in a 135° direction, and a third intra prediction mode in a −135° direction, and a horizontal part intra prediction mode configured by dividing an angle between 135° to 180° and −135° to −180°. The second intra prediction mode candidates include a vertical part intra prediction mode configured by sequentially dividing an angle between 135° to 180° and −135° to −180° based on a first intra prediction mode in a 45° direction, a second intra prediction mode in a 135° direction, and a third intra prediction mode in a −135° direction. The intra prediction modes may include a vertical part intra prediction mode configured by sequentially dividing the angle between the direction of the fourth intra prediction mode and the direction of the fifth intra prediction mode based on a fourth intra prediction mode in a left vertex direction from the center of the current block, a fifth intra prediction mode in a top left vertex direction from the center of the current block, and a sixth intra prediction mode in a bottom left vertex direction from the center of the current block, and a horizontal part intra prediction mode configured by sequentially dividing the angle between the direction of the fifth intra prediction mode and the sixth intra prediction mode in two.

[0014] According to one embodiment, the second intra prediction mode candidate is also set to indicate a specific direction between the first intra prediction direction and the second intra prediction direction based on a ratio between the width and height of the current block, based on a first intra prediction direction indicating a lower left vertex based on a center of the current block and a second intra prediction direction indicating a upper right vertex based on the center of the current block.

[0015] According to one embodiment, the step of determining an intra prediction mode of a current block may include a step of constructing a most probable mode (MPM) using prediction modes of neighboring blocks of the current block, and a step of determining the intra prediction mode of the current block based on the MPM.

[0016] According to one embodiment, the intra prediction mode included in the MPM is constructed using the prediction mode of the neighboring block adjacent to the left side of the current block and the prediction mode of the neighboring block adjacent to the upper side of the current block. If the shape of the neighboring block adjacent to the left or upper side of the current block is different from the shape of the current block and the intra prediction mode of the neighboring block adjacent to the left or upper side is not included in the intra prediction mode candidates of the current block, the intra prediction mode of the neighboring block adjacent to the left or upper side may be replaced with an intra prediction mode having a closest direction among the intra prediction mode candidates of the current block, or may be replaced with an intra prediction mode indicating a direction closest to a direction 180° inverted from the direction indicated by the intra prediction mode of the neighboring block adjacent to the left or upper side.

[0017] According to an embodiment, a video decoding apparatus includes a memory and at least one processor connected to the memory, the at least one processor includes: acquiring information related to an intra prediction mode of a current block from a bitstream; determining an intra prediction mode of the current block using a width and height of the current block and information related to the intra prediction mode of the current block; performing intra prediction according to the determined intra prediction mode of the current block to acquire a prediction sample of each pixel included in the current block; and acquiring a residual sample of each pixel included in the current block from the bitstream. and reconstructing the current block using the prediction sample and the residual sample, wherein the at least one processor determines an intra prediction mode of the current block from among first intra prediction mode candidates including a plurality of pre-defined intra prediction directions based on information related to the intra prediction mode when the current block has a square shape having the same width and height, and determines an intra prediction mode of the current block from among second intra prediction mode candidates set based on the non-square shape based on the information related to the intra prediction mode when the current block has a non-square shape having different width and height.

[0018] A video encoding method according to one embodiment includes the steps of: determining a plurality of intra prediction modes based on a width and height of a current block; determining an intra prediction mode of the current block from the plurality of intra prediction modes; obtaining a residual sample which is a difference between a prediction sample of each pixel included in the current block and a pixel value of the current block based on the intra prediction mode; and encoding the residual sample and information related to the intra prediction mode of the current block, wherein the plurality of intra prediction modes include a first intra prediction mode candidate including a plurality of pre-set intra prediction directions when the current block has a square shape having the same width and height, and a second intra prediction mode candidate set based on the non-square shape when the current block has a non-square shape having different width and height.

[0019] The advantages, features, and methods of achieving the disclosed embodiments will become clear with reference to the following embodiments in conjunction with the accompanying drawings. However, the present disclosure is not limited to the embodiments disclosed below, and may be embodied in various different forms, but the present embodiments are provided only to complete the disclosure and to fully inform those skilled in the art of the scope of the invention.

[0020] The terms used in this specification are briefly explained, and the disclosed embodiments are specifically explained.

[0021] The terms used in this specification are currently common terms that are used as much as possible while taking into consideration the function of this disclosure, but they may vary depending on the intentions of engineers in the relevant field, precedents, or the emergence of new technology. In addition, in certain cases, the applicant may arbitrarily select a term, and in such cases, the meaning of the term will be described in detail in the description of the invention. Therefore, the terms used in this disclosure must be defined based on the meaning of the term and the overall content of this disclosure, rather than simply the name of the term.

[0022] In this specification, the singular expression includes the plural expression unless the context clearly indicates otherwise.

[0023] Throughout the specification, when a part "comprises" a certain element, this does not mean excluding other elements, but means that the part may further include other elements, unless specifically stated to the contrary.

[0024] Also, the term "module" as used in the specification means a software component or a hardware component, and a "module" performs a certain function. However, the meaning of "module" is not limited to software or hardware. A "module" may be configured to reside on an addressable recording medium and to execute one or more processors. Thus, by way of example, a "module" includes components such as software components, object-oriented software components, class components, and task components; as well as processes, functions, attributes, procedures, subroutines, program code segments, drivers, firmware, microcode, circuits, data, databases, data structures, tables, arrays, and variables. The functionality provided by the components and "modules" may be further separated into fewer components and "modules" or additional components and "modules".

[0025] According to one embodiment of the present disclosure, the "unit" may also be embodied by a processor and a memory. The term "processor" should be broadly interpreted to include a general purpose processor, a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a controller, a microcontroller, a state machine, and the like. In some environments, the term "processor" may also refer to an application specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), and the like. The term "processor" may also refer to a combination of processing devices, such as, for example, a combination of a DSP and a microprocessor, a combination of multiple microprocessors, a combination of one or more microprocessors in conjunction with a DSP core, or any other such configuration.

[0026] The term "memory" should be interpreted broadly to include any electronic component capable of storing electronic information. The term "memory" may refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), non-volatile random access memory (NVRAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic or optical data storage devices, and registers. Memory is in electronic communication with a processor if the processor can write information to the memory and read information from the memory. Memory that is integrated with a processor is in electronic communication with the processor.

[0027] Hereinafter, "image" refers to a static image, such as a still image from a video, and also to a moving image, ie, a moving image, such as the video itself.

[0028] Hereinafter, a "sample" refers to data assigned to a sampling position of an image and to data to be processed. For example, in a spatial domain image, a pixel value and a transform coefficient in a transform domain are also samples. A unit including at least one such sample can be defined as a block. Hereinafter, with reference to the accompanying drawings, embodiments will be described in detail so that those skilled in the art in the technical field to which the present disclosure pertains can easily carry out the present disclosure. In addition, in the drawings, portions that are not related to the description will be omitted in order to clearly describe the present disclosure.

[0029] Hereinafter, a video encoding device, a video decoding device, a video encoding method, and a video decoding method according to an embodiment will be described in detail with reference to Figures 1A to 31. A method for determining a video data unit according to an embodiment will be described with reference to Figures 3 to 16, and a video encoding or decoding method and device thereof for adaptively applying an intra prediction mode based on a block type and performing intra prediction will be described with reference to Figures 17 to 31.

[0030] Hereinafter, a video encoding / decoding method and apparatus for adaptively performing intra prediction based on various types of coding units according to an embodiment of the present disclosure will be described in detail with reference to FIGS. 1A and 2D.

[0031] FIG. 1A illustrates a block diagram of a video decoder device according to various embodiments.

[0032] The video decoding device 100 may include a receiving unit 110 and a decoding unit 120. The receiving unit 110 and the decoding unit 120 may each include at least one processor. Also, the receiving unit 110 and the decoding unit 120 may each include a memory that stores instructions executed by the at least one processor.

[0033] The receiving unit 110 may receive a bitstream. The bitstream includes information obtained by encoding an image by the image encoding device 150 described below. The bitstream is also transmitted from the image encoding device 150. The image encoding device 150 and the video decoding device 100 may be connected to each other by wire or wirelessly, and the receiving unit 110 may receive the bitstream via wire or wirelessly. The receiving unit 110 may receive the bitstream from a recording medium such as an optical medium or a hard disk. The decoding unit 120 may restore an image based on information acquired from the received bitstream. The decoding unit 120 may acquire syntax elements for restoring an image from the bitstream. The decoding unit 120 may restore an image based on the syntax elements.

[0034] The receiving unit 110 may obtain information related to a prediction mode of the current block and information related to an intra prediction mode of the current block from the bitstream.

[0035] The information regarding the prediction mode of the current block included in the bitstream may include information regarding a skip mode, an intra mode, or an inter prediction mode. If the current block is not in the skip mode, it may be signaled whether the current block is encoded in the intra mode or the inter prediction mode.

[0036] The information on the intra prediction mode of the current block is also information on an intra prediction mode applied to the current block among a plurality of intra prediction modes. For example, the intra prediction mode is one of a DC mode, a planar mode, and a plurality of angular modes having a prediction direction. The angular modes include a horizontal mode, a vertical mode, and a diagonal mode, and may include a mode having a predetermined direction other than the horizontal direction, the vertical direction, and the diagonal direction. For example, the number of the angular modes may be 65 or 33.

[0037] The decoding unit 120 may obtain a prediction block of the current block according to a prediction mode of the current block. The decoding unit 120 may obtain information related to transform coefficients of the current block from the bitstream, and may perform inverse quantization and inverse transform using the obtained transform coefficient information to obtain residual samples related to a residual block of the current block.

[0038] As described below, the decoding unit 120 may determine an intra prediction mode of the current block using the width and height of the current block and information related to the intra prediction mode of the current block. If the current block has a square shape having the same width and height, the decoding unit 120 may determine an intra prediction mode of the current block from among first intra prediction mode candidates including a plurality of pre-defined intra prediction directions based on the information related to the intra prediction mode. If the current block has a non-square shape having an inconsistent width and height, the decoding unit 120 may determine an intra prediction mode of the current block from among second intra prediction mode candidates set based on the non-square shape based on the information related to the intra prediction mode.

[0039] According to an embodiment, the second intra prediction mode candidate may include a predetermined number of intra prediction modes indicating a specific direction set based on a top-right direction other than the direction indicated by the intra prediction modes included in the first intra prediction mode candidate, instead of a predetermined number of intra prediction modes selected based on a bottom-left direction among the first intra prediction mode candidates, when the current block has a non-square shape with its width greater than its height. Also, according to an embodiment, the second intra prediction mode candidate may include a predetermined number of intra prediction modes indicating a specific direction set based on a bottom-left direction other than the direction indicated by the first intra prediction mode candidate, instead of a predetermined number of intra prediction modes selected based on a top-right direction among the first intra prediction mode candidates, when the current block has a non-square shape with its height greater than its width.

[0040] According to an embodiment, a predetermined number of intra prediction modes selected from the first intra prediction mode candidates with a reference to the lower left direction are also selected in an order indicating a direction close to -135° with a reference to the -135° direction.

[0041] According to one embodiment, instead of a predetermined number of intra prediction modes selected from the first intra prediction mode candidates based on the bottom left direction, the intra prediction modes included in the second intra prediction mode candidates are also selected in an order indicating a direction close to 45° from among specific directions between 0° and 45°.

[0042] According to one embodiment, a predetermined number of intra prediction modes selected from the first intra prediction mode candidates based on the upper right direction are also selected in an order indicating a direction close to 45° based on the 45° direction.

[0043] According to one embodiment, instead of a predetermined number of intra prediction modes selected based on the upper right direction, the intra prediction modes included in the second intra prediction mode candidates are also selected in an order indicating a direction close to -135° among specific directions between -90° and -135°.

[0044] The decoding unit 120 may reconstruct the current block based on the predicted block of the current block and the residual block of the current block. The decoding unit 120 may generate reconstructed samples in the current block using sample values ​​of predicted samples in the predicted block of the current block and sample values ​​of residual samples in the residual block of the current block, and may generate a reconstructed block of the current block based on the reconstructed samples.

[0045] FIG. 1B illustrates a flowchart of a video decoding method according to various embodiments.

[0046] In operation 170, the decoder 120 obtains information related to an intra-prediction mode of the current block from the bitstream. The information related to the intra-prediction mode is information related to the MPM and is also information for determining an intra-prediction mode index (predModeIntra) of the current block.

[0047] In operation 171, the decoding unit 120 determines an intra prediction mode of the current block using information related to the width and height of the current block and the intra prediction mode of the current block. As described below, the decoding unit 120 may determine the intra prediction mode of the current block using information related to the width and height of the current block and the intra prediction mode of the current block. If the current block has a square shape having the same width and height, the decoding unit 120 may determine an intra prediction mode of the current block from among first intra prediction mode candidates including a plurality of pre-defined intra prediction directions based on the information related to the intra prediction mode. If the current block has a non-square shape having an inconsistent width and height, the decoding unit 120 may determine an intra prediction mode of the current block from among second intra prediction mode candidates set based on the non-square shape based on the information related to the intra prediction mode. According to an embodiment, the second intra prediction mode candidate may include a predetermined number of intra prediction modes indicating a specific direction set based on a top-right direction other than the direction indicated by the intra prediction modes included in the first intra prediction mode candidate, instead of a predetermined number of intra prediction modes selected based on a bottom-left direction among the first intra prediction mode candidates, when the current block has a non-square shape with its width greater than its height. Also, according to an embodiment, the second intra prediction mode candidate may include a predetermined number of intra prediction modes indicating a specific direction set based on a bottom-left direction other than the direction indicated by the first intra prediction mode candidate, instead of a predetermined number of intra prediction modes selected based on a top-right direction among the first intra prediction mode candidates, when the current block has a non-square shape with its height greater than its width.

[0048] In operation 172, the decoding unit 120 performs intra prediction according to the determined intra prediction mode of the current block, and obtains a prediction sample of each pixel included in the current block.

[0049] In step 173, the decoder 120 obtains a residual sample of each pixel included in the current block from the bitstream. In step 174, the decoder 120 reconstructs the current block using the predicted sample and the residual sample. The residual sample is a value corresponding to a difference between the current pixel and a predicted value, and the current pixel can be reconstructed by adding the predicted value to the residual.

[0050] FIG. 1C illustrates a block diagram of a video decoder 6000 according to various embodiments.

[0051] The video decoder 6000 according to various embodiments performs the same operations as those performed by the decoder 120 of the video decoder 100 in decoding video data.

[0052] 1C, the entropy decoding unit 6150 parses the coded image data to be decoded and coding information required for decoding from the bitstream 6050. The coded image data is quantized transform coefficients, and the inverse quantization unit 6200 and the inverse transform unit 6250 restore residual data from the quantized transform coefficients.

[0053] The intra prediction unit 6400 performs intra prediction for each block. As described below, the intra prediction unit 6400 may determine an intra prediction mode of a current block using information related to the width and height of the current block and the intra prediction mode of the current block. When the current block has a square shape having the same width and height, the intra prediction unit 6400 may determine an intra prediction mode of the current block from among first intra prediction mode candidates including a plurality of predefined intra prediction directions, based on the information related to the intra prediction mode.

[0054] The inter prediction unit 6350 performs inter prediction for each block using a reference image acquired from the reconstructed picture buffer 6300. By adding prediction data and residual data related to each block generated by the intra prediction unit 6400 or the inter prediction unit 6350, spatial domain data related to a block of a current image is reconstructed, and the deblocking unit 6450 and the sample adaptive offset (SAO) performing unit 6500 perform loop filtering on the reconstructed spatial domain data and output a filtered reconstructed image. In addition, the reconstructed image stored in the reconstructed picture buffer 6300 is also output as a reference image.

[0055] In the decoder 120 of the video decoder 100, in order to decode video data, the step-by-step operations of the video decoder 6000 according to various exemplary embodiments are also performed for each block.

[0056] FIG. 1D illustrates a block diagram of a video decoder device 100 according to one embodiment.

[0057] The video decoding device 100 according to an embodiment may include a memory 130 and at least one processor 125 connected to the memory 130. The video decoding device 100 according to an embodiment may operate as an individual processor or may operate under the control of a central processor. The memory 130 of the video decoding device 100 may store data received from an external source and data generated by the processor. The processor 125 of the video decoding device 100 may obtain information related to an intra-prediction mode of a current block from a bitstream and determine the intra-prediction mode of the current block using the width and height of the current block and the information related to the intra-prediction mode of the current block.

[0058] FIG. 2A illustrates a block diagram of a video encoding device according to various embodiments.

[0059] The video encoding device 150 according to various embodiments may include an encoding unit 155 and an output unit 160 .

[0060] The encoding unit 155 and the output unit 160 may include at least one processor. Also, the encoding unit 155 and the output unit 160 may include a memory that stores instructions executed by the at least one processor. The encoding unit 155 and the output unit 160 may be implemented by separate hardware, or the encoding unit 155 and the output unit 160 may be included in a single piece of hardware.

[0061] The encoding unit 155 determines the prediction mode of the current block by applying various prediction modes such as a skip mode, an intra mode, or an inter prediction mode. If the current block is not in the skip mode, it is signaled whether the current block is encoded in the intra mode or the inter prediction mode.

[0062] The encoding unit 155 may obtain a prediction block of the current block according to a prediction mode of the current block, and may transform and quantize a residual, which is a difference value between the current block and the prediction block, and may encode the residual. As described below, the encoding unit 120 may determine an intra prediction mode candidate to be applied to the current block using the width and height of the current block. When the current block has a square shape having the same width and height, the encoding unit 155 may reconstruct a first intra prediction mode candidate including a plurality of pre-defined intra prediction directions and determine a second intra prediction mode candidate to be applied to the non-square shaped current block. The encoding unit 155 may encode information related to an intra prediction mode of the current block, and the output unit 160 may generate a bitstream including information related to the intra prediction mode of the current block and structure information for determining data units having other hierarchical division forms, and output the bitstream.

[0063] FIG. 2B illustrates a flow chart of a video encoding method according to various embodiments.

[0064] In operation 271, the encoding unit 155 determines a plurality of intra prediction modes based on the width and height of the current block. As described below, the encoding unit 155 may determine an intra prediction mode to be applied to the current block using the width and height of the current block. If the current block has a square shape with the same width and height, the encoding unit 155 may determine an intra prediction mode of the current block from among a first intra prediction mode candidate including a plurality of predefined intra prediction directions. If the current block has a non-square shape with different width and height, the encoding unit 155 may determine a second intra prediction mode candidate different from the first intra prediction mode candidate as an intra prediction mode to be applied to the current block. According to an embodiment, when the current block has a non-square shape with its width greater than its height, the second intra prediction mode candidate may include a predetermined number of intra prediction modes indicating a specific direction set based on a top-right direction other than the direction indicated by the intra prediction modes included in the first intra prediction mode candidate, instead of a predetermined number of intra prediction modes selected based on a bottom-left direction among the first intra prediction mode candidates. Also, according to an embodiment, when the current block has a non-square shape with its height greater than its width, the second intra prediction mode candidate may include a predetermined number of intra prediction modes indicating a specific direction set based on a bottom-left direction other than the direction indicated by the first intra prediction mode candidate, instead of a predetermined number of intra prediction modes selected based on a top-right direction among the first intra prediction mode candidates.

[0065] In operation 272, the encoding unit 155 determines an intra prediction mode of the current block from among a plurality of intra prediction modes. The optimal intra prediction mode is also determined based on a rate distortion (RD) cost.

[0066] In operation 273, the encoding unit 155 obtains a residual sample, which is a difference between a predicted sample of each pixel included in the current block and a pixel value of the current block, based on the intra prediction mode.

[0067] In operation 274, the encoding unit 155 encodes the residual sample and information related to the intra prediction mode of the current block.

[0068] FIG. 2C illustrates a block diagram of a video encoder according to various embodiments.

[0069] The image encoder 7000 according to various embodiments performs the same operations as those performed in the encoder 155 of the image encoder 150 to encode image data.

[0070] That is, the intra prediction unit 7200 performs intra prediction for each block in the current image 7050, and the inter prediction unit 7150 performs inter prediction for each block using the current image 7050 and a reference image obtained from the reconstructed picture buffer 7100.

[0071] Residual data is generated by subtracting prediction data for each block output from the intra prediction unit 7200 or the inter prediction unit 7150 from data for the block to be encoded in the current image 7050, and the transform unit 7250 and the quantization unit 7300 can perform transform and quantization on the residual data and output quantized transform coefficients for each block.

[0072] The inverse quantization unit 7450 and the inverse transform unit 7500 may perform inverse quantization and inverse transform on the quantized transform coefficients to restore residual data in the spatial domain. The restored residual data in the spatial domain is restored to spatial domain data related to a block of the current image 7050 by adding it to prediction data related to each block output from the intra prediction unit 7200 or the inter prediction unit 7150. The deblocking unit 7550 and the SAO performing unit 7600 perform in-loop filtering on the restored spatial domain data to generate a filtered restored image. The generated restored image is stored in the restored picture buffer 7100. The restored image stored in the restored picture buffer 7100 is also used as a reference image for inter prediction of another image. The entropy coding unit 7350 performs entropy coding on the quantized transform coefficients, and the entropy coded coefficients are also output as a bitstream 7400.

[0073] Since the image encoder 7000 according to various embodiments is applied to the image encoder 150, the operations of the image encoder 7000 according to various embodiments are also performed for each block.

[0074] FIG. 2D illustrates a block diagram of a video encoding device 150 according to one embodiment.

[0075] The video encoding device 150 according to an embodiment may include a memory 165 and at least one processor 170 connected to the memory 165. The video encoding device 150 according to an embodiment may operate as an individual processor or may operate under the control of a central processor. The memory 165 of the video encoding device 150 may store data received from an external source and data generated by the processor.

[0076] The processor 170 of the video encoding device 150 may determine an intra prediction mode candidate to be applied to a current block using the width and height of the current block. When the current block has a square shape with the same width and height, the processor 170 may reconstruct a first intra prediction mode candidate including a plurality of predefined intra prediction directions and determine a second intra prediction mode candidate to be applied to a non-square shaped current block. In the following, the division of coding units according to one embodiment of the present disclosure will be described in detail.

[0077] First, a picture is divided into one or more slices or one or more tiles. A slice or a tile is also a sequence of one or more maximal coding units (CTUs). A maximal coding block (CTB) is a concept that is contrasted with a maximal coding unit (CTU).

[0078] A maximal coding block (CTB) means an NxN block containing NxN samples, where N is an integer. Each color component is also divided into one or more maximal coding blocks.

[0079] When a picture has three sample arrays (sample arrays for Y, Cr, and Cb components), the largest coding unit (CTU) is a unit including the largest coding block of luma samples, the two largest coding blocks of corresponding chroma samples, and syntax elements used to code the luma samples and chroma samples. When a picture is a monochrome picture, the largest coding unit is a unit including the largest coding block of monochrome samples and syntax elements used to code the monochrome samples. When a picture is a picture coded with color planes separated by color components, the largest coding unit is a unit including the picture and syntax elements used to code the samples of the picture.

[0080] One maximal coding block (CTB) is also divided into MxN coding blocks containing MxN samples (M, N are integers).

[0081] When a picture has sample arrays for Y, Cr, and Cb components, a coding unit (CU) is a unit that includes a coding block of luma samples, two coding blocks of corresponding chroma samples, and syntax elements used to code the luma samples and chroma samples. When a picture is a monochrome picture, a coding unit is a unit that includes a coding block of monochrome samples and syntax elements used to code the monochrome samples. When a picture is a picture coded with color planes separated by color components, a coding unit is a unit that includes the picture and syntax elements used to code samples of the picture.

[0082] As described above, the largest coding block and the largest coding unit are distinct concepts, and the coding block and the coding unit are distinct concepts. That is, the (largest) coding unit refers to a data structure including a (largest) coding block including a sample and a syntax element corresponding thereto. However, those skilled in the art can understand that the (largest) coding unit or the (largest) coding block refers to a block of a predetermined size including a predetermined number of samples, and therefore, in the following description, the largest coding block and the largest coding unit, or the coding block and the coding unit, will be referred to without distinction unless there is a special reason.

[0083] The image is also divided into maximum coding units (CTUs). The size of the maximum coding units is also determined based on information obtained from the bitstream. The shape of the maximum coding units may have a square shape of the same size, but is not limited thereto.

[0084] For example, information regarding a maximum size of a luma coding block may be obtained from a bitstream, where the maximum size of the luma coding block indicated by the information regarding the maximum size of the luma coding block may be one of 16x16, 32x32, 64x64, 128x128, and 256x256.

[0085] For example, information on the maximum size of a luma coding block that can be divided into two and the luma block size difference may be obtained from a bitstream. The information on the luma block size difference may indicate a size difference between a luma maximum coding unit and a maximum luma coding block that can be divided into two. Thus, the size of the luma maximum coding unit may be determined by combining the information on the maximum size of a luma coding block that can be divided into two obtained from the bitstream and the information on the luma block size difference. The size of the chroma maximum coding unit may also be determined by using the size of the luma maximum coding unit. For example, if the Y:Cb:Cr ratio is 4:2:0 according to the color format, the size of the chroma block is half the size of the luma block, and similarly, the size of the chroma maximum coding unit is half the size of the luma maximum coding unit.

[0086] According to an embodiment, information on the maximum size of a luma coding block that can be binary split is obtained from a bitstream, so that the maximum size of a luma coding block that can be binary split is also variably determined. In contrast, the maximum size of a luma coding block that can be ternary split may be fixed. For example, in an I picture, the maximum size of a luma coding block that can be ternary split is 32x32, and in a P picture or B picture, the maximum size of a luma coding block that can be ternary split is also 64x64.

[0087] The maximum coding unit is also hierarchically divided into coding units based on partition mode information acquired from the bitstream, where at least one of information indicating whether or not a quad split is performed, information indicating whether or not a multi-partition is performed, partition direction information, and partition type information is also acquired from the bitstream.

[0088] For example, the information indicating whether or not a current coding unit is quad-split may indicate whether the current coding unit is quad-split (QUAD_SPLIT) or not.

[0089] If the current coding unit is not split into quads, the information indicating whether or not the current coding unit is to be split further may indicate whether the current coding unit is not to be split further (NO_SPLIT) or whether or not the current coding unit is to be split into binary / ternary.

[0090] If the current coding unit is binary-divided or ternary-divided, the division direction information indicates that the current coding unit is divided in one of the horizontal and vertical directions.

[0091] If the current coding unit is divided horizontally or vertically, the partition type information indicates that the current coding unit is to be divided by binary partitioning or ternary partitioning.

[0092] The split mode of the current coding unit may be determined according to the split direction information and the split type information. If the current coding unit is split horizontally into binary parts, the split mode is determined as binary horizontal split (SPLIT_BT_HOR), if the current coding unit is split horizontally into ternary parts, the split mode is determined as ternary horizontal split (SPLIT_TT_HOR), if the current coding unit is split vertically into binary parts, the split mode is determined as binary vertical split (SPLIT_BT_VER), and if the current coding unit is split vertically into ternary parts, the split mode is determined as ternary vertical split (SPLIT_TT_VER).

[0093] The video decoding apparatus 100 may obtain partition mode information from one bin string from a bitstream. The bitstream format received by the video decoding apparatus 100 may include a fixed length binary code, a unary code, a truncated unary code, a predetermined binary code, etc. The bin string indicates information as a sequence of binary numbers. The bin string is also composed of at least one bit. The video decoding apparatus 100 may obtain partition mode information corresponding to the bin string based on a partition rule. The video decoding apparatus 100 may determine whether to partition a coding unit into quads, whether not to partition, or the partition direction and partition type based on one bin string.

[0094] The coding unit may be smaller than or equal to the maximum coding unit. For example, the maximum coding unit is also a coding unit having a maximum size, and is therefore also one of the coding units. If the partition mode information related to the maximum coding unit indicates that it is not partitioned, the coding unit determined by the maximum coding unit has the same size as the maximum coding unit. If the partition mode information related to the maximum coding unit indicates that it is partitioned, the maximum coding unit is also partitioned into coding units. Also, if the partition mode information related to the coding unit indicates partitioning, the coding unit is further partitioned into coding units of smaller sizes. However, the partitioning of the image is not limited thereto, and the maximum coding unit and the coding units are not differentiated. The partitioning of the coding units will be described in more detail with reference to FIG. 3 to FIG. 16.

[0095] Also, from the coding unit, one or more prediction blocks for prediction may be determined, which may be the same as or smaller than the coding unit. Also, from the coding unit, one or more transform blocks for transformation may be determined, which may be the same as or smaller than the coding unit.

[0096] The shapes and sizes of the transformation block and the prediction block may be independent of each other.

[0097] In other embodiments, prediction may be performed using the coding unit as a prediction block, and transformation may be performed using the coding unit as a transform block.

[0098] The division of the coding unit will be described in more detail in FIG. 3 to FIG. 16. The current block and the neighboring blocks of the present disclosure may indicate one of the largest coding unit, the coding unit, the prediction block, and the transformation block. The current block or the current coding unit is a block currently being decoded or coded, or a block currently being divided. The neighboring blocks are also blocks that are restored before the current block. The neighboring blocks may be spatially or temporally adjacent to the current block. The neighboring blocks may be located at one of the lower left side, the left side, the upper left side, the upper side, the upper right side, the right side, and the upper right side of the current block.

[0099] FIG. 3 illustrates a process in which a video decoding apparatus 100 divides a current coding unit and determines at least one coding unit according to an embodiment.

[0100] The block shape may include 4Nx4N, 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N, where N is a positive integer. The block shape information is information indicating at least one of the shape, direction, width-to-height ratio, and width and height of a coding unit.

[0101] The shape of the coding unit may include a square and a non-square. If the width and height of the coding unit are the same (i.e., the block shape of the coding unit is 4Nx4N), the video decoding device 100 may determine the block shape information of the coding unit as a square. The video decoding device 100 may determine the shape of the coding unit as a non-square.

[0102] When the width and height of a coding unit are different (i.e., when the block shape of the coding unit is 4Nx2N, 2Nx4N, 4NxN, Nx4N, 32NxN, Nx32N, 16NxN, Nx16N, 8NxN, or Nx8N), the video decoding apparatus 100 may determine that the block shape information of the coding unit is non-square. When the shape of the coding unit is non-square, the video decoding apparatus 100 may determine that the ratio of the width to the height in the block shape information of the coding unit is at least one of 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, 1:32, and 32:1. Based on the width and height of the coding unit, the video decoding apparatus 100 may determine whether the coding unit is horizontal or vertical. Based on at least one of the width, height, and width of the coding unit, the video decoding apparatus 100 may determine the size of the coding unit.

[0103] The video decoding device 100 according to an embodiment may determine the type of the coding unit using block type information, and may determine the type of the coding unit to be partitioned using partition type mode information. That is, a partitioning method of the coding unit indicated by the partition type mode information may be determined depending on the block type indicated by the block type information used by the video decoding device 100.

[0104] The video decoding device 100 may acquire partition mode information from a bitstream. However, the present invention is not limited thereto, and the video decoding device 100 and the video encoding device 150 may determine pre-agreed partition mode information based on the block format information. The video decoding device 100 may determine pre-agreed partition mode information for the maximum coding unit or the minimum coding unit. For example, the video decoding device 100 may determine the partition mode information for the maximum coding unit as quad partition. Also, the video decoding device 100 may determine the partition mode information for the minimum coding unit as "no partition". Specifically, the video decoding device 100 may determine the size of the maximum coding unit as 256x256. The video decoding device 100 may determine the pre-agreed partition mode information as quad partition. The quad partition is a partition mode in which both the width and height of the coding unit are divided into two equal parts. Based on the partition mode information, the video decoding device 100 can obtain a coding unit of 128x128 size from the maximum coding unit of 256x256 size. Also, the video decoding device 100 can determine the size of the minimum coding unit as 4x4. The video decoding device 100 can obtain partition mode information indicating "no partition" for the minimum coding unit.

[0105] According to an embodiment, the video decoding apparatus 100 may use block shape information indicating that the current coding unit is square. For example, the video decoding apparatus 100 may determine whether to not split the square coding unit, to split it vertically, to split it horizontally, or to split it into four coding units, according to the partition shape mode information. Referring to FIG. 3, when the block shape information of the current coding unit 300 indicates a square shape, the decoder 120 may determine coding units 310a having the same size as the current coding unit 300 according to the partition shape mode information indicating no partition, or may determine coding units 310b, 310c, 310d, 310e, and 310f that are split according to the partition shape mode information indicating a predetermined partition method.

[0106] Referring to FIG. 3, the video decoding device 100 may determine two coding units 310b obtained by dividing the current coding unit 300 in the vertical direction based on the partition mode information indicating division in the vertical direction, according to an embodiment. The video decoding device 100 may determine two coding units 310c obtained by dividing the current coding unit 300 in the horizontal direction based on the partition mode information indicating division in the horizontal direction. The video decoding device 100 may determine four coding units 310d obtained by dividing the current coding unit 300 in the vertical and horizontal directions based on the partition mode information indicating division in the vertical and horizontal directions. The video decoding device 100 may determine three coding units 310e obtained by dividing the current coding unit 300 in the vertical direction based on the partition mode information indicating ternary division in the vertical direction, according to an embodiment. The video decoding device 100 may determine three coding units 310f obtained by dividing the current coding unit 300 in the horizontal direction based on the partition mode information indicating ternary division in the horizontal direction. However, the division pattern into which the square coding unit may be divided is not limited to the above-mentioned pattern, and may include various patterns that can be indicated by the division pattern mode information. The predetermined division patterns into which the square coding unit may be divided will be described in detail below through various embodiments.

[0107] FIG. 4 illustrates a process in which the video decoding device 100 divides a non-square coding unit to determine at least one coding unit, according to an embodiment.

[0108] According to an embodiment, the video decoding apparatus 100 may use block shape information indicating that the current coding unit is non-square. The video decoding apparatus 100 may determine whether to not split the non-square current coding unit or to split it in a predetermined manner according to the partition mode information. Referring to FIG. 4, when the block shape information of the current coding unit 400 or 450 indicates a non-square shape, the video decoding apparatus 100 may determine a coding unit 410 or 460 having the same size as the current coding unit 400 or 450 according to the partition mode information indicating no partition, or may determine partitioned coding units 420a, 420b, 430a, 430b, 430c, 470a, 470b, 480a, 480b, and 480c based on the partition mode information indicating a predetermined partition method. The predetermined partition method for partitioning a non-square coding unit will be described in detail below through various embodiments.

[0109] According to an embodiment, the video decoding device 100 may determine a form in which a coding unit is divided using the partition mode information, and in this case, the partition mode information may indicate the number of at least one coding unit to be generated by dividing the coding unit. Referring to FIG 4, when the partition mode information indicates that the current coding unit 400 or 450 is divided into two coding units, the video decoding device 100 may divide the current coding unit 400 or 450 based on the partition mode information and determine two coding units 420a, 420b or 470a, 470b included in the current coding unit.

[0110] According to an embodiment, when the video decoding device 100 divides the non-square shaped current coding unit 400 or 450 based on the division shape mode information, the video decoding device 100 may divide the current coding unit by considering a position of a long side of the non-square shaped current coding unit 400 or 450. For example, the video decoding device 100 may determine a plurality of coding units by dividing the current coding unit 400 or 450 in a direction that divides the long side of the current coding unit 400 or 450 by considering the shape of the current coding unit 400 or 450.

[0111] According to an embodiment, when the partition mode information indicates that a coding unit is to be partitioned into an odd number of blocks (ternary partitioning), the video decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450. For example, when the partition mode information indicates that the current coding unit 400 or 450 is to be partitioned into three coding units, the video decoding device 100 may partition the current coding unit 400 or 450 into three coding units 430a, 430b, 430c, 480a, 480b, and 480c.

[0112] According to an embodiment, the width-to-height ratio of the current coding unit 400 or 450 may be 4:1 or 1:4. When the width-to-height ratio is 4:1, the width is greater than the height, and the block shape information is also horizontal. When the width-to-height ratio is 1:4, the width is smaller than the height, and the block shape information is also vertical. The video decoding apparatus 100 may determine to divide the current coding unit into an odd number of blocks based on the partition shape mode information. In addition, the video decoding apparatus 100 may determine a partition direction of the current coding unit 400 or 450 based on the block shape information of the current coding unit 400 or 450. For example, when the current coding unit 400 has a vertical direction in which the height is greater than the width, the video decoding apparatus 100 may divide the current coding unit 400 in the horizontal direction to determine coding units 430a, 430b, and 430c. Also, if the current coding unit 450 has a horizontal dimension in which the width is greater than the height, the video decoding device 100 may divide the current coding unit 450 vertically to determine coding units 480a, 480b, and 480c.

[0113] According to an embodiment, the video decoding apparatus 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and the determined coding units may not all have the same size. For example, the size of a given coding unit 430b or 480b among the determined odd number of coding units 430a, 430b, 430c, 480a, 480b, and 480c may be different from the other coding units 430a, 430c, 480a, and 480c. That is, the coding units that may be determined by dividing the current coding unit 400 or 450 may have a variety of sizes, and in some cases, the odd number of coding units 430a, 430b, 430c, 480a, 480b, and 480c may have different sizes.

[0114] According to an embodiment, when the partition mode information indicates that a coding unit is partitioned into an odd number of blocks, the video decoding device 100 may determine an odd number of coding units included in the current coding unit 400 or 450, and may further set a predetermined restriction on at least one of the odd number of coding units generated by partitioning. Referring to FIG 4, the video decoding device 100 may perform a decoding process for the central coding unit 430b, 480b among three coding units 430a, 430b, 430c, 480a, 480b, and 480c generated by partitioning the current coding unit 400 or 450 differently from the other coding units 430a, 430c, 480a, and 480c. For example, the video decoding device 100 may limit the centrally located coding units 430b and 480b from being further divided, unlike the other coding units 430a, 430c, 480a, and 480c, or may limit them to being divided a predetermined number of times.

[0115] FIG. 5 illustrates a process in which the video decoding apparatus 100 divides a coding unit based on at least one of block configuration information and partition configuration mode information, according to an embodiment.

[0116] According to an embodiment, the video decoding device 100 may determine whether or not to divide the square-shaped first coding unit 500 into coding units based on at least one of the block shape information and the partition shape mode information. According to an embodiment, if the partition shape mode information indicates that the first coding unit 500 is to be partitioned in the horizontal direction, the video decoding device 100 may partition the first coding unit 500 in the horizontal direction to determine the second coding unit 510. According to an embodiment, the first coding unit, the second coding unit, and the third coding unit used are terms used to understand the partitioning context between the coding units. For example, if the first coding unit is partitioned, the second coding unit may be determined, and if the second coding unit is partitioned, the third coding unit may be determined. In the following, the relationship between the first coding unit, the second coding unit, and the third coding unit used may also be understood to be according to the above-mentioned characteristics.

[0117] According to an embodiment, the video decoding apparatus 100 may determine whether or not to divide the determined second coding unit 510 into coding units based on the partition mode information. Referring to FIG. 5, the video decoding apparatus 100 may divide the first coding unit 500 based on the partition mode information, and divide the determined non-square second coding unit 510 into at least one third coding unit 520a, 520b, 520c, 520d, or may not divide the second coding unit 510. The video decoding apparatus 100 may acquire partition mode information, and may divide the first coding unit 500 based on the acquired partition mode information, and may determine a plurality of second coding units 510 of various types, for example, and the second coding units 510 may be divided according to the manner in which the first coding unit 500 was divided based on the partition mode information. According to an embodiment, when the first coding unit 500 is divided into the second coding unit 510 based on the division mode information related to the first coding unit 500, the second coding unit 510 is also divided into, for example, third coding units 520a, 520b, 520c, and 520d based on the division mode information related to the second coding unit 510. That is, the coding units are also divided recursively based on the division mode information related to each coding unit. Thus, in a non-square coding unit, a square coding unit is determined, and such a square coding unit is divided recursively to determine a non-square coding unit.

[0118] 5, among the odd number of third coding units 520b, 520c, and 520d determined by dividing the non-square second coding unit 510, a predetermined coding unit (e.g., a coding unit located in the middle or a square coding unit) is also divided recursively. According to an embodiment, the square third coding unit 520b, which is one of the odd number of third coding units 520b, 520c, and 520d, is divided horizontally into a plurality of fourth coding units. The non-square fourth coding unit 530b or 530d, which is one of the plurality of fourth coding units 530a, 530b, 530c, and 530d, is further divided into a plurality of coding units. For example, the non-square fourth coding unit 530b or 530d may be further divided into an odd number of coding units. Methods that can be used for the recursive division of coding units will be described below through various embodiments.

[0119] According to an embodiment, the video decoding device 100 may divide each of the third coding units 520a, 520b, 520c, and 520d into coding units based on the partition mode information. Also, the video decoding device 100 may determine not to partition the second coding unit 510 based on the partition mode information. According to an embodiment, the video decoding device 100 may divide the non-square second coding unit 510 into an odd number of third coding units 520b, 520c, and 520d. The video decoding device 100 may set a predetermined restriction on a predetermined third coding unit among the odd number of third coding units 520b, 520c, and 520d. For example, the video decoding device 100 may restrict the coding unit 520c located in the middle of the odd number of third coding units 520b, 520c, and 520d so that it is not further divided or that it must be divided a settable number of times.

[0120] 5, the video decoding apparatus 100 may restrict the coding unit 520c located in the middle of the odd number of third coding units 520b, 520c, and 520d included in the non-square second coding unit 510 to not be further divided or to be divided into a predetermined division form (e.g., to be divided into only four coding units or to be divided into a form corresponding to the division form of the second coding unit 510), or to be divided only a predetermined number of times (e.g., to be divided only n times, n>0). However, the above restriction on the coding unit 520c located in the middle is merely one embodiment, and should not be construed as being limited to the above embodiment, but should be construed as including various restrictions that the coding unit 520c located in the middle may be decoded differently from the other coding units 520b and 520d.

[0121] According to an embodiment, the video decoding apparatus 100 may obtain partition mode information used to partition the current coding unit from a predetermined position within the current coding unit.

[0122] FIG. 6 illustrates a method for the video decoding device 100 to determine a predetermined coding unit from among an odd number of coding units according to an embodiment.

[0123] 6, the partition mode information of the current coding unit 600, 650 is also obtained from a sample at a predetermined position (e.g., samples 640, 690 located in the middle) among a plurality of samples included in the current coding unit 600, 650. However, the predetermined position in the current coding unit 600 where at least one of the partition mode information can be obtained is not limited to the center position shown in FIG. 6, but may include various positions (e.g., top end, bottom end, left end, right end, top left end, bottom left end, top right end, bottom right end, etc.) that can be included in the current coding unit 600. The video decoding apparatus 100 may obtain the partition mode information obtained from the predetermined position and determine whether to partition the current coding unit into coding units of various types and sizes or not to divide the current coding unit.

[0124] According to an embodiment, when a current coding unit is divided into a predetermined number of coding units, the video decoding apparatus 100 may select one of the coding units. There are various methods for selecting one of the coding units, and such methods will be described below through various embodiments.

[0125] According to an embodiment, the video decoding apparatus 100 may divide a current coding unit into a plurality of coding units and determine a coding unit at a predetermined position.

[0126] According to an embodiment, the video decoding apparatus 100 may use information indicating the positions of each of the odd coding units to determine a coding unit located in the middle among the odd coding units. Referring to FIG 6, the video decoding apparatus 100 may divide a current coding unit 600 or a current coding unit 650 to determine odd coding units 620a, 620b, and 620c or odd coding units 660a, 660b, and 660c. The video decoding apparatus 100 may determine the middle coding unit 620b or the middle coding unit 660b using information regarding the positions of the odd coding units 620a, 620b, and 620c or the odd coding units 660a, 660b, and 660c. For example, the video decoding device 100 can determine the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of predetermined samples included in the coding units 620a, 620b, and 620c, thereby determining the center coding unit 620b. Specifically, the video decoding device 100 can determine the positions of the coding units 620a, 620b, and 620c based on information indicating the positions of the upper left samples 630a, 630b, and 630c of the coding units 620a, 620b, and 620c, thereby determining the center coding unit 620b.

[0127] According to an embodiment, the information indicating the positions of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c may include information related to the positions or coordinates of the coding units 620a, 620b, and 620c in a picture. According to an embodiment, the information indicating the positions of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c may include information indicating the width or height of the coding units 620a, 620b, and 620c included in the current coding unit 600, and such width or height also corresponds to information indicating the difference between the coordinates of the coding units 620a, 620b, and 620c in a picture. That is, the video decoding device 100 can determine the coding unit 620b located in the middle by directly using information related to the positions or coordinates of the coding units 620a, 620b, and 620c within the picture, or by using information related to the width or height of the coding unit corresponding to the difference between the coordinates.

[0128] According to an embodiment, information indicating a position of the top left sample 630a of the top coding unit 620a may indicate (xa, ya) coordinates, information indicating a position of the top left sample 630b of the middle coding unit 620b may indicate (xb, yb) coordinates, and information indicating a position of the top left sample 630c of the bottom coding unit 620c may indicate (xc, yc) coordinates. The video decoding apparatus 100 may determine the middle coding unit 620b using the coordinates of the top left samples 630a, 630b, and 630c included in the coding units 620a, 620b, and 620c, respectively. For example, when the coordinates of the top left samples 630a, 630b, and 630c are sorted in ascending or descending order, the coding unit 620b including the coordinates (xb, yb) of the middle sample 630b may be determined as the middle coding unit among the coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. However, the coordinates indicating the positions of the top left samples 630a, 630b, and 630c may indicate coordinates indicating absolute positions within a picture, and further, the (dxb, dyb) coordinates indicating the relative position of the top left sample 630b of the middle coding unit 620b and the (dxc, dyc) coordinates indicating the relative position of the top left sample 630c of the bottom coding unit 620c may be used. Furthermore, this should not be interpreted as being limited to the method described above of determining a coding unit at a predetermined position by using the coordinates of a sample as information indicating the position of the sample included in the coding unit, but should be interpreted as various arithmetic methods that can use the coordinates of the sample.

[0129] According to an embodiment, the video decoding device 100 may divide the current coding unit 600 into a plurality of coding units 620a, 620b, and 620c, and may select a coding unit from among the coding units 620a, 620b, and 620c according to a predetermined criterion. For example, the video decoding device 100 may select a coding unit 620b having a different size from among the coding units 620a, 620b, and 620c.

[0130] According to an embodiment, the video decoding device 100 may determine the width or height of each of the coding units 620a, 620b, and 620c using (xa, ya) coordinates indicating the position of the top left sample 630a of the top coding unit 620a, (xb, yb) coordinates indicating the position of the top left sample 630b of the middle coding unit 620b, and (xc, yc) coordinates indicating the position of the top left sample 630c of the bottom coding unit 620c. The video decoding device 100 may determine the size of each of the coding units 620a, 620b, and 620c using (xa, ya), (xb, yb), and (xc, yc) coordinates indicating the positions of the coding units 620a, 620b, and 620c. According to an embodiment, the video decoding device 100 may determine the width of the top coding unit 620a as the width of the current coding unit 600. The video decoding apparatus 100 may determine the height of the top coding unit 620a as yb-ya. According to an embodiment, the video decoding apparatus 100 may determine the width of the middle coding unit 620b as the width of the current coding unit 600. The video decoding apparatus 100 may determine the height of the middle coding unit 620b as yc-yb. According to an embodiment, the video decoding apparatus 100 may determine the width or height of the bottom coding unit using the width or height of the current coding unit and the widths and heights of the top coding unit 620a and the middle coding unit 620b. The video decoding apparatus 100 may determine a coding unit having a different size from other coding units based on the determined widths and heights of the coding units 620a, 620b, and 620c. Referring to FIG. 6, the video decoding apparatus 100 may determine the middle coding unit 620b having a different size from the top coding unit 620a and the bottom coding unit 620c as a coding unit at a predetermined position. However, the above-mentioned process in which the video decoding device 100 determines a coding unit having a size different from other coding units is merely one embodiment of determining a coding unit at a predetermined position using the size of the coding unit determined based on sample coordinates, and various other processes may be used to determine a coding unit at a predetermined position by comparing the size of the coding unit determined based on predetermined sample coordinates.

[0131] The video decoding device 100 may determine the width or height of each of the coding units 660a, 660b, and 660c using the (xd, yd) coordinates indicating the position of the top left sample 670a of the left coding unit 660a, the (xe, ye) coordinates indicating the position of the top left sample 670b of the middle coding unit 660b, and the (xf, yf) coordinates indicating the position of the top left sample 670c of the right coding unit 660c. The video decoding device 100 may determine the size of each of the coding units 660a, 660b, and 660c using the coordinates (xd, yd), (xe, ye), and (xf, yf) indicating the positions of the coding units 660a, 660b, and 660c.

[0132] According to an embodiment, the video decoding device 100 may determine the width of the left coding unit 660a as xe-xd. The video decoding device 100 may determine the height of the left coding unit 660a as the height of the current coding unit 650. According to an embodiment, the video decoding device 100 may determine the width of the middle coding unit 660b as xf-xe. The video decoding device 100 may determine the height of the middle coding unit 660b as the height of the current coding unit 650. According to an embodiment, the video decoding device 100 may determine the width or height of the right coding unit 660c using the width or height of the current coding unit 650 and the widths and heights of the left coding unit 660a and the middle coding unit 660b. The video decoding device 100 may determine a coding unit having a size different from other coding units based on the determined widths and heights of the coding units 660a, 660b, and 660c. 6, the video decoding apparatus 100 may determine a middle coding unit 660b having a size different from the sizes of the left coding unit 660a and the right coding unit 660c as a coding unit at a predetermined position. However, the above-described process of the video decoding apparatus 100 determining a coding unit having a size different from other coding units is merely one embodiment of determining a coding unit at a predetermined position using the size of the coding unit determined based on sample coordinates, and various processes of determining a coding unit at a predetermined position by comparing the size of the coding unit determined based on the predetermined sample coordinates may be used.

[0133] However, the position of the sample considered to determine the position of the coding unit is not to be interpreted as being limited to the upper left end as mentioned above, but may be interpreted as information related to the position of any sample included in the coding unit being used.

[0134] According to an embodiment, the video decoding apparatus 100 may select a coding unit at a predetermined position from among an odd number of coding units determined by dividing the current coding unit, taking into consideration the shape of the current coding unit. For example, if the current coding unit is a non-square shape in which the width is greater than the height, the video decoding apparatus 100 may determine a coding unit at a predetermined position along the horizontal direction. That is, the video decoding apparatus 100 may determine one of the coding units at different positions in the horizontal direction and set a restriction on the coding unit. If the current coding unit is a non-square shape in which the height is greater than the width, the video decoding apparatus 100 may determine a coding unit at a predetermined position along the vertical direction. That is, the video decoding apparatus 100 may determine one of the coding units at different positions in the vertical direction and set a restriction on the coding unit.

[0135] According to an embodiment, the video decoding apparatus 100 may use information indicating the positions of each of the even number of coding units to determine a coding unit at a predetermined position among the even number of coding units. The video decoding apparatus 100 may determine the even number of coding units by dividing (binary dividing) the current coding unit, and may determine the coding unit at a predetermined position by using information regarding the positions of the even number of coding units. A detailed process related to this process corresponds to the process of determining a coding unit at a predetermined position (e.g., a middle position) among the odd number of coding units described in FIG. 6, and therefore will not be described in detail.

[0136] According to an embodiment, when a non-square current coding unit is divided into a plurality of coding units, in order to determine a coding unit at a predetermined position among the plurality of coding units, the video decoding apparatus 100 may use predetermined information related to the coding unit at a predetermined position during the division process. For example, in order to determine a coding unit at a center among the plurality of coding units into which the current coding unit is divided, the video decoding apparatus 100 may use at least one of block shape information and partition shape mode information stored in a sample included in the center coding unit during the division process.

[0137] 6, the video decoding apparatus 100 may divide a current coding unit 600 into a plurality of coding units 620a, 620b, and 620c based on the partition mode information, and may determine a coding unit 620b located in the middle of the plurality of coding units 620a, 620b, and 620c. Furthermore, the video decoding apparatus 100 may determine the coding unit 620b located in the middle by considering a position where the partition mode information is acquired. That is, the partition mode information of the current coding unit 600 is also acquired from a sample 640 located in the middle of the current coding unit 600, and when the current coding unit 600 is divided into a plurality of coding units 620a, 620b, and 620c based on the partition mode information, the coding unit 620b including the sample 640 may be determined as the coding unit located in the middle. However, information used to determine the coding unit located in the middle is not limited to the partition mode information, and various types of information may be used in the process of determining the coding unit located in the middle.

[0138] According to an embodiment, the predetermined information for identifying a coding unit at a predetermined position is also obtained from a predetermined sample included in the coding unit to be determined. Referring to FIG. 6, the video decoding device 100 may use partition mode information obtained from a sample at a predetermined position in the current coding unit 600 (e.g., a sample at the middle of the current coding unit 600) to determine a coding unit at a predetermined position (e.g., a coding unit at the middle of the coding units) among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600. That is, the video decoding device 100 may determine the sample at the predetermined position by considering the block format of the current coding unit 600, and may determine a coding unit 620b including a sample from which predetermined information (e.g., partition mode information) can be obtained among a plurality of coding units 620a, 620b, and 620c determined by dividing the current coding unit 600, and may set a predetermined restriction. 6, according to an embodiment, the video decoding device 100 may determine a sample 640 located in the middle of the current coding unit 600 as a sample from which certain information may be acquired, and may set a certain restriction in a decoding process of a coding unit 620b including such a sample 640. However, the position of the sample from which certain information may be acquired is not limited to the above position, but may be a sample at any position included in the coding unit 620b determined to set the restriction.

[0139] According to an embodiment, the position of the sample from which the predetermined information can be obtained is also determined according to the shape of the current coding unit 600. According to an embodiment, the block shape information may determine whether the shape of the current coding unit is square or non-square, and may determine the position of the sample from which the predetermined information can be obtained according to the shape. For example, the video decoding apparatus 100 may determine, using at least one of information related to the width and information related to the height of the current coding unit, a sample located on a boundary that divides at least one of the width and height of the current coding unit in half as a sample from which the predetermined information can be obtained. For another example, when the block shape information related to the current coding unit indicates that the current coding unit is non-square, the video decoding apparatus 100 may determine, as a sample from which the predetermined information can be obtained, one of the samples adjacent to a boundary that divides the long side of the current coding unit in half.

[0140] According to an embodiment, when the current coding unit is divided into a plurality of coding units, the video decoding apparatus 100 may use partition mode information to determine a coding unit at a predetermined position among the plurality of coding units. According to an embodiment, the video decoding apparatus 100 may acquire partition mode information from a sample at a predetermined position included in the coding unit, and may divide a plurality of coding units generated by dividing the current coding unit using partition mode information acquired from a sample at a predetermined position included in each of the plurality of coding units. That is, the coding unit is also recursively divided using partition mode information acquired from a sample at a predetermined position included in each of the coding units. The recursive division process of the coding unit has been described with reference to FIG. 5, and therefore a detailed description thereof will be omitted.

[0141] In one embodiment, the video decoding device 100 can divide the current coding unit and determine at least one coding unit, and can determine the order in which such at least one coding unit is decoded by a predetermined block (e.g., the current coding unit).

[0142] FIG. 7 illustrates an order in which multiple coding units are processed when the video decoding device 100 divides a current coding unit and determines multiple coding units, according to an embodiment.

[0143] According to one embodiment, the video decoding device 100 may, according to the partition mode information, partition the first coding unit 700 vertically to determine the second coding units 710a and 710b, partition the first coding unit 700 horizontally to determine the second coding units 730a and 730b, or partition the first coding unit 700 vertically and horizontally to determine the second coding units 750a, 750b, 750c, and 750d.

[0144] 7, the video decoding device 100 may determine an order in which second coding units 710a and 710b determined by dividing the first coding unit 700 in the vertical direction are processed in a horizontal direction 710c. The video decoding device 100 may determine a processing order in which second coding units 730a and 730b determined by dividing the first coding unit 700 in the horizontal direction are processed in a vertical direction 730c. The video decoding device 100 may determine second coding units 750a, 750b, 750c, and 750d determined by dividing the first coding unit 700 in the vertical and horizontal directions in a predetermined order (e.g., a raster scan order or a z scan order 750e) in which a coding unit located in one row is processed and then a coding unit located in the next row is processed.

[0145] According to an embodiment, the video decoding apparatus 100 may recursively divide the coding units. Referring to FIG. 7, the video decoding apparatus 100 may divide the first coding unit 700 to determine a plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d, and may recursively divide each of the determined coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. A method of dividing the plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d corresponds to a method of dividing the first coding unit 700. Accordingly, the plurality of coding units 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d are also divided into a plurality of coding units independently. Referring to FIG 7, the video decoding device 100 may divide the first coding unit 700 in the vertical direction to determine the second coding units 710a and 710b, and may further determine whether or not to divide each of the second coding units 710a and 710b independently.

[0146] According to one embodiment, the video decoding device 100 may horizontally divide the second coding unit 710a on the left side into third coding units 720a and 720b, and may not divide the second coding unit 710b on the right side.

[0147] According to an embodiment, the processing order of the coding units is also determined based on the division process of the coding units. In other words, the processing order of the divided coding units is also determined based on the processing order of the coding units immediately before the division. The video decoding apparatus 100 may determine the processing order of the third coding units 720a and 720b determined by dividing the second coding unit 710a on the left side, independently of the second coding unit 710b on the right side. Since the second coding unit 710a on the left side is divided in the horizontal direction and the third coding units 720a and 720b are determined, the third coding units 720a and 720b are also processed in the vertical direction 720c. In addition, since the processing order of the second coding unit 710a on the left side and the second coding unit 710b on the right side corresponds to the horizontal direction 710c, the third coding units 720a and 720b included in the second coding unit 710a on the left side may be processed in the vertical direction 720c before the right coding unit 710b is processed. The above content is intended to explain the process in which the processing order of coding units is determined based on the coding units before they are divided, and therefore should not be interpreted as being limited to the above embodiment, but should be interpreted as being applicable to various methods in which coding units that are divided and determined in various forms can be processed independently in a predetermined order.

[0148] FIG. 8 illustrates a process in which the video decoding device 100 determines to divide a current coding unit into an odd number of coding units when the coding units cannot be processed in a predetermined order, according to an embodiment.

[0149] According to an embodiment, the video decoding device 100 may determine that the current coding unit is divided into an odd number of coding units based on the acquired division mode information. Referring to FIG. 8, a square-shaped first coding unit 800 is also divided into non-square-shaped second coding units 810a and 810b, and the second coding units 810a and 810b are also independently divided into third coding units 820a, 820b, 820c, 820d, and 820e. According to an embodiment, the video decoding device 100 may divide the left coding unit 810a of the second coding unit in the horizontal direction to determine a plurality of third coding units 820a and 820b, and the right coding unit 810b is also divided into an odd number of third coding units 820c, 820d, and 820e.

[0150] According to an embodiment, the video decoding device 100 may determine whether the third coding units 820a, 820b, 820c, 820d, and 820e can be processed in a predetermined order, and may determine whether there is an odd number of coding units. Referring to FIG. 8, the video decoding device 100 may recursively divide the first coding unit 800 to determine the third coding units 820a, 820b, 820c, 820d, and 820e. The video decoding device 100 may determine whether the first coding unit 800, the second coding unit 810a, 810b, or the third coding unit 820a, 820b, 820c, 820d, and 820e are divided into an odd number of coding units in the division type based on at least one of the block type information and the division type mode information. For example, in the second coding units 810a and 810b, the coding units located on the right side are also divided into an odd number of third coding units 820c, 820d, and 820e. The order in which the multiple coding units included in the first coding unit 800 are processed may be a predetermined order (e.g., Z scan order 830), and the video decoding device 100 may determine whether the third coding units 820c, 820d, and 820e determined by dividing the right second coding unit 810b into an odd number of units satisfy a condition that they can be processed in the predetermined order.

[0151] According to an embodiment, the video decoding apparatus 100 may determine whether the third coding units 820a, 820b, 820c, 820d, and 820e included in the first coding unit 800 satisfy a condition that they may be processed in a predetermined order, the condition being related to whether at least one of the width and height of the second coding units 810a and 810b is divided in half along the boundary between the third coding units 820a, 820b, 820c, 820d, and 820e. For example, the third coding units 820a and 820b determined by dividing the height of the non-square left second coding unit 810a in half may satisfy the condition. Since the boundaries of the third coding units 820c, 820d, and 820e determined by dividing the right second coding unit 810b into three coding units cannot divide the width or height of the right second coding unit 810b in half, it may be determined that the third coding units 820c, 820d, and 820e do not satisfy the condition. If such a condition is not satisfied, the video decoding device 100 may determine that there is a disconnection in the scanning order, and may determine that the right second coding unit 810b is to be divided into an odd number of coding units based on the determination result. According to an embodiment, the video decoding device 100 may set a predetermined restriction on a coding unit at a predetermined position among the divided coding units when the coding units are divided into an odd number of coding units. The content of such a restriction or the predetermined position has been described through various embodiments, and detailed description thereof will be omitted.

[0152] FIG. 9 illustrates a process in which the video decoding device 100 divides a first coding unit 900 to determine at least one coding unit, according to an embodiment.

[0153] According to an embodiment, the video decoding device 100 may divide the first coding unit 900 based on the division mode information acquired through a receiving unit (not shown). The square-shaped first coding unit 900 may be divided into four square-shaped coding units or into a plurality of non-square-shaped coding units. For example, referring to FIG. 9, if the first coding unit 900 is a square and the division mode information indicates that the first coding unit 900 is to be divided into non-square coding units, the video decoding device 100 may divide the first coding unit 900 into a plurality of non-square coding units. Specifically, when the division mode information indicates that the first coding unit 900 is to be divided horizontally or vertically to determine an odd number of coding units, the video decoding device 100 can divide the square-shaped first coding unit 900 into second coding units 910a, 910b, and 910c determined by dividing it vertically, or second coding units 920a, 920b, and 920c determined by dividing it horizontally, as an odd number of coding units.

[0154] According to an embodiment, the video decoding apparatus 100 may determine whether the second coding units 910a, 910b, 910c, 920a, 920b, and 920c included in the first coding unit 900 satisfy a condition that they can be processed in a predetermined order, and the condition is related to whether at least one of the width and height of the first coding unit 900 is divided in half along the boundary of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Referring to FIG. 9, since the boundary of the second coding units 910a, 910b, and 910c determined by dividing the square-shaped first coding unit 900 in the vertical direction does not divide the width of the first coding unit 900 in half, it may be determined that the first coding unit 900 does not satisfy the condition that they can be processed in a predetermined order. In addition, since the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the square first coding unit 900 in the horizontal direction do not divide the height of the first coding unit 900 in half, it may be determined that the first coding unit 900 does not satisfy the condition to be processed according to a predetermined order. If such a condition is not satisfied, the video decoding device 100 may determine that the scanning order is broken, and may determine that the first coding unit 900 is divided into an odd number of coding units based on the determination result. According to an embodiment, when the coding unit is divided into an odd number of coding units, the video decoding device 100 may set a predetermined restriction on a coding unit at a predetermined position among the divided coding units. The content of such a restriction or the predetermined position has been described through various embodiments, and detailed description thereof will be omitted.

[0155] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit and determine various types of coding units.

[0156] 9, the video decoding apparatus 100 may divide a square-shaped first coding unit 900, a non-square-shaped first coding unit 930, or a non-square-shaped first coding unit 950 into various types of coding units.

[0157] FIG. 10 illustrates that, according to one embodiment, when a non-square shaped second coding unit determined by dividing a first coding unit 1000 satisfies a certain condition, a manner in which the second coding unit may be divided is restricted by the video decoding device 100.

[0158] According to an embodiment, the video decoding device 100 may determine to divide the square-shaped first coding unit 1000 into non-square-shaped second coding units 1010a, 1010b, 1020a, and 1020b based on the division mode information acquired through a receiving unit (not shown). The second coding units 1010a, 1010b, 1020a, and 1020b may be divided independently. Thus, the video decoding device 100 may determine whether to divide the first coding unit 1000 into a plurality of coding units or not to divide the first coding unit 1000 based on the division mode information related to each of the second coding units 1010a, 1010b, 1020a, and 1020b. According to an embodiment, the video decoding device 100 may determine the third coding units 1012a and 1012b by dividing the left non-square-shaped second coding unit 1010a determined by dividing the first coding unit 1000 vertically in the horizontal direction. However, when the video decoding device 100 divides the left second coding unit 1010a in the horizontal direction, the right second coding unit 1010b may be restricted so that it cannot be divided horizontally in the same direction as the division direction of the left second coding unit 1010a. If the right second coding unit 1010b is divided in the same direction and the third coding units 1014a and 1014b are determined, the left second coding unit 1010a and the right second coding unit 1010b may be divided independently in the horizontal direction to determine the third coding units 1012a, 1012b, 1014a, and 1014b. However, this is the same result as when the video decoding device 100 divides the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division mode information, and this is inefficient in terms of video decoding.

[0159] According to an embodiment, the video decoding device 100 may vertically divide the non-square second coding unit 1020a or 1020b, which is determined by dividing the first coding unit 1000 in the horizontal direction, to determine the third coding units 1022a, 1022b, 1024a, and 1024b. However, when the video decoding device 100 divides one of the second coding units (e.g., the top second coding unit 1020a) in the vertical direction, the video decoding device 100 may restrict the other second coding units (e.g., the bottom coding unit 1020b) from being divided vertically in the same direction as the top second coding unit 1020a, for the above-mentioned reasons.

[0160] FIG. 11 illustrates a process in which the video decoding apparatus 100 divides a square-shaped coding unit when the division mode information does not indicate division into four square-shaped coding units, according to an embodiment.

[0161] According to an embodiment, the video decoding device 100 may divide the first coding unit 1100 and determine the second coding units 1110a, 1110b, 1120a, and 1120b based on the division mode information. The division mode information may include information related to various types into which the coding unit may be divided, but the information related to the various types may not include information for dividing the coding unit into four square coding units. According to such division mode information, the video decoding device 100 may not divide the square first coding unit 1100 into four square second coding units 1130a, 1130b, 1130c, and 1130d. Based on the division mode information, the video decoding device 100 may determine the non-square second coding units 1110a, 1110b, 1120a, and 1120b.

[0162] According to an embodiment, the video decoding apparatus 100 may independently divide the non-square second coding units 1110a, 1110b, 1120a, and 1120b, and through a recursive method, each of the second coding units 1110a, 1110b, 1120a, and 1120b is also divided in a predetermined order, which is a division method corresponding to the method in which the first coding unit 1100 is divided based on the division mode information.

[0163] For example, the video decoding device 100 may divide the left second coding unit 1110a in the horizontal direction to determine square third coding units 1112a and 1112b, and may divide the right second coding unit 1110b in the horizontal direction to determine square third coding units 1114a and 1114b. Furthermore, the video decoding device 100 may divide both the left second coding unit 1110a and the right second coding unit 1110b in the horizontal direction to determine square third coding units 1116a, 1116b, 1116c, and 1116d. In this case, the coding units may be determined in the same form as when the first coding unit 1100 is divided into four square second coding units 1130a, 1130b, 1130c, and 1130d.

[0164] For another example, the video decoding device 100 may vertically divide the top second coding unit 1120a to determine square third coding units 1122a and 1122b, and may vertically divide the bottom second coding unit 1120b to determine square third coding units 1124a and 1124b. Furthermore, the video decoding device 100 may vertically divide both the top second coding unit 1120a and the bottom second coding unit 1120b to determine square third coding units 1126a, 1126b, 1126a, and 1126b. In this case, the coding units may be determined in the same form as when the first coding unit 1100 is divided into four square second coding units 1130a, 1130b, 1130c, and 1130d.

[0165] FIG. 12 illustrates that a processing order among multiple coding units may vary depending on a division process of the coding units, according to an embodiment.

[0166] According to an embodiment, the video decoding apparatus 100 may divide the first coding unit 1200 based on the partition mode information. When the block shape is a square and the partition mode information indicates that the first coding unit 1200 is partitioned in at least one of the horizontal and vertical directions, the video decoding apparatus 100 may divide the first coding unit 1200 to determine, for example, second coding units 1210a, 1210b, 1220a, and 1220b. Referring to FIG. 12, the non-square second coding units 1210a, 1210b, 1220a, and 1220b determined by partitioning the first coding unit 1200 only in the horizontal or vertical direction are also independently divided based on the partition mode information associated therewith. For example, the video decoding apparatus 100 may horizontally divide the second coding units 1210a and 1210b, which are generated by dividing the first coding unit 1200 in the vertical direction, to determine the third coding units 1216a, 1216b, 1216c, and 1216d, and may vertically divide the second coding units 1220a and 1220b, which are generated by dividing the first coding unit 1200 in the horizontal direction, to determine the third coding units 1226a, 1226b, 1226c, and 1226d. The division process of the second coding units 1210a, 1210b, 1220a, and 1220b has been described with reference to FIG. 11, and a detailed description thereof will be omitted.

[0167] According to an embodiment, the video decoding device 100 may process the coding units in a predetermined order. The characteristics related to the processing of the coding units in the predetermined order have been described with reference to FIG. 7, and therefore detailed description thereof will be omitted. Referring to FIG. 12, the video decoding device 100 may divide the square-shaped first coding unit 1200 to determine four square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. According to an embodiment, the video decoding device 100 may determine a processing order of the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d according to the manner in which the first coding unit 1200 is divided.

[0168] According to one embodiment, the video decoding device 100 can horizontally divide the second coding units 1210a and 1210b generated by dividing them vertically to determine the third coding units 1216a, 1216b, 1216c, and 1216d, and the video decoding device 100 can process the third coding units 1216a, 1216b, 1216c, and 1216d in an order 1217 of first vertically processing the third coding units 1216a and 1216c included in the left second coding unit 1210a, and then vertically processing the third coding units 1216b and 1216d included in the right second coding unit 1210b.

[0169] According to one embodiment, the video decoding device 100 can vertically divide the second coding units 1220a and 1220b generated by dividing them horizontally to determine the third coding units 1226a, 1226b, 1226c, and 1226d, and the video decoding device 100 can process the third coding units 1226a, 1226b, 1226c, and 1226d in an order 1227 of first horizontally processing the third coding units 1226a and 1226b included in the upper second coding unit 1220a, and then horizontally processing the third coding units 1226c and 1226d included in the lower second coding unit 1220b.

[0170] 12, the second coding units 1210a, 1210b, 1220a, and 1220b are each divided to determine square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. The second coding units 1210a and 1210b determined by dividing in the vertical direction and the second coding units 1220a and 1220b determined by dividing in the horizontal direction are divided in different shapes, but the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d determined later are coding units of the same shape, resulting in the division of the first coding unit 1200. As a result, the video decoding device 100 recursively divides the coding units through different processes based on the division form mode information, so that even if coding units of the same form are determined as a result, multiple coding units determined to be of the same form can be processed in different orders from each other.

[0171] FIG. 13 illustrates a process of determining the depth of a coding unit according to one embodiment, when a coding unit is recursively divided to determine multiple coding units, as the shape and size of the coding unit change.

[0172] According to an embodiment, the video decoding apparatus 100 may determine the depth of the coding unit according to a predetermined criterion. For example, the predetermined criterion may be the long side length of the coding unit. The video decoding apparatus 100 may determine the depth of the coding unit according to a predetermined criterion. For example, the long side length of the current coding unit may be 2 times the long side length of the coding unit before being divided. n When the coding unit is divided by (n>0), it may be determined that the depth of the current coding unit is increased by n from the depth of the coding unit before the division. Hereinafter, the coding unit with the increased depth will be referred to as a coding unit of a lower depth.

[0173] Referring to FIG. 13, according to an embodiment, the video decoding apparatus 100 may divide the square-shaped first coding unit 1300 based on block shape information indicating a square shape (for example, the block shape information may indicate "0:SQUARE") to determine a second coding unit 1302, a third coding unit 1304, etc., of a lower depth. If the size of the square-shaped first coding unit 1300 is 2Nx2N, the second coding unit 1302 determined by dividing the width and height of the first coding unit 1300 by 1 / 2 may have a size of NxN. Furthermore, the third coding unit 1304 determined by dividing the width and height of the second coding unit 1302 by 1 / 2 may have a size of N / 2xN / 2. In this case, the width and height of the third coding unit 1304 correspond to 1 / 4 times that of the first coding unit 1300. If the depth of the first coding unit 1300 is D, the depth of the second coding unit 1302, which is 1 / 2 the width and height of the first coding unit 1300, is also D+1, and the depth of the third coding unit 1304, which is 1 / 4 the width and height of the first coding unit 1300, is also D+2.

[0174] According to one embodiment, 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 in which the height is greater than the width, or "2:NS_HOR" indicating a non-square shape in which the width is greater than the height), the video decoding device 100 may divide the first coding unit 1310 or 1320, which is non-square, and determine a second coding unit 1312 or 1322, a third coding unit 1314 or 1324, etc., of a lower depth.

[0175] The video decoding device 100 may divide at least one of the width and height of the first coding unit 1310 having a size of Nx2N to determine, for example, the second coding units 1302, 1312, and 1322. That is, the video decoding device 100 may divide the first coding unit 1310 in the horizontal direction to determine the second coding unit 1302 having a size of NxN or the second coding unit 1322 having a size of NxN / 2, or may divide the first coding unit 1310 in the horizontal and vertical directions to determine the second coding unit 1312 having a size of N / 2xN.

[0176] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the first coding unit 1320 having a size of 2NxN to determine, for example, the second coding units 1302, 1312, and 1322. That is, the video decoding device 100 may divide the first coding unit 1320 vertically to determine the second coding unit 1302 having a size of NxN or the second coding unit 1312 having a size of N / 2xN, and may divide the first coding unit 1320 horizontally and vertically to determine the second coding unit 1322 having a size of NxN / 2.

[0177] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1302 having a size of NxN, to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1302 in the vertical and horizontal directions to determine the third coding unit 1304 having a size of N / 2xN / 2, the third coding unit 1314 having a size of N / 4xN / 2, or the third coding unit 1324 having a size of N / 2xN / 4.

[0178] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1312 having a size of N / 2xN to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1312 in the horizontal direction to determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1324 having a size of N / 2xN / 4, or may divide the second coding unit 1312 in the vertical and horizontal directions to determine the third coding unit 1314 having a size of N / 4xN / 2.

[0179] According to an embodiment, the video decoding device 100 may divide at least one of the width and height of the second coding unit 1322 having a size of NxN / 2 to determine, for example, the third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1322 vertically to determine the third coding unit 1304 having a size of N / 2xN / 2 or the third coding unit 1314 having a size of N / 4xN / 2, or may divide the second coding unit 1322 vertically and horizontally to determine the third coding unit 1324 having a size of N / 2xN / 4.

[0180] According to an embodiment, the video decoding apparatus 100 may divide, for example, square-shaped coding units 1300, 1302, and 1304 in the horizontal or vertical direction. For example, the first coding unit 1300 having a size of 2Nx2N may be divided vertically to determine a first coding unit 1310 having a size of Nx2N, or may be divided horizontally to determine a first coding unit 1320 having a size of 2NxN. According to an embodiment, when the depth is determined based on the longest side length of the coding unit, the depth of the coding unit determined by dividing the first coding unit 1300 having a size of 2Nx2N in the horizontal or vertical direction may be the same as the depth of the first coding unit 1300.

[0181] According to an embodiment, the width and height of the third coding unit 1314 or 1324 also correspond to 1 / 4 times that of the first coding unit 1310 or 1320. When the depth of the first coding unit 1310 or 1320 is D, the depth of the second coding unit 1312 or 1322, which is 1 / 2 times the width and height of the first coding unit 1310 or 1320, is also D+1, and the depth of the third coding unit 1314 or 1324, which is 1 / 4 times the width and height of the first coding unit 1310 or 1320, is also D+2.

[0182] FIG. 14 illustrates a depth determined according to the type and size of a coding unit and an index (PID: part index) for coding unit partitioning according to one embodiment.

[0183] According to an embodiment, the video decoding device 100 may divide the square-shaped first coding unit 1400 to determine various types of second coding units. Referring to FIG 14, the video decoding device 100 may divide the first coding unit 1400 in at least one of a vertical direction and a horizontal direction according to the partition mode information to determine the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d. That is, the video decoding device 100 may determine the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d based on the partition mode information related to the first coding unit 1400.

[0184] According to an embodiment, the depths of the second coding units 1402a, 1402b, 1404a, 1404b, 1406a, 1406b, 1406c, and 1406d determined by the partition mode information related to the square-shaped first coding unit 1400 may be determined based on the long side length. For example, since the length of one side of the square-shaped first coding unit 1400 is the same as the long side length of the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b, the depths of the first coding unit 1400 and the non-square-shaped second coding units 1402a, 1402b, 1404a, and 1404b can be regarded as being the same as D. In contrast, when the video decoding device 100 divides the first coding unit 1400 into four square-shaped second coding units 1406a, 1406b, 1406c, and 1406d based on the division mode information, the length of one side of the square-shaped second coding units 1406a, 1406b, 1406c, and 1406d is half the length of one side of the first coding unit 1400, so the depth of the second coding units 1406a, 1406b, 1406c, and 1406d is also a depth of D+1, which is one depth lower than the depth D of the first coding unit 1400.

[0185] According to an embodiment, the video decoding device 100 may divide the first coding unit 1410, whose height is greater than its width, in the horizontal direction according to the partition mode information, and divide the first coding unit 1410 into a plurality of second coding units 1412a, 1412b, 1414a, 1414b, and 1414c. According to an embodiment, the video decoding device 100 may divide the first coding unit 1420, whose width is greater than its height, in the vertical direction according to the partition mode information, and divide the first coding unit 1420 into a plurality of second coding units 1422a, 1422b, 1424a, 1424b, and 1424c.

[0186] According to an embodiment, the depths of the second coding units 1412a, 1412b, 1414a, 1414b, 1414c, 1422a, 1422b, 1424a, 1424b, and 1424c determined by the partition mode information related to the non-square first coding unit 1410 or 1420 may be determined based on the long side length. For example, the length of one side of the square second coding units 1412a and 1412b is ½ times the length of one side of the non-square first coding unit 1410 whose height is greater than its width, so the depths of the square second coding units 1412a and 1412b are D+1, which is one depth lower than the depth D of the non-square first coding unit 1410.

[0187] Furthermore, the video decoding device 100 can divide the non-square first coding unit 1410 into an odd number of second coding units 1414a, 1414b, and 1414c based on the division mode information. The odd number of second coding units 1414a, 1414b, and 1414c may include the non-square second coding units 1414a and 1414c and the square second coding unit 1414b. In this case, the long side length of the non-square second coding units 1414a and 1414c and the side length of the square second coding unit 1414b are 1 / 2 times the side length of the first coding unit 1410, so that the depths of the second coding units 1414a, 1414b, and 1414c are also a depth of D+1, which is one depth lower than the depth D of the first coding unit 1410. The video decoding device 100 may determine the depth of a coding unit associated with a non-square first coding unit 1420, whose width is greater than its height, in a manner corresponding to the above-mentioned manner for determining the depth of a coding unit associated with the first coding unit 1410.

[0188] According to an embodiment, the video decoding apparatus 100 may determine an index (PID) for a divided coding unit partition based on a size ratio between the coding units when the coding units divided into an odd number of coding units are not the same size. Referring to FIG. 14, the coding unit 1414b located in the middle of the coding units 1414a, 1414b, and 1414c divided into an odd number of coding units has the same width as the other coding units 1414a and 1414c, but is twice as high as the other coding units 1414a and 1414c. That is, in this case, the coding unit 1414b located in the middle may include the other coding units 1414a and 1414c. Therefore, if the index (PID) of the coding unit 1414b located in the middle according to the scanning order is 1, the index of the coding unit 1414c located next in the order is 3, which is increased by 2. That is, discontinuity of index values ​​may exist. According to one embodiment, the video decoding device 100 can determine whether coding units divided into an odd number of parts are not the same size as each other based on the existence of index discontinuity for such partitions between the divided coding units.

[0189] According to an embodiment, the video decoding apparatus 100 may determine whether the current coding unit is divided into a specific division type based on the value of an index for distinguishing the plurality of coding units determined by dividing the current coding unit. Referring to FIG. 14, the video decoding apparatus 100 may divide a first coding unit 1410 having a rectangular shape with a height greater than a width to determine an even number of coding units 1412a, 1412b or an odd number of coding units 1414a, 1414b, 1414c. The video decoding apparatus 100 may use an index (PID) indicating each coding unit to distinguish each of the plurality of coding units. According to an embodiment, the index (PID) may also be obtained from a predetermined position sample (e.g., the top left sample) of each coding unit.

[0190] According to an embodiment, the video decoding apparatus 100 may determine a coding unit at a predetermined position among the coding units determined by division using an index for coding unit division. According to an embodiment, when the division mode information related to a rectangular first coding unit 1410 having a height greater than a width indicates that the first coding unit 1410 is divided into three coding units, the video decoding apparatus 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The video decoding apparatus 100 may assign an index related to each of the three coding units 1414a, 1414b, and 1414c. The video decoding apparatus 100 may compare the indexes related to each coding unit to determine a middle coding unit among the odd number of coding units. The video decoder 100 may determine a coding unit 1414b having an index corresponding to a median value among the indices based on the indices of the coding units as a coding unit in a middle position among the coding units determined by dividing the first coding unit 1410. According to an embodiment, in determining an index for a divided coding unit partition, if the coding units are not the same size, the video decoder 100 may determine an index based on a size ratio between the coding units. Referring to FIG. 14, the coding unit 1414b generated by dividing the first coding unit 1410 has the same width as the other coding units 1414a and 1414c, but is twice as high as the coding units 1414a and 1414c, which have different heights. In this case, if the index (PID) of the coding unit 1414b located in the middle is 1, the index of the coding unit 1414c located next thereto is 3, which is increased by 2.In such a case, when the index increases uniformly and the width of the middle increase is different, the video decoding device 100 may determine that the current coding unit is divided into a plurality of coding units including a coding unit having a different size from other coding units. According to an embodiment, when the division mode information indicates that the current coding unit is divided into an odd number of coding units, the video decoding device 100 may divide the current coding unit into a form in which a coding unit at a predetermined position (e.g., a middle coding unit) among the odd number of coding units has a different size from other coding units. In this case, the video decoding device 100 may determine the middle coding unit having a different size using an index (PID) related to the coding unit. However, the above index and the size or position of the coding unit at the predetermined position to be determined are specified for the purpose of explaining an embodiment, and should not be interpreted as being limited thereto, and various indexes, positions and sizes of coding units may be used.

[0191] According to an embodiment, the video decoding device 100 can use a predetermined data unit from which the recursive division of the coding unit begins.

[0192] FIG. 15 illustrates a plurality of coding units being determined according to a plurality of predetermined data units included in a picture, according to one embodiment.

[0193] According to an embodiment, the predetermined data unit is also defined as a data unit into which the coding unit starts to be recursively divided using the division mode information. That is, it also corresponds to a coding unit of the highest depth used in the process of determining a plurality of coding units into which the current picture is divided. Hereinafter, for convenience of explanation, such a predetermined data unit will be referred to as a reference data unit.

[0194] According to an embodiment, the reference data unit may have a predetermined size and shape. According to an embodiment, the reference coding unit may include MxN samples, where M and N may be the same as each other or may be integers expressed by a power of 2. That is, the reference data unit may have a square or non-square shape, and is subsequently divided into an integer number of coding units.

[0195] According to an embodiment, the video decoding apparatus 100 may divide the current picture into a plurality of reference data units. According to an embodiment, the video decoding apparatus 100 may divide the plurality of reference data units into which the current picture is divided, using partition mode information associated with each of the reference data units. The division process of the reference data units may also correspond to a division process using a quad-tree structure.

[0196] According to an embodiment, the video decoding apparatus 100 may determine in advance a minimum size that a reference data unit included in a current picture may have, and may determine reference data units of various sizes that are equal to or larger than the minimum size, and may determine at least one coding unit using partition mode information based on the determined reference data unit.

[0197] 15, the video decoding apparatus 100 may use a square-shaped reference coding unit 1500 or a non-square-shaped reference coding unit 1502. According to an embodiment, the shape and size of the reference coding unit may be determined according to 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 may include at least one reference coding unit.

[0198] According to an embodiment, a receiving unit (not shown) of the video decoding apparatus 100 may obtain at least one of information related to the type of the base coding unit and information related to the size of the base coding unit from a bitstream for each of the various data units. The process of determining at least one coding unit included in the square-shaped base coding unit 1500 has been described through the process of dividing the current coding unit 300 in Fig. 3, and the process of determining at least one coding unit included in the non-square-shaped base coding unit 1502 has been described through the process of dividing the current coding unit 400 or 450 in Fig. 4, so detailed description thereof will be omitted.

[0199] According to an embodiment, the video decoding apparatus 100 may use an index for identifying the size and type of the reference coding unit in order to determine the size and type of the reference coding unit according to a certain data unit that is predetermined based on a predetermined condition. That is, a receiving unit (not shown) may acquire only an index for identifying the size and type of the reference coding unit for each slice, slice segment, tile, tile group, maximum coding unit, etc. as a data unit that satisfies a predetermined condition (e.g., a data unit having a size equal to or smaller than a slice) among the 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 video decoding apparatus 100 may determine the size and type of the reference data unit for each data unit that satisfies the predetermined condition by using the index. If the information on the type of the reference coding unit and the information on the size of the reference coding unit are obtained from the bitstream for each data unit of a relatively small size and used, the bitstream utilization efficiency becomes poor, so instead of directly obtaining the information on the type of the reference coding unit and the information on the size of the reference coding unit, only the index can be obtained and used. In this case, at least one of the size and the type of the reference coding unit corresponding to the index indicating the size and the type of the reference coding unit is also predetermined. That is, the video decoding device 100 can determine at least one of the size and the type of the reference coding unit included in the data unit that is the basis for obtaining the index by selecting at least one of the size and the type of the predetermined base coding unit according to the index.

[0200] According to an embodiment, the video decoding apparatus 100 may use at least one reference coding unit included in one maximum coding unit. That is, the maximum coding unit into which a video is divided includes at least one reference coding unit, and coding units may be determined through a recursive division process of each reference coding unit. According to an embodiment, at least one of the width and height of the maximum coding unit corresponds to at least one integer multiple of the width and height of the reference coding unit. According to an embodiment, the size of the reference coding unit is a size obtained by dividing the maximum coding unit n times according to a quad tree structure. That is, the video decoding apparatus 100 may determine the reference coding unit by dividing the maximum coding unit n times according to a quad tree structure, and may divide the reference coding unit based on at least one of block configuration information and partition configuration mode information according to various embodiments.

[0201] FIG. 16 illustrates processing blocks that are responsible for determining a determination order of reference coding units included in a picture 1600 according to one embodiment.

[0202] According to an embodiment, the video decoding apparatus 100 may determine at least one processing block for dividing a picture. The processing block is a data unit including at least one reference coding unit for dividing a picture, and the at least one reference coding unit included in the processing block may be determined in a specific order. That is, the determination order of the at least one reference coding unit determined in each processing block corresponds to one of various types of orders in which the reference coding unit may be determined, and the determination order of the reference coding unit determined in each processing block may differ for each processing block. The determination order of the reference coding unit determined for each processing block may be one of various orders such as a raster scan, a Z scan, an N scan, an up-right diagonal scan, a horizontal scan, and a vertical scan, but the order that may be determined is not limited to the scan order.

[0203] According to an embodiment, the video decoding device 100 may obtain information related to the size of the processing block and determine the size of at least one processing block included in the image. The video decoding device 100 may obtain information related to the size of the processing block from a bitstream and determine the size of at least one processing block included in the image. The size of such a processing block is also a predetermined size of a data unit indicated by the information related to the size of the processing block.

[0204] According to an embodiment, a receiving unit (not shown) of the video decoding device 100 may obtain information on the size of a processing block for each specific data unit from a bitstream. For example, the information on the size of a processing block may be obtained from a bitstream for each data unit such as an image, a sequence, a picture, a slice, a slice segment, a tile, a tile group, etc. That is, the receiving unit (not shown) may obtain information on the size of a processing block from a bitstream for each of the multiple data units, and the video decoding device 100 may determine the size of at least one processing block for dividing a picture using the obtained information on the size of the processing block, and the size of such a processing block may be an integer multiple of a reference coding unit.

[0205] According to an embodiment, the video decoding device 100 may determine the size of the processing blocks 1602 and 1612 included in the picture 1600. For example, the video decoding device 100 may determine the size of the processing blocks based on information related to the size of the processing blocks acquired from a bitstream. Referring to FIG. 16, according to an embodiment, the video decoding device 100 may determine the horizontal size of the processing blocks 1602 and 1612 to be four times the horizontal size of a reference coding unit and the vertical size of the processing blocks 1602 and 1612 to be four times the vertical size of the reference coding unit. The video decoding device 100 may determine an order in which at least one reference coding unit is determined within at least one processing block.

[0206] According to an embodiment, the video decoding device 100 may determine each of the processing blocks 1602, 1612 included in the picture 1600 based on the size of the processing block, and may determine a determination order of at least one reference coding unit included in the processing blocks 1602, 1612. According to an embodiment, the determination of the reference coding unit may include determining the size of the reference coding unit.

[0207] According to an embodiment, the video decoding apparatus 100 may acquire information on a determination order of at least one reference coding unit included in at least one processing block from a bitstream, and may determine an order in which at least one reference coding unit is determined based on the acquired information on the determination order. The information on the determination order may also be defined as an order or direction in which the reference coding unit is determined within a processing block. That is, the order in which the reference coding unit is determined may be determined independently for each processing block.

[0208] According to an embodiment, the video decoding apparatus 100 may obtain information on a determination order of the reference coding units from a bitstream for each specific data unit. For example, a receiving unit (not shown) may obtain information on a determination order of the reference coding units from a bitstream for each data unit such as an image, a sequence, a picture, a slice, a slice segment, a tile, a tile group, a processing block, etc. Since the information on the determination order of the reference coding units indicates a determination order of the reference coding units within a processing block, the information on the determination order is also obtained for each specific data unit including an integer number of processing blocks.

[0209] According to one embodiment, the video decoding device 100 may determine at least one reference coding unit based on the determined order.

[0210] According to an embodiment, a receiving unit (not shown) may acquire information related to a base coding unit determination order as information related to the processing blocks 1602 and 1612 from a bitstream, and the video decoding apparatus 100 may determine an order for determining at least one base coding unit included in the processing blocks 1602 and 1612, and may determine at least one base coding unit included in the picture 1600 according to the determination order of the coding units. Referring to FIG 16, the video decoding apparatus 100 may determine a determination order 1604 and 1614 of at least one base coding unit associated with each of the processing blocks 1602 and 1612. For example, when information related to the determination order of the base coding units is acquired for each processing block, the determination order of the base coding units associated with each of the processing blocks 1602 and 1612 may differ for each processing block. When the reference coding unit determination order 1604 associated with the processing block 1602 is a raster scan order, the reference coding units included in the processing block 1602 are also determined in the raster scan order. On the other hand, when the reference coding unit determination order 1614 associated with another processing block 1612 is a reverse order of the raster scan order, the reference coding units included in the processing block 1612 are also determined in the reverse order of the raster scan order.

[0211] According to an embodiment, the video decoder 100 may decode at least one reference coding unit determined. The video decoder 100 may decode video based on the reference coding unit determined through the above-described embodiment. The method of decoding the reference coding unit may include various methods of decoding video.

[0212] According to an embodiment, the video decoding apparatus 100 may acquire and use block type information indicating a type of a current coding unit or partition type mode information indicating a method of dividing the current coding unit from a bitstream. The partition type mode information may also be included in a bitstream associated with various data units. For example, the video decoding apparatus 100 may use partition type mode information included in a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, or a tile group header. Furthermore, the video decoding apparatus 100 may acquire and use a syntax element corresponding to block type information or partition type mode information from the bitstream for each of a maximum coding unit, a reference coding unit, and a processing block.

[0213] A method for determining a division rule according to an embodiment of the present disclosure will now be described in detail.

[0214] The video decoding device 100 may determine a partitioning rule for a video. The partitioning rule may be predetermined between the video decoding device 100 and the video encoding device 150. The video decoding device 100 may determine the partitioning rule for a video based on information acquired from a bitstream. The video decoding device 100 may determine the partitioning rule based on information acquired from at least one of a sequence parameter set, a picture parameter set, a video parameter set, a slice header, a slice segment header, a tile header, and a tile group header. The video decoding device 100 may determine the partitioning rule to be different depending on a frame, a slice, a temporal layer, a maximum coding unit, or a coding unit.

[0215] The video decoding device 100 may determine the partitioning rule based on the block type of the coding unit. The block type may include the size, shape, width-to-height ratio, and direction of the coding unit. The video encoding device 150 and the video decoding device 100 may determine in advance to determine the partitioning rule based on the block type of the coding unit. However, the present invention is not limited thereto. The video decoding device 100 may determine the partitioning rule based on information acquired from a bitstream received from the video encoding device 150.

[0216] The shape of the coding unit may include a square and a non-square. If the width and height of the coding unit are the same, the video decoding device 100 may determine the shape of the coding unit to be a square. If the width and height of the coding unit are not the same, the video decoding device 100 may determine the shape of the coding unit to be a non-square.

[0217] The size of the coding unit may include various sizes such as 4x4, 8x4, 4x8, 8x8, 16x4, 16x8, ..., 256x256. The size of the coding unit may also be classified according to the long side length, short side length, or width of the coding unit. The video decoding device 100 may apply the same division rule to the coding units classified into the same group. For example, the video decoding device 100 may classify the coding units having the same long side length into the same size. Furthermore, the video decoding device 100 may apply the same division rule to the coding units having the same long side length.

[0218] The ratio of the width to the height of the coding unit may include 1:2, 2:1, 1:4, 4:1, 1:8, 8:1, 1:16, 16:1, etc. Also, the direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate a case where the width of the coding unit is greater than the height. The vertical direction may indicate a case where the width of the coding unit is smaller than the height.

[0219] The video decoding device 100 may adaptively determine a partitioning rule based on the size of the coding unit. The video decoding device 100 may determine an allowable partitioning mode differently based on the size of the coding unit. For example, the video decoding device 100 may determine whether partitioning is allowed based on the size of the coding unit. The video decoding device 100 may determine a partitioning direction according to the size of the coding unit. The video decoding device 100 may determine an allowable partitioning type according to the size of the coding unit.

[0220] Determining the partitioning rule based on the size of the coding unit is also a default partitioning rule between the video encoding device 150 and the video decoding device 100. In addition, the video decoding device 100 can determine the partitioning rule based on information obtained from the bitstream.

[0221] The video decoding device 100 can adaptively determine the partitioning rule based on the position of the coding unit. The video decoding device 100 can adaptively determine the partitioning rule based on the position that the coding unit occupies in the video.

[0222] In addition, the video decoding apparatus 100 may determine a partition rule such that the coding units generated in different partition paths do not have the same block type. However, the present invention is not limited thereto, and the coding units generated in different partition paths may have the same block type. The coding units generated in different partition paths may have different decoding process orders. The decoding process order has been described with reference to FIG. 12, and therefore will not be described in detail.

[0223] Hereinafter, a process of adaptively configuring intra prediction mode candidates according to block types and performing intra prediction using the intra prediction mode candidates according to various embodiments disclosed herein will be described in detail with reference to Figures 17 to 31. The intra prediction process according to various embodiments may also be performed by the decoder 120 of the video decoder 100 of Figure 1A and the encoder 155 of the video encoder 150 of Figure 2A. Specifically, the intra prediction process according to various embodiments may also be performed by the intra predictor 6400 of the decoder 6000 of Figure 1C and the intra predictor 7200 of the encoder 7000 of Figure 2C.

[0224] FIG. 17 is a diagram illustrating intra prediction modes according to one embodiment, and FIG. 18 is a diagram illustrating intra prediction modes according to another embodiment.

[0225] According to various embodiments, intra prediction modes may include non-angular intra prediction modes that have no directionality, such as a planar mode and a DC mode, and angular intra prediction modes that have directionality.

[0226] 17 and 18, the directional intra prediction mode includes an intra prediction mode indicating a specific direction in the range of -135° to -180° and 45° to 180° based on the directions of 45° and -135°.

[0227] In the following description, the angle of the prediction direction in the range of 0 to 180° indicating the direction on the first and second quadrants may be expressed as +, and the angle of the prediction direction in the range of -180 to 0° indicating the direction on the third and fourth quadrants may be expressed as -. A predetermined angle -a (a is a positive real number) indicating the direction on the third and fourth quadrants indicates the same direction as (360-a)°. For example, the -135° direction is the same direction as the 225° direction, and the -180° direction is the same direction as the 180° direction.

[0228] The prediction direction indicated by the arrow direction in Figures 17 and 18 indicates the direction of the surrounding pixels used for intra prediction based on the current pixel to be intra predicted of the current block. Also, the numbers illustrated in Figures 17 and 18 exemplify intra prediction mode indexes (predModeIntra) according to the intra prediction directions. For the Planar mode, which is a non-directional intra prediction mode, the value of predModeIntra is set to 0, and for the DC mode, the value of predModeIntra is also set to 1.

[0229] 17, the directional intra prediction modes according to an embodiment may include 33 intra prediction modes obtained by dividing the range between 45° and −135° into 33. The 33 directional intra prediction modes may have predModeIntra values ​​of 2 to 34 in a clockwise direction from the −135° direction.

[0230] Referring to FIG. 18, the directional intra prediction mode according to an embodiment may include 65 intra prediction modes obtained by dividing the range between -135° to -180° and 45° to 180° into 65 with respect to the directions of 45° and -135°. The 65 directional intra prediction modes may sequentially have predModeIntra values ​​from 2 to 66 in a clockwise direction from the -135° direction. The preModeIntra values ​​of the intra prediction modes are not limited to those shown in FIG. 17 and FIG. 18 and may be changed. For example, the number of directional intra prediction modes from the 45° direction to the clockwise direction is not limited to 33 or 65 and may be changed, and the predModeIntra values ​​of the directional intra prediction modes may be sequentially set in a counterclockwise direction from the 45° direction, and the set predModeIntra value may also be changed. Without being limited thereto, the directional intra-prediction modes may include a predetermined number of intra-prediction modes indicating particular directions within any range of A° (A is a real number) to B° (B is a real number).

[0231] Depending on the color components that make up a picture, images are also classified into monochrome images that contain only a luma component, images that contain one luma component and two chroma components (YCbCr or YCgCo), RGB images, etc. Images that contain one luma component and two chroma components are also classified into 4:4:4 format images, 4:2:2 format images, 4:2:0 format images, etc., depending on the sampling ratio of the luma component and the chroma component.

[0232] In a 4:4:4 format video, the luma component and the chroma component have the same sampling ratio, i.e., if the size of a luma component block is 2Nx2N (N is an integer), the size of the corresponding chroma component block is also 2Nx2N.

[0233] In a 4:2:2 format video, the luma and chroma components have the same sampling ratio in the vertical direction, but the chroma component sampling ratio in the horizontal direction is half that of the luma component sampling ratio, i.e., if the size of a luma component block is 2Nx2N, the size of the corresponding chroma component block is Nx2N.

[0234] In a 4:2:0 format video, the sampling ratio between two chroma components is half that of the luma component, i.e., if the size of a luma component block is 2Nx2N, the size of the corresponding chroma component block is NxN.

[0235] FIG. 19 shows luma and chroma sample positions according to a 4:2:2 format according to one embodiment.

[0236] 19, as described above, in a 4:2:2 format image, the luma component and the chroma component have the same sampling ratio in the vertical direction, but the chroma component sampling ratio in the horizontal direction is 1 / 2 that of the luma component. That is, only one chroma component is sampled for every two horizontal luma components. Therefore, in a 4:2:2 format image, the luma component and the chroma component have the same resolution in the vertical direction, but the chroma component resolution in the horizontal direction is 1 / 2 that of the luma component. When the size of a luma component block is 2Nx2N, the size of the corresponding chroma component block is Nx2N.

[0237] The intra prediction modes of Figures 17 and 18 described above are set in consideration of a square shape. However, as described in Figures 3 to 5, according to an embodiment, data units such as coding units, prediction units, and transform units may have a non-square shape, not just a square shape. Also, according to the 4:2:2 format, even if a luma component has a square shape, a corresponding chroma component block has a non-square shape.

[0238] Therefore, according to various embodiments, when the current block has a non-square shape, intra prediction mode candidates are adaptively configured according to the shape of the current block, and intra prediction is performed using the adaptively configured intra prediction mode candidates.

[0239] Figure 23 is a reference diagram showing the positions of surrounding pixels according to the prediction direction of an intra prediction mode applied to a square block when the intra prediction mode is applied to a current block whose width is greater than its height, and Figure 24 is a reference diagram showing the positions of surrounding pixels according to the prediction direction of an intra prediction mode applied to a square block when the intra prediction mode is applied to a current block whose height is greater than its width.

[0240] 23, the current block is a block having a non-square shape of 8x4 with a width W of 8 and a height H of 4. When an intra prediction mode 2314 close to a direction indicated by -135° is applied to a current pixel A 2310 to be intra predicted, the current pixel A 2310 is predicted to a value of a surrounding pixel L 2311, and a surrounding pixel T 2312 indicated by an opposite direction 2315 of the intra prediction mode 2314 is not used for intra prediction of the current pixel A 2310 because the surrounding pixel T 2312 is spatially closer to the current pixel A 2310 than the surrounding pixel L 2311. Such an opposite direction 2315 is a direction not included in the prediction directions of intra prediction modes set between -135° and 45° applied to square blocks.

[0241] 24, the current block is a 4x8 non-square block with a width W of 4 and a height H of 8. When an intra prediction mode 2413 close to 45° is applied to a current pixel A 2410 to be intra predicted of the current block, the current pixel A 2410 is predicted to the value of a surrounding pixel T 2411, which is spatially closer to the current pixel A 2410 than the surrounding pixel T 2411, and a surrounding pixel L 2412 indicated by an opposite direction 2414 of the intra prediction mode 2413 is not used for intra prediction of the current pixel A 2410. Such an opposite direction 2414 is also not included in the prediction directions between -135° and 45° applied to square blocks.

[0242] The prediction direction between -135° and 45° according to the intra prediction mode applied to the square block evenly indicates the upper and left surrounding samples. Therefore, when the intra prediction mode applied to the square block is applied to a non-square, i.e., rectangular, block, a reference sample at a spatially distant position is used as the predicted value of the current pixel instead of a nearby sample. As such, the intra prediction mode applied to the square block cannot fully indicate the surrounding samples in the direction having the longer length among the width and height. For example, the intra prediction mode indicating the direction between -135° and -180° and the direction between 45° and -135° applied to the square block does not include the prediction direction between 0° and 45°, so that in the current block whose width is greater than its height as shown in FIG. 23 described above, it cannot fully indicate the upper right surrounding pixel located in the direction between 0° and 45° based on the current pixel. In addition, the intra prediction modes indicating directions between -135° to -180° and between 45° to 180° based on the directions of 45° and -135° applied to square blocks do not include prediction directions between -90° to -135°, and therefore cannot fully indicate neighboring pixels located in the lower left direction in the directions between -90° to -135° based on the current pixel in a current block whose height is greater than its width as shown in Figure 24. Therefore, when the intra prediction modes applied to square blocks are applied to non-square blocks, the intra prediction efficiency decreases.

[0243] To address such issues, various embodiments may adaptively change the intra prediction mode applied to the square shaped block when the current block has a non-square shape, and configure the intra prediction mode applied to the non-square shaped block.

[0244] Hereinafter, a process of adaptively configuring intra prediction mode candidates based on the type of a current block according to an embodiment will be described with reference to FIGS. 20A to 20C, 21 and 22. FIG.

[0245] 20A illustrates candidate intra prediction modes applied to a square-shaped current block according to an embodiment. When a current block 2010 has a square shape with the same width and height, a predetermined number of intra prediction modes indicating directions in the ranges of -135° to -180° and 45° to 180° based on the directions of 45° and -135° may be applied as the intra prediction mode of the current block 2010. Hereinafter, a set of intra prediction modes applicable to a square-shaped block is also referred to as a first candidate intra prediction mode.

[0246] FIG. 20B illustrates a scheme for changing the intra prediction mode applied to a square block to configure the intra prediction mode applied to a current block whose width is greater than its height, according to one embodiment.

[0247] The upper part of FIG. 20B illustrates a case where a first intra prediction mode candidate applied to a square block is directly applied to a rectangular current block 2015. Referring to the upper part of FIG. 20B, a certain number of intra prediction modes 2011 and 2012 indicating a lower left direction and a direction close to the lower left direction included in the first intra prediction mode candidate indicate surrounding pixels at spatially distant positions. Also, if the first intra prediction mode candidate is directly applied to the rectangular current block 2015, the first intra prediction mode candidate cannot adequately indicate surrounding pixels in a width direction that is greater than the height. That is, according to the first intra prediction mode candidate, surrounding pixels located at the upper right side of the rectangular current block 2015 whose width is greater than its height are not used as reference pixels.

[0248] Therefore, according to an embodiment, when the current block 2015 has a non-square shape with its width greater than its height, instead of a predetermined number of intra prediction modes 2011, 2012 selected based on the lower left direction among the first intra prediction mode candidates, a predetermined number of intra prediction modes 2021, 2022 indicating a specific direction set based on the upper right direction other than the direction indicated by the intra prediction modes included in the first intra prediction mode candidates may be included as second intra prediction mode candidates for the current block 2015, as shown in the bottom of FIG. 20B. Hereinafter, the set of intra prediction modes applicable to a non-square block is also referred to as second intra prediction mode candidates.

[0249] FIG. 20C illustrates a scheme for modifying the intra prediction mode applied to a square block to configure the intra prediction mode applied to a current block whose height is greater than its width, according to one embodiment.

[0250] The upper part of FIG. 20C illustrates a case where the first intra prediction mode candidate is applied directly to a rectangular current block 2030. Referring to the upper part of FIG. 20C, a certain number of intra prediction modes 2031 and 2032 indicating the upper right direction and a direction close to the upper right direction included in the first intra prediction mode candidate indicate surrounding pixels at spatially distant positions. Also, if the first intra prediction mode candidate is applied directly to the rectangular current block 2030, the first intra prediction mode candidate cannot adequately indicate surrounding pixels in the height direction, which is greater than the width. That is, according to the first intra prediction mode candidate, surrounding pixels located at the lower left side of the rectangular current block 2030, whose height is greater than its width, are not used as reference pixels.

[0251] Therefore, according to one embodiment, if the current block 2030 has a non-square shape in which the height is greater than the width, instead of a predetermined number of intra prediction modes 2031, 2032 selected based on the upper right direction among the first intra prediction mode candidates, as shown in the lower part of Figure 20C, a predetermined number of intra prediction modes 2041, 2042 indicating a specific direction set based on the lower left direction other than the direction indicated by the intra prediction modes included in the first intra prediction mode candidates may be included in the second intra prediction mode candidates for the current block 2030.

[0252] FIG. 21 illustrates a scheme for configuring an intra prediction mode to be applied to a current block whose width is greater than its height, according to one embodiment.

[0253] Referring to FIG. 21, among the first intra prediction mode candidates in directions between -135° and -180° and between 45° and 180° applied to the square block 2100, the intra prediction modes excluded from the second intra prediction mode candidates applied to the non-square block 2110 are also selected in the order of indicating directions close to -135° based on the lower left direction of -135°. Referring to FIG. 21, among the intra prediction modes indicating directions between a direction 2111 indicating the lower left vertex from the center of the non-square block 2110 and a -135° direction 2112 deviating from the lower left vertex from the center of the non-square block 2110, a predetermined number of intra prediction modes 2112 and 2113 are also excluded from the second intra prediction mode candidates. The number of intra prediction modes excluded from the first intra prediction mode candidates for the non-square block 2110 is also changed in consideration of the number of pre-set global directional intra prediction modes.

[0254] Instead of the intra prediction modes 2112 and 2113 excluded from the second intra prediction mode candidates, intra prediction modes 2122 and 2123 indicating directions that the first intra prediction mode candidate could not indicate are also included in the second intra prediction mode candidates. The directions that the first intra prediction mode candidate could not indicate are also directions between 0° and 45°. The intra prediction modes 2122 and 21231 newly added to the second intra prediction mode candidates are selected based on a direction that is the exact opposite of the direction of the intra prediction modes 2112 and 2113 excluded from the first intra prediction mode candidates, i.e., a direction that is inverted by 180°.

[0255] FIG. 22 illustrates a scheme for configuring an intra prediction mode to be applied to a current block whose height is greater than its width, according to one embodiment.

[0256] Referring to FIG. 22, among the first intra prediction mode candidates in directions between -135° and -180° and between 45° and 180°, i.e., between 45° and 225°, applied to the square block 2200, the intra prediction modes excluded from the second intra prediction mode candidates applied to the non-square block 2210 are selected in the order of directions close to 45° based on the upper right direction of 45°. Referring to FIG. 22, among the intra prediction modes indicating directions between a direction 2211 indicating the upper right vertex from the center of the non-square block 2210 and a 45° direction 2212 deviating from the upper right vertex from the center of the non-square block 2210, a predetermined number of intra prediction modes 2212 and 2213 are also excluded from the second intra prediction mode candidates. The number of intra prediction modes excluded from the non-square block 2210 among the first intra prediction mode candidates is also changed in consideration of the number of pre-set global directional intra prediction modes.

[0257] Instead of the intra prediction modes 2212 and 2213 excluded from the second intra prediction mode candidates, intra prediction modes 2222 and 2223 indicating directions that the first intra prediction mode candidate could not indicate are also included in the second intra prediction mode candidates.

[0258] The directions that the first intra prediction mode candidate cannot indicate are also directions between −90° and −135°. The intra prediction modes 2222 and 2223 newly added to the second intra prediction mode candidates are selected based on a direction that is opposite to the direction of the intra prediction modes 2212 and 2213 included in the first intra prediction mode candidate, i.e., a direction 180° opposite.

[0259] The second intra prediction mode candidate may include a plurality of intra prediction modes preset according to a ratio between the width and height of the current block. For example, when the width and height ratio of the current block is 1:n or n:1 (n is a positive integer), the second intra prediction mode candidate may include an intra prediction mode indicating a preset specific direction between the first intra prediction direction and the second intra prediction direction according to the ratio between the width and height of the current block, based on a first intra prediction direction indicating a lower left vertex from the center of the current block and a second intra prediction direction indicating a upper right vertex from the center of the current block, based on the width and height ratio according to the value of n.

[0260] FIG. 25A shows a method for configuring an intra prediction mode to be applied to a current block whose width is greater than its height according to another embodiment, and FIG. 25B shows a method for configuring an intra prediction mode to be applied to a current block whose height is greater than its width according to another embodiment.

[0261] The intra prediction mode of the current block may be statistically related to the shape of the current block. For example, in the case of an image with a strong horizontal component, such as an image with horizontal stripes, the block shape determined based on the rate-distortion (RD) cost may be a flat rectangular shape with a width greater than a height, and the intra prediction mode may be an intra prediction mode indicating a horizontal direction or a direction close to the horizontal direction. Conversely, in the case of an image with a strong vertical component, such as an image with vertical stripes, a rectangular shape with a height greater than a width may be determined, and the intra prediction mode may be an intra prediction mode indicating a vertical direction or a direction close to the vertical direction.

[0262] Therefore, the second intra prediction mode candidate applied to the non-square current block according to another embodiment may be set by further compressing the prediction direction indicating the shorter length of the width and height. For example, as shown in FIG. 25A, when the current block 2010 has a non-square shape with the width greater than the height, the second intra prediction mode candidate may further include intra prediction modes 2511 and 2512 indicating a direction close to the horizontal direction, which are added to the first intra prediction mode candidate. Also, as shown in FIG. 25B, when the current block 2520 has a non-square shape with the height greater than the width, the second intra prediction mode candidate may further include intra prediction modes 2521 and 2522 indicating a direction close to the vertical direction, which are added to the first intra prediction mode candidate.

[0263] FIG. 26A illustrates a manner in which intra prediction modes applied to a block are classified into a horizontal part and a vertical part according to various embodiments.

[0264] 26A, the intra prediction modes applied to a square block 2600 include a vertical part intra prediction mode configured by dividing an angle between 45° and 135° based on a first intra prediction mode 2601 in a 45° direction indicating the upper right vertex, a second intra prediction mode 2603 in a 135° direction, and a third intra prediction mode 2602 in a -135° direction, and a horizontal part intra prediction mode configured by dividing an angle between 135° and 180° and -135° and -180°, i.e., 135° and 225°. The vertical part intra prediction mode may include an intra prediction mode indicating a direction obtained by dividing an angle between 45° and 135°. For example, the vertical part intra prediction mode may include an intra prediction mode of a 90° direction obtained by dividing the 45° direction and the 135° direction in half, an intra prediction mode obtained by dividing the 45° direction and the 90° direction in half, and an intra prediction mode obtained by dividing the 90° direction and the 135° direction in half. In this manner, the vertical part intra prediction mode may be configured by dividing the angle between the 45° direction and the 135° direction in sequence. The number of times to divide the angle between the 45° direction and the 135° direction may be determined in consideration of the number of all intra prediction modes.

[0265] Similarly, the horizontal part intra prediction mode may include an intra prediction mode indicating a direction obtained by dividing the angle between the 135° direction and the 225° direction, i.e., the 135° direction and the 225° direction. For example, the horizontal part intra prediction mode also includes an intra prediction mode of a 180° (-180°) direction obtained by dividing the angle between the -135° direction and the 135° direction in half, an intra prediction mode obtained by dividing the angle between the 135° direction and the 180° direction in half, and an intra prediction mode obtained by dividing the angle between the -135° direction and the -180° direction in half. In this way, the horizontal part intra prediction mode may be configured by dividing the angle between the 135° direction and the -135° direction in half and the 225° direction in half. The number of times to divide the angle between −135° and 135° may be determined in consideration of the number of all intra prediction modes. In particular, in the case of intra prediction modes applied to square blocks, the number of vertical part intra prediction modes may be set to be the same as the number of horizontal part intra prediction modes.

[0266] Figure 26B shows a method for configuring an intra prediction mode to be applied to a current block whose width is greater than its height according to another embodiment, and Figure 26C shows a method for configuring an intra prediction mode to be applied to a current block whose height is greater than its width according to yet another embodiment.

[0267] Referring to FIG. 26B, second intra prediction mode candidates applied to a current block 2610 whose width is greater than its height may include an intra prediction mode indicating an upper right vertex direction 2611 from the center of the current block 2610, an intra prediction mode indicating an upper left vertex direction 2613 from the center of the current block 2610, and an intra prediction mode indicating a lower left vertex direction 2612 from the center of the current block 2610, based on which vertical part intra prediction modes 2614, 2615, and 2616 are configured by sequentially bisecting the angle between the upper right vertex direction 2611 and the upper left vertex direction 2613, and horizontal part intra prediction modes 2617, 2618, and 2619 are configured by sequentially bisecting the angle between the upper left vertex direction 2613 and the lower left vertex direction 2612.

[0268] Taking into consideration the number of overall intra prediction modes, the number of times to divide the angle between the upper right vertex direction 2611 and the upper left vertex direction 2613 and the number of times to divide the angle between the upper left vertex direction 2613 and the lower left vertex direction 2612 may be determined. As shown in FIG. 25A above, the second intra prediction mode candidate applied to the current block 2610 whose width is greater than its height is set such that the number of horizontal part intra prediction modes is greater than the number of vertical part intra prediction modes.

[0269] Referring to FIG. 26C, second intra prediction mode candidates applied to a current block 2620 whose height is greater than its width may include an intra prediction mode indicating an upper right vertex direction 2621 from the center of the current block 2620, an intra prediction mode indicating an upper left vertex direction 2623 from the center of the current block 2620, and an intra prediction mode indicating a lower left vertex direction 2622 from the center of the current block 2620. Based on this, vertical part intra prediction modes 2624, 2625, and 2626 are configured by sequentially bisecting the angle between the upper right vertex direction 2621 and the upper left vertex direction 2623, and horizontal part intra prediction modes 2627, 2628, and 2629 are configured by sequentially bisecting the angle between the upper left vertex direction 2623 and the lower left vertex direction 2622.

[0270] Taking into consideration the number of all intra prediction modes, the number of times to divide the angle between the upper right vertex direction 2621 and the upper left vertex direction 2623 and the number of times to divide the angle between the upper left vertex direction 2623 and the lower left vertex direction 2622 may be determined. As shown in FIG. 25B above, the second intra prediction mode candidates applied to the current block 2620 whose height is greater than its width are set such that the number of vertical part intra prediction modes is greater than the number of horizontal part intra prediction modes.

[0271] In addition, according to various embodiments, since the horizontal and vertical intra prediction modes are generally determined by the intra prediction mode of a block, the intra prediction mode may be set to indicate closer spacing in the horizontal and vertical directions.

[0272] Figure 27 is a lookup table showing a mapping relationship between an intra-prediction mode index (predModeIntra) and an angle parameter (IntraPredAngle) according to an intra-prediction mode according to one embodiment, and Figure 28 is a lookup table showing a mapping relationship between an intra-prediction mode index (predModeIntra) and an angle parameter (IntraPredAngle) according to an intra-prediction mode according to another embodiment.

[0273] According to the above-mentioned various embodiments, the specific direction of the intra prediction mode is expressed using an angle parameter (IntraPredAngle) related to a specific direction according to the intra prediction mode index (predModeIntra) except for the vertical direction of 90° and the horizontal direction of 180°. For example, the direction of the horizontal part intra prediction mode is expressed by tangent using a fixed number in the horizontal direction and an angle parameter (intraPredAngle) in the vertical direction. -1 The direction of the vertical part intra prediction mode is calculated by using the horizontal angle parameter (intraPredAngle) and the vertical fixed number, and is calculated by tan -1 The direction of the vector may be (fixed number / intraPredAngle), where the fixed number is preferably an exponential power of 2. For example, the fixed number may be one of 32, 64, and 128.

[0274] FIG. 29 is a reference diagram for explaining an angle parameter (IntraPredAngle) related to an intra prediction mode direction according to an embodiment.

[0275] The prediction direction according to the intra prediction mode is represented by a fixed number in the horizontal direction and an angle parameter (intraPredAngle) in the vertical direction, or by an angle parameter (intraPredAngle) in the horizontal direction and a fixed number in the vertical direction. For example, referring to FIG. 29, a specific direction 2912 using a horizontal angle parameter (intraPredAngle) and a fixed number 32 in the vertical direction with a current pixel 2910 as the center is represented by tan -1 (32 / intraPredAngle)(°) or (90-tan -1 The angle is (32 / intraPredAngle)(°).

[0276] During intra prediction, surrounding pixels may be determined using a fixed number and an angle parameter (intraPredAngle).

[0277] A process of determining a peripheral pixel 2911 indicated by a specific direction 2911 with respect to a current pixel 2910 will be described. It is assumed that the vertical position difference between the current pixel 2910 and the peripheral pixel 2911 is y+1 and the horizontal position difference is n. In this case, a proportional relationship of (y+1):n=32:intraPredAngle is established based on trigonometric functions. From such a proportional relationship, n=(y+1)*intraPredAngle / 32 can be derived. The n=(y+1)*intraPredAngle / 32 calculation can also be performed through a bit operation, such as n=(y+1)*intraPredAngle>>5. In this way, the positions of the peripheral pixels can be determined using intraPredAngle while knowing the size of the current block and the position of the current pixel 2910.

[0278] If the value of (y+1)*intraPredAngle is a multiple of 32, then p will point to a neighboring pixel at an integer position, and if (y+1)*intraPredAngle is not a multiple of 32, then the particular direction according to intraPredAngle points between two neighboring pixels (k and k+1). If the particular direction according to intraPredAngle points between two neighboring pixels (k and k+1), then the weighted average of the two neighboring pixels (k and k+1) can be used as the predicted value of the current pixel 2910.

[0279] Intra prediction uses surrounding pixels in a particular direction as reference pixels, i.e., predicted values, for the current pixel 2910. Assuming a fixed number in the horizontal or vertical direction, a direction according to a directional intra prediction mode may be indicated using one parameter of an angle parameter (intraPredAngle). Therefore, as shown in Figures 27 and 28, an angle parameter (IntraPredAngle) indicating a particular direction of a corresponding directional intra prediction mode may be preset in the form of a lookup table according to an intra prediction mode index (predModeIntra) of an intra prediction mode.

[0280] Meanwhile, it is assumed that the value of an intra prediction mode index (predModeIntra) indicating an intra prediction mode to be substituted when applied to a non-square block among intra prediction modes included in the first intra prediction mode candidate is A (A is an integer). Instead of the substituted first intra prediction mode candidate, the value of an intra prediction mode index indicating an intra prediction mode included in the second intra prediction mode candidate may have a value obtained by adding or subtracting a predetermined value a (a is an integer) to A. Also, a value of (IntraPredAngle) indicating a specific direction of the substituted second intra prediction mode candidate may be set to predModeIntra having a value of A+a or Aa. For example, referring to FIG. 28, an intra prediction mode with a predModeIntra value of 2 included in the first intra prediction mode candidate is an intra prediction mode with intraPredAngle of 32 indicating a -135° direction on the lower left side. If the block is non-square but has a width greater than its height, an intra prediction mode near the -135° direction may be substituted. In this case, the predModeIntra value of the non-square block may be set to 67, which is obtained by adding a predetermined value of 65 to predModeIntra, and the second intra prediction mode candidate may be indicated by assigning the value of (IntraPredAngle) to 35 when predModeIntra is 67. In other words, for a non-square block, instead of the intraPredAngle indicated by the existing predModeIntra, a (IntraPredAngle) value indicating a specific direction according to the second intra prediction mode candidate replacing PredModeIntra+a or PredModeIntra-a may be set.

[0281] According to another embodiment, the second intra prediction mode candidates may include a plurality of intra prediction modes that are preset according to a ratio between the width and height of the current block. When the ratio between the width and height of the current block is 1:n or n:1 (n is a positive integer), the second intra prediction mode candidates may also include an intra prediction mode indicating a preset specific direction based on the ratio between the width and height according to the value of n.

[0282] According to yet another embodiment, when the luma component and the chroma component are divided into data units of mutually independent types, the intra prediction mode candidates to be applied to the luma component blocks and the intra prediction mode candidates to be applied to the chroma component blocks are determined independently based on the types and ratios of the luma component and chroma component blocks.

[0283] FIG. 30 illustrates how the reference samples required for directional intra-prediction modes are determined.

[0284] The first embodiment 3120 shows reference samples 3102, 3106, 3108, and 3110 used for intra prediction when the upper row block and the left block are reconstructed. In the first embodiment 3120, the reference samples 3102 and 3106 of the reconstructed upper block and the reference sample 3108 of the reconstructed left block may be used for intra prediction. The reference sample 3110 of the lower left block may be used only when the lower left block is reconstructed, or may be used by copying the reference sample of the reconstructed left block. In order to use the reference samples 3102, 3106, 3108, and 3110, the prediction directions included in the first intra prediction direction group 3125 are also used for intra prediction of the current block 3100.

[0285] The second embodiment 3130 shows reference samples 3102, 3104, 3112, and 3114 used for intra prediction when the upper row block and the right block are reconstructed. In the case of the second embodiment 3130, the reference samples 3102 and 3104 of the reconstructed upper block and the reference sample 3112 of the reconstructed right block may be used for intra prediction. The reference sample 3114 of the top right block may be used only when the top right block is reconstructed, or may be used by copying the reference sample of the reconstructed right block. In order to use the reference samples 3102, 3104, 3112, and 3114, the prediction directions included in the second intra prediction direction group 3135 are also used for intra prediction of the current block 3100.

[0286] The third embodiment 3140 shows reference samples 3102, 3108, 3112 used for intra prediction when the top block, the right block, and the left block are reconstructed. In the third embodiment 3140, the top block reference sample 3102, the left block reference sample 3108, and the right block reference sample 3112 are also used for intra prediction. The prediction directions included in the third intra prediction direction group 3145 are also used for intra prediction of the current block 3100.

[0287] In the first embodiment 3120 and the second embodiment 3130, if the reference sample 3110 of the lower left block and the reference sample 3114 of the upper right block cannot be used, the prediction accuracy is reduced. However, in the third embodiment 3140, the reference samples 3102, 3108, and 3112 used are all adjacent to the current block, so the prediction accuracy is relatively high compared to the other embodiments.

[0288] The fourth embodiment 3150 shows the reference samples 3102, 3104, 3106 used for intra prediction when only the blocks in the top row are reconstructed. In the fourth embodiment 3150, only the reference samples 3102, 3104, 3106 of the reconstructed top blocks are also used for intra prediction. The prediction directions included in the fourth intra prediction direction group 3155 are also used for intra prediction of the current block 3100.

[0289] In the fourth embodiment 3150, unlike the third embodiment, the only reference sample adjacent to the current block is the reference sample 3102 of the upper block. Also, the reference samples 3104 and 3106 are spatially distant from the current block, and the prediction accuracy is lower than that of the other embodiments 3120, 3130, and 3140. Therefore, the intra prediction method used in the fourth embodiment 3150 is preferably a vertical mode using the reference sample 3102 of the upper block adjacent to the current block 3100, or a directional prediction mode in a direction adjacent to the vertical mode.

[0290] In the Z coding order, the intra prediction method according to the first embodiment 3120 is used, but when the coding order of two horizontally adjacent blocks is swapped, the right block is first predicted by the intra prediction method according to the fourth embodiment 3150. Then, after the right block is restored, the left block is predicted by the intra prediction method according to the third embodiment 3140, so that the left block can be restored.

[0291] In this manner, according to the present embodiment, when the position of the reference sample is changed due to the change in the processing order, the intra prediction mode can be adaptively reconfigured according to the position of the reference sample. For example, as in the second embodiment 3130, when the upper row block and the right block are restored, the intra prediction mode candidate indicating a specific direction in the range of -135° to -180° and 45° to 180°, such as the prediction direction included in the second intra prediction direction group 3135, is also used for the intra prediction of the current block 3100. Also, as in the third embodiment 3140, when the upper block, the right block, and the left block are restored, the intra prediction mode candidate indicating a direction in the range of 0° to 180°, such as the prediction direction included in the third intra prediction direction group 3145, is also used for the intra prediction of the current block 3100. Also, as in the fourth embodiment 3150, when only the reference sample 3102 of the upper block adjacent to the current block is available, a vertical part intra prediction mode, for example, an intra prediction mode candidate indicating a direction in the range of 45° to 135°, is also used for intra prediction of the current block 3100.

[0292] Also, according to the present embodiment, as described above, if the current block 3100 has a non-square shape in which the width is greater than the height, a predetermined number of intra prediction modes indicating a specific direction set based on the upper right direction may be used instead of a predetermined number of intra prediction modes selected based on the lower left direction applied to the square shape. Also, if the current block 3100 has a non-square shape in which the height is greater than the width, a predetermined number of intra prediction modes indicating a specific direction set based on the lower left direction other than the direction indicated by the first intra prediction mode candidate may be used instead of a predetermined number of intra prediction modes selected based on the upper right direction among the first intra prediction mode candidates.

[0293] In addition, according to the present embodiment, whether to reconstruct an intra prediction mode candidate applied to a non-square block is also determined based on the availability of surrounding pixels of the current block. Here, the availability is also determined based on whether the surrounding pixels are included in a slice or a tile different from the current block, or whether the surrounding pixels are pixels included in an inter-predicted block. For example, if the surrounding pixels are included in a slice or a tile different from the current block, or if the surrounding pixels are pixels included in an inter-predicted block, the surrounding pixels are also determined as unavailable surrounding pixels.

[0294] According to this embodiment, when the width of the current block is greater than the height, if the surrounding pixels located on the upper right side are not available, the first intra prediction mode candidate applied to the square-shaped block is applied to the non-square-shaped current block as is, and if the surrounding pixels located on the upper right side are available, intra prediction for the non-square-shaped current block can be performed using a second intra prediction mode candidate reconstructed from the first intra prediction mode candidate applied to the square-shaped block.

[0295] In addition, according to this embodiment, when the height of the current block is greater than the width, if the surrounding pixels located on the lower left side are not available, the first intra prediction mode candidate applied to the square-shaped block is applied to the non-square current block as is, and if the surrounding pixels located on the lower left side are available, intra prediction for the non-square current block can be performed using a second intra prediction mode candidate reconstructed from the first intra prediction mode candidate applied to the square-shaped block.

[0296] Also, according to another embodiment, whether or not to reconstruct intra prediction mode candidates applied to non-square blocks may be signaled via separate flag information.

[0297] FIG. 31 is a diagram illustrating a method for determining an intra prediction mode of a neighboring block when MPM is applied.

[0298] In general, the current block and the surrounding blocks are likely to have similar image characteristics. Therefore, the MPM may be determined by using the prediction modes of the surrounding blocks above and to the left of the current block, by indicating likely intra prediction mode candidates as the intra prediction mode of the current block.

[0299] 31, when the intra prediction modes of the upper peripheral block 3110 adjacent to the upper side of the current block 3100 and the left peripheral block 3120 adjacent to the left side of the current block 3100 are vertical and horizontal modes, respectively, the MPM mode of the current block is determined to be the vertical and horizontal modes, and the further mode set is also configured by a mode that is highly related to the MPM mode and close to the MPM mode among the modes between the vertical and horizontal modes. For example, the further mode set is also configured by an intra prediction mode of an index increased by 1 from the intra prediction mode index of the vertical mode, an intra prediction mode of an index increased by 2 from the intra prediction mode index of the vertical mode, an intra prediction mode of an index decreased by 2 from the intra prediction mode index of the horizontal mode, an intra prediction mode of an index decreased by 1 from the intra prediction mode index of the horizontal mode, an intra prediction mode of an index obtained by rounding off the average of the intra prediction mode indexes of the vertical mode and the horizontal mode, etc.

[0300] According to one embodiment, the further mode set is also constituted by a predefined integer number N of modes depending on the number of intra prediction modes or the number of MPMs.

[0301] According to an embodiment, the additional mode set may be configured to be different, such as N or M (N and M are positive integers), depending on the type of intra prediction mode of the neighboring block adjacent to the current block. Specifically, the additional mode set may be different depending on whether the intra prediction mode of the neighboring block is an angular mode or a non-angular mode such as a DC mode or a planar mode.

[0302] If the intra prediction mode candidate adaptively configured according to the shape of the current block is applied as described above, the intra prediction mode of the neighboring block is not included in the intra prediction mode applied to the current block. According to the present embodiment, if the shape of the neighboring block adjacent to the left or upper side of the current block is different from the shape of the current block and the intra prediction mode of the neighboring block adjacent to the left or upper side is not included in the intra prediction mode candidate of the current block, the intra prediction mode of the neighboring block adjacent to the left or upper side may be replaced with the intra prediction mode having the closest direction among the intra prediction mode candidates of the current block. Also, according to the present embodiment, if the shape of the neighboring block adjacent to the left or upper side of the current block is different from the shape of the current block and the intra prediction mode of the neighboring block adjacent to the left or upper side is not included in the intra prediction mode candidate of the current block, the intra prediction mode of the neighboring block adjacent to the left or upper side may be replaced with the intra prediction mode indicating the direction closest to the direction inverted by 180° from the direction indicated by the intra prediction mode of the neighboring block adjacent to the left or upper side.

[0303] 31, it is assumed that the upper peripheral block 3110 has a rectangular shape whose width is greater than its height, and the intra prediction mode of the upper peripheral block 3110 indicates a direction 3115 between 0° and 45°, the left peripheral block 3120 has a rectangular shape whose height is greater than its width, and the intra prediction mode of the left peripheral block 3120 indicates a direction 3125 between -90° and -135°, and the current block 3100 has a square shape. In this case, the intra prediction mode of the upper peripheral block 3110 and the intra prediction mode of the left peripheral block 3120 indicate directions outside the ranges of -135° to -180° and 45° to 180°, and are therefore not included in the first intra prediction mode candidates of the current block 3100. In this way, when the MPM is configured, if the peripheral blocks and the current block have different types and different intra prediction mode candidates, the intra prediction mode of the peripheral blocks may be replaced with the intra prediction mode having the most similar direction among the intra prediction mode candidates applied to the current block. For example, in FIG. 31, the intra prediction mode of the upper peripheral block 3110 may be replaced with the intra prediction mode indicating the 45° direction 3116 instead of the direction 3115 between 0° and 45°, and the intra prediction mode of the left peripheral block 3120 may be replaced with the intra prediction mode indicating the −135° direction 3126 instead of the direction 3125 between −90° and −135°.

[0304] According to another embodiment, if the intra prediction mode of the surrounding block is not included in the intra prediction mode candidates applied to the current block, the MPM may be configured using an intra prediction mode indicating a direction 180° inverted from the direction indicated by the intra prediction mode of the surrounding block. For example, referring to FIG. 31, the intra prediction mode of the upper surrounding block 3110 may be determined as an intra prediction mode indicating a direction 180° inverted from a direction 3115 between 0° and 45°. If the 180° inverted direction is not included in the intra prediction mode candidates of the current block 3100, an intra prediction mode indicating a direction most similar to the 180° inverted direction among the intra prediction mode candidates of the current block 3100 may be determined as the intra prediction mode of the upper surrounding block 3110.

[0305] Even if there is a difference in type between the current block and the surrounding block, if the surrounding block is in a non-directional intra-prediction mode, i.e., planar mode or DC mode, the MPM can be constructed by using the intra-prediction mode of the surrounding block as is without changing the mode.

[0306] The above description focuses on various embodiments. Those skilled in the art to which the present disclosure pertains can understand that the present disclosure can be embodied in modified forms without departing from the essential characteristics of the present disclosure. Therefore, the disclosed embodiments should be considered from an explanatory perspective, not a limiting one. The scope of the present disclosure is shown in the claims, not the above description, and all differences within the scope equivalent thereto should be interpreted as being included in the present disclosure.

[0307] The above-described embodiments of the present disclosure can be created into a program that can be executed by a computer, and can also be embodied in a general-purpose digital computer that runs the program using a computer-readable recording medium. Computer-readable recording media include recording media such as magnetic recording media (e.g., ROM (read only memory), floppy disks, hard disks, etc.) and optically readable media (e.g., CD-ROM (compact disc read only memory), DVD (digital versatile disc), etc.).

Claims

1. obtaining intra prediction mode information indicating an intra prediction mode of a current block from a bitstream among a plurality of intra prediction modes; determining an intra prediction mode of the current block by using an intra prediction mode indicating a direction greater than 45° instead of the intra prediction mode indicating the prediction direction indicated by the intra prediction mode information when the current block has a non-square shape whose width is greater than its height and the prediction direction indicated by the intra prediction mode information is −135°; determining the intra prediction mode of the current block by using an intra prediction mode indicating a direction smaller than −135° instead of the intra prediction mode indicating the prediction direction indicated by the intra prediction mode information when the current block has a non-square shape with a height greater than a width and the prediction direction indicated by the intra prediction mode information is 45°; performing intra prediction according to the determined intra prediction mode of the current block to obtain a predicted sample of a pixel included in the current block; obtaining residual samples of pixels included in the current block; reconstructing the current block using the predicted samples and the residual samples; 13. A video decoding method comprising:

2. determining a plurality of intra prediction modes based on a width of a current block and a height of the current block; determining a prediction direction of intra prediction mode information as −135° when the current block has a non-square shape in which the width is greater than the height and the intra prediction mode indicates a direction greater than 45°; determining a prediction direction of intra prediction mode information as 45° when the current block has a non-square shape with a height greater than a width and the intra prediction mode indicates a direction less than −135°; obtaining a residual sample corresponding to a difference between a pixel value of the current block and a predicted sample of a pixel included in the current block based on the intra prediction mode; encoding the residual sample and the intra-prediction mode information; 13. A video encoding method comprising:

3. A device for transmitting a bitstream, said bitstream being generated by a video encoding method according to claim 2.

Citation Information

Patent Citations

  • Control-point based intra direction representation for intra coding

    WO2017192898A1

  • Intra encoding and decoding with variable intra prediction direction sets

    WO2017203203A1

  • Image decoding apparatus, image encoding apparatus, image decoding method, and image encoding method

    WO2018037896A1