Video encoding method and apparatus, video decoding method and apparatus

Adaptive intra prediction mode configuration for non-square blocks addresses inefficiencies in existing methods, improving prediction efficiency by aligning modes with block geometry.

JP7779963B2Active Publication Date: 2025-12-03SAMSUNG ELECTRONICS CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Intra prediction efficiency is compromised when a square-shaped intra prediction mode is applied to a block with a non-square shape, as surrounding pixels are not utilized effectively.

Method used

Adaptive configuration of intra prediction modes based on the shape of the current block, where square-shaped blocks use first candidate modes and non-square shaped blocks use second candidate modes, adjusting the intra prediction modes to better fit their non-square geometry.

Benefits of technology

Improves intra prediction efficiency by optimizing the intra prediction mode selection for non-square blocks, enhancing the utilization of surrounding pixels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007779963000001
    Figure 0007779963000001
  • Figure 0007779963000002
    Figure 0007779963000002
  • Figure 0007779963000003
    Figure 0007779963000003
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 the type of a block. [Background technology]

[0002] Video data is encoded using a codec based on a specific data compression standard, for example, the Moving Picture Experts Group (MPEG) standard, and then stored in a bitstream format on a recording medium or transmitted via a communication channel. th With the evolution of wired and wireless communication infrastructure, such as the 4K / 8K Ultra HD (UHD) generation, 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 a decrease in 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 block can be adaptively changed to configure the intra prediction mode applied to the non-square block. [Effects of the Invention]

[0005] According to various embodiments, intra prediction efficiency can be improved by adaptively configuring an intra prediction mode according to the type of the current block. [Brief explanation of the drawings]

[0006] [Figure 1A] 1 is a block diagram of a video decoding device according to various embodiments. [Figure 1B] 1 is a flowchart of a video decoding method according to various embodiments. [Figure 1C] 3A and 3B are block diagrams of a video decoder according to various embodiments. [Figure 1D] 1 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] 1 is a flowchart of a video encoding method according to various embodiments. [Figure 2C] 3A and 3B 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. [Figure 3] 10 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] 10 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. [Figure 5] 10 is a diagram illustrating a process in which a video decoding apparatus divides a coding unit based on at least one of block shape information and partition shape mode information, according to an embodiment. [Figure 6] 10 is a diagram illustrating a method for a video decoding apparatus to determine a predetermined coding unit from an odd number of coding units, according to an embodiment; [Figure 7]10 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 and determines the plurality of coding units, according to an embodiment. [Figure 8] 10 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 coding units cannot be processed in a predetermined order, according to an embodiment. [Figure 9] 10 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] 10 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 predetermined condition. [Figure 11] 10 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] 10 is a diagram illustrating that a processing order among a plurality of coding units may vary depending on a division process of the coding units, according to an embodiment. [Figure 13] 10 is a diagram illustrating a process of determining the depth of a coding unit according to changes in the shape and size of the coding unit when the coding unit is recursively divided to determine multiple coding units, according to one embodiment. [Figure 14] 10 is a diagram illustrating a depth and a part index (PID) for a coding unit partition, which are determined depending on the type and size of the coding unit, according to an embodiment. [Figure 15] 10 is a diagram illustrating that a plurality of coding units are determined based on a plurality of predetermined data units included in a picture, according to an embodiment; [Figure 16] 10 is a diagram illustrating processing blocks that are used as a reference for determining 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] 10 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] 10 is a diagram illustrating candidate intra-prediction modes 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] 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 height is greater than its width, according to an embodiment. [Figure 21] 10 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] 10 is a diagram illustrating a method 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] 10 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] 10 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 height is greater than its width. [Figure 25A] 10 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 another embodiment. [Figure 25B]10 is a diagram illustrating 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. [Figure 26A] 10 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] 10 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 yet another embodiment. [Figure 26C] 10 is a diagram illustrating 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. [Figure 27] 10 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] 10 is a lookup table illustrating 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] 10 is a reference diagram for explaining an angle parameter (IntraPredAngle) related to an intra prediction mode direction according to an embodiment. [Figure 30] 10 is a diagram illustrating a method for determining reference samples required for a directional intra-prediction mode. [Figure 31] 10 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 INVENTION

[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 information related to a width and height of the current block and 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 residual samples of each pixel included in the current block from the bitstream; and decoding the current block using the prediction samples and the residual samples. and restoring the current block, wherein determining the intra prediction mode of the current block includes determining, when the current block has a square shape having the same width and height, an intra prediction mode of the current block from first candidate intra prediction modes including a plurality of pre-set intra prediction directions based on information related to the intra prediction mode; and, when the current block has a non-square shape having different widths and heights, determining, when the current block has a non-square shape having different widths and heights, an intra prediction mode of the current block from second candidate intra prediction modes set based on the non-square shape based on information related to the intra prediction mode.

[0008] According to one embodiment, when the current block has a non-square shape in which the width is greater than the 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 in which the height is greater than the 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 bottom-left direction are selected in an order indicating directions close to −135° based on the −135° direction, and instead of the predetermined number of intra prediction modes selected based on the bottom-left direction, the intra prediction modes included in the second intra prediction mode candidates are selected in an order indicating directions close to 45° from 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 top-right direction are selected in an order indicating directions close to 45° based on the 45° direction, and instead of the predetermined number of intra prediction modes selected based on the top-right direction, the intra prediction modes included in the second intra prediction mode candidates are also selected in an order indicating directions close to −135° from 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 the 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 candidate may be 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 in half, based on a fourth intra prediction mode in a left-top 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 half.

[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 the ratio of the width and height of the current block, with the first intra prediction direction indicating the lower left vertex based on the center of the current block and the second intra prediction direction indicating the upper right vertex based on the center of the current block.

[0015] According to one embodiment, the step of determining the intra prediction mode of the current block may include constructing a most probable mode (MPM) using prediction modes of neighboring blocks of the current block, and 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 configured 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 above side of the current block. If the shape of the neighboring block adjacent to the left or above 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 above is not included in the candidate intra prediction modes of the current block, the intra prediction mode of the neighboring block adjacent to the left or above may be replaced with the intra prediction mode having the closest direction among the candidate intra prediction modes of the current block, or may be replaced with the intra prediction mode indicating the direction closest to the direction 180° reversed from the direction indicated by the intra prediction mode of the neighboring block adjacent to the left or above.

[0017] According to an embodiment, a video decoding apparatus includes a memory and at least one processor connected to the memory, wherein the at least one processor performs the following steps: 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 information related to a width and height of the current block and 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; and obtaining a residual sample of each pixel included in the current block from the bitstream. and reconstructing the current block using the prediction samples and the residual samples, wherein the at least one processor, when the current block has a square shape having the same width and height, determines an intra prediction mode of the current block from first candidate intra prediction modes including a plurality of pre-set intra prediction directions based on information related to the intra prediction mode; and when the current block has a non-square shape having an inconsistent width and height, determines an intra prediction mode of the current block from second candidate intra prediction modes set based on the non-square shape based on the information related to the intra prediction mode.

[0018] According to one embodiment, a video encoding method includes: determining a plurality of intra prediction modes based on a width and a height of a current block; determining an intra prediction mode for the current block from the plurality of intra prediction modes; obtaining 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; and encoding the residual sample and information related to the intra prediction mode of the current block. 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 with 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 with different widths and heights.

[0019] The advantages, features, and methods for achieving the disclosed embodiments will become clearer with reference to the following embodiments described 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. However, the present embodiments are provided solely for the purpose of completing the disclosure and fully conveying the scope of the invention to those skilled in the art to which the disclosure pertains.

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

[0021] The terms used in this specification are currently commonly used and general terms that have been selected as much as possible while taking into consideration the function of the present disclosure. However, these terms may vary depending on the intentions of engineers in the relevant field, precedents, or the emergence of new technologies. In addition, in certain cases, the applicant may have arbitrarily selected terms, and in such cases, their meanings will be described in detail in the description of the invention. Therefore, the terms used in this disclosure must be defined based on the meanings of the terms and the overall content of the present disclosure, rather than simply by the names of the terms.

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

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

[0024] Furthermore, the term "module" as used in this specification refers to 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 also be configured to reside on an addressable storage medium and to execute one or more processors. Thus, by way of example, "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 components and "modules" may be combined into fewer components and "modules" or further separated into additional components and "modules."

[0025] According to one embodiment of the present disclosure, a "unit" may also be embodied by a processor and 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, etc. In some environments, a "processor" may also refer to an application specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), etc. 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" can also refer to various types of processor-readable media, such as random access memory (RAM), read-only memory (ROM), nonvolatile 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 or read information from the memory. Memory that is integrated into 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, embodiments will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement the present disclosure. In the drawings, portions not relevant to the description will be omitted to clearly explain the present disclosure.

[0029] Hereinafter, a video encoding apparatus, a video decoding apparatus, 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. A video encoding or decoding method and apparatus therefor that adaptively applies an intra prediction mode based on a block type and performs 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 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 include at least one processor. The receiving unit 110 and the decoding unit 120 may also 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 on video encoded by the video encoding device 150 (described later). The bitstream may also be transmitted from the video encoding device 150. The video encoding device 150 and the video decoding device 100 may be connected via a wired or wireless connection, and the receiving unit 110 may receive the bitstream via a wired or wireless connection. 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 reconstruct the video based on information acquired from the received bitstream. The decoding unit 120 may acquire syntax elements for reconstructing the video from the bitstream. The decoding unit 120 may reconstruct the video based on the syntax elements.

[0034] The receiving unit 110 may obtain information related to the prediction mode of the current block and information related to the 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 skip mode, intra mode, or inter prediction mode. If the current block is not in skip mode, it may be signaled whether the current block is coded in intra mode or inter prediction mode.

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

[0037] The decoding unit 120 may obtain a prediction block of the current block according to the 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 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 with the same width and height, the decoding unit 120 may determine the intra prediction mode of the current block from among first intra prediction mode candidates including a plurality of pre-set intra prediction directions based on the information related to the intra prediction mode. If the current block has a non-square shape with an inconsistent width and height, the decoding unit 120 may determine the 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, when the current block has a non-square shape in which the width is greater than the 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 in which the height is greater than the 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.

[0040] According to one embodiment, a predetermined number of intra prediction modes selected from the first intra prediction mode candidates based on the bottom left direction are also selected in an order indicating a direction close to -135° based on 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 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 closest 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 decoding unit 120 obtains information related to the 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 the intra prediction mode index (predModeIntra) of the current block.

[0047] In operation 171, the decoding unit 120 determines 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. As will be 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 with the same width and height, the decoding unit 120 may determine the intra prediction mode of the current block from among first intra prediction mode candidates including a plurality of pre-set intra prediction directions based on the information related to the intra prediction mode. If the current block has a non-square shape with an inconsistent width and height, the decoding unit 120 may determine the 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, when the current block has a non-square shape in which the width is greater than the 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 in which the height is greater than the 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.

[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 for 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 the difference between the current pixel and a predicted value, and the current pixel can be reconstructed by adding the predicted value and 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 decoding device 100 to decode video data.

[0052] 1C, the entropy decoding unit 6150 parses coded video data to be decoded and coding information required for decoding from the bitstream 6050. The coded video 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 predictor 6400 performs intra prediction for each block. As described below, the intra predictor 6400 may determine an intra prediction mode for the 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 with the same width and height, the intra predictor 6400 may determine an intra prediction mode for the current block from among first intra prediction mode candidates including a plurality of pre-set 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 obtained from the reconstructed picture buffer 6300. Spatial domain data for a block of a current image is reconstructed by adding prediction data and residual data for each block generated by the intra prediction unit 6400 or the inter prediction unit 6350, 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 block by block.

[0056] FIG. 1D illustrates a block diagram of a video decoding 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 a separate 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 acquire information related to the 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. The encoding unit 155 and the output unit 160 may also 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 as separate hardware, or 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 skip mode, intra mode, or inter prediction mode. If the current block is not in skip mode, the encoding unit 155 signals whether the current block is encoded in intra mode or inter prediction mode.

[0062] The encoding unit 155 may obtain a prediction block of the current block according to the prediction mode of the current block, and may transform and quantize a residual, which is a difference between the current block and the prediction block, and 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 with the same width and height, the encoding unit 155 may reconstruct a first intra prediction mode candidate including a plurality of pre-set intra prediction directions and determine a second intra prediction mode candidate to be applied to the non-square 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 structural information for determining data units having other hierarchical division forms, and output the bitstream.

[0063] FIG. 2B illustrates a flowchart 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 will be described below, the encoding unit 155 may determine the 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 the intra prediction mode of the current block from among a first intra prediction mode candidate including a plurality of pre-set intra prediction directions. If the current block has a non-square shape with an inconsistent width and height, the encoding unit 155 may determine a second intra prediction mode candidate different from the first intra prediction mode candidate as the 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 candidates 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 candidates, 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 candidates 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 candidates, 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 for 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 the 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 samples 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 video encoder 7000 according to various embodiments performs the same operations as those performed by the encoder 155 of the video encoder 150 to encode video 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 inter prediction unit 7150 from data for the block to be encoded in the current image 7050, and the transform unit 7250 and quantization unit 7300 can transform and quantize the residual data and output quantized transform coefficients for each block.

[0072] The inverse quantization unit 7450 and the inverse transform unit 7500 perform inverse quantization and inverse transform on the quantized transform coefficients to restore spatial domain residual data. The restored spatial domain residual data is added to prediction data for each block output from the intra prediction unit 7200 or the inter prediction unit 7150 to restore spatial domain data for a block of the current image 7050. The deblocking unit 7550 and the SAO performer 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 other images. 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 step-by-step 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 a separate 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 pre-defined intra prediction directions and determine a second intra prediction mode candidate to be applied to a non-square current block. In the following, coding unit division 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 tiles. A slice or a tile is also a sequence of one or more coding tree units (CTUs). A coding tree block (CTB) is a concept that contrasts with a 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 that includes the largest coded block of luma samples, the two largest coded 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 that includes the largest coded block of monochrome samples and syntax elements used to code the monochrome samples. When a picture is coded using color planes separated by color components, the largest coding unit is a unit that includes the picture and syntax elements used to code the samples of the picture.

[0080] One maximum coding block (CTB) is also divided into MxN coding blocks each containing MxN samples (M and 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 corresponding coding blocks of 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 coded using color planes separated by color components, a coding unit is a unit that includes the picture and syntax elements used to code the samples of the picture.

[0082] As mentioned 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, a (largest) coding unit refers to a data structure including a (largest) coding block including a corresponding sample and its corresponding syntax elements. However, those skilled in the art will understand that a (largest) coding unit or a (largest) coding block refers to a block of a predetermined size including a predetermined number of samples. Therefore, hereinafter, in this specification, the largest coding block and the largest coding unit, or the coding block and the coding unit, will be referred to without distinction unless otherwise specified.

[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 be a square of the same size, but is not limited thereto.

[0084] For example, information regarding the maximum size of a luma coding block may be acquired from a bitstream, and 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 regarding the maximum size of a luma coding block that can be divided into two and the luma block size difference may be acquired from the bitstream. The information regarding the luma block size difference may indicate the size difference between the largest luma coding unit and the largest luma coding block that can be divided into two. Therefore, the size of the largest luma coding unit may be determined by combining the information regarding the maximum size of a luma coding block that can be divided into two, acquired from the bitstream, and the information regarding the luma block size difference. The size of the largest chroma coding unit may also be determined using the size of the largest luma 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 largest chroma coding unit is half the size of the largest luma coding unit.

[0086] According to an embodiment, information regarding the maximum size of a luma coding block that can be binary split is acquired from a bitstream, so that the maximum size of a luma coding block that can be binary split is 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 64x64.

[0087] The maximum coding unit is also hierarchically divided into coding units based on partition mode information acquired from the bitstream, which may include 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, which may also be acquired from the bitstream.

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

[0089] If the current coding unit is not split into quads, the information indicating whether or not to split further may indicate whether the current coding unit is not split further (NO_SPLIT) or whether or not to 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 either the horizontal direction or the vertical direction.

[0091] If the current coding unit is divided horizontally or vertically, the division type information indicates that the current coding unit is divided into binary divisions or ternary divisions.

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

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

[0094] A coding unit may be smaller than or equal to the maximum coding unit. For example, the maximum coding unit is also a coding unit because it has the largest size. If the partition mode information related to the maximum coding unit indicates no partitioning, 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 partitioning, the maximum coding unit is also partitioned into coding units. Furthermore, if the partition mode information related to the coding unit indicates partitioning, the coding unit is further partitioned into smaller coding units. However, the partitioning of an image is not limited thereto, and the maximum coding unit and the coding unit are not distinguished from each other. The partitioning of coding units will be described in more detail with reference to FIGS. 3 to 16.

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

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

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

[0098] The division of coding units will be described in more detail with reference to FIGS. 3 to 16. In the present disclosure, the current block and neighboring blocks may refer to one of a largest coding unit, a coding unit, a prediction block, and a transform block. The current block or current coding unit is a block currently being decoded or coded, or a block currently being divided. The neighboring blocks may also be blocks reconstructed 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, left, upper left, upper, upper right, right, or upper right sides of the current block.

[0099] FIG. 3 illustrates a process in which the video decoding apparatus 100 divides the 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 indicates 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 square and non-square. If the width and height of the coding unit are the same (i.e., if the block shape of the coding unit is 4Nx4N), the video decoding apparatus 100 may determine the block shape information of the coding unit as square. The video decoding apparatus 100 may determine the shape of the coding unit as non-square.

[0102] If the width and height of a coding unit are different (i.e., 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. If the block shape of the coding unit is non-square, the video decoding apparatus 100 may determine that the width-to-height ratio 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 horizontally oriented or vertically oriented. 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 coding unit using block type information and may determine the type of division of the coding unit using partition type mode information. That is, the division 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, without being limited thereto, the video decoding device 100 and the video encoding device 150 may determine predetermined partition mode information based on block format information. The video decoding device 100 may determine predetermined partition mode information for the largest coding unit or the smallest coding unit. For example, the video decoding device 100 may determine the partition mode information for the largest coding unit as quad partitioning. Also, the video decoding device 100 may determine the partition mode information for the smallest coding unit as "no partitioning." Specifically, the video decoding device 100 may determine the size of the largest coding unit as 256x256. The video decoding device 100 may determine the predetermined partition mode information as quad partitioning. The quad partitioning 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, split it vertically, split it horizontally, or split it into four coding units, based on 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 based on the partition shape mode information indicating no split, or may determine split coding units 310b, 310c, 310d, 310e, and 310f based on the partition shape mode information indicating a predetermined split method.

[0106] Referring to FIG. 3, the video decoding device 100 may determine two coding units 310b obtained by vertically dividing the current coding unit 300 based on partition mode information indicating vertical division. The video decoding device 100 may determine two coding units 310c obtained by horizontally dividing the current coding unit 300 based on partition mode information indicating horizontal division. The video decoding device 100 may determine four coding units 310d obtained by vertically and horizontally dividing the current coding unit 300 based on partition mode information indicating vertical and horizontal division. The video decoding device 100 may determine three coding units 310e obtained by vertically dividing the current coding unit 300 based on partition mode information indicating vertical ternary division. The video decoding device 100 may determine three coding units 310f obtained by horizontally dividing the current coding unit 300 based on partition mode information indicating horizontal ternary division. However, the division patterns into which the square coding unit may be divided are not limited to the above-described patterns, 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 apparatus 100 divides a non-square coding unit and determines at least one coding unit, according to an embodiment.

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

[0109] According to an embodiment, the video decoding device 100 may determine a manner in which a coding unit is to be divided using the partition mode information, and in this case, the partition mode information may indicate the number of coding units to be generated by dividing the coding unit. Referring to FIG. 4, if the partition mode information indicates that the current coding unit 400 or 450 is to be 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 current coding unit 400 or 450 based on the division mode information, the video decoding device 100 may divide the current coding unit by considering the position of a long side of the non-square current coding unit 400 or 450. For example, the video decoding device 100 may divide 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, thereby determining a plurality of coding units.

[0111] According to one embodiment, if the partition mode information indicates that a coding unit is to be divided into an odd number of blocks (ternary partitioning), the video decoding device 100 may determine the odd number of coding units included in the current coding unit 400 or 450. For example, if the partition mode information indicates that the current coding unit 400 or 450 is to be divided into three coding units, the video decoding device 100 may divide 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 therefore the block shape information is horizontal. When the width-to-height ratio is 1:4, the width is smaller than the height, and therefore the block shape information is vertical. The video decoding device 100 may determine to divide the current coding unit into an odd number of blocks based on the partition shape mode information. The video decoding device 100 may also determine the 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, if the current coding unit 400 has a vertical dimension in which the height is greater than the width, the video decoding device 100 may divide the current coding unit 400 horizontally 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 apparatus 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, among the determined odd number of coding units 430a, 430b, 430c, 480a, 480b, and 480c, the size of a given coding unit 430b or 480b may be different from the sizes of 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 each have a different size.

[0114] According to an embodiment, when the partition mode information indicates that a coding unit is to be 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. Further, the video decoding device 100 may impose a predetermined restriction on at least one of the odd number of coding units generated by the partition. Referring to FIG. 4, the video decoding device 100 may perform a different decoding process for the central coding units 430b and 480b among three coding units 430a, 430b, 430c, 480a, 480b, and 480c generated by partitioning the current coding unit 400 or 450 from the other coding units 430a, 430c, 480a, and 480c. For example, the video decoding device 100 may limit the coding units 430b and 480b located in the center from being further divided, or may limit them to being divided a predetermined number of times, unlike the other coding units 430a, 430c, 480a, and 480c.

[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 to divide the square-shaped first coding unit 500 into coding units or not, based on at least one of block shape information and partition shape mode information. According to an embodiment, if the partition shape mode information indicates that the first coding unit 500 is to be divided horizontally, the video decoding device 100 may divide the first coding unit 500 horizontally to determine the second coding unit 510. According to an embodiment, the terms "first coding unit," "second coding unit," and "third coding unit" used are terms used to understand the division relationship between coding units. For example, if the first coding unit is divided, the second coding unit may be determined, and if the second coding unit is divided, the third coding unit may be determined. Hereinafter, the relationship between the first coding unit, the second coding unit, and the third coding unit used may also be understood to depend on the above-mentioned characteristics.

[0117] According to an embodiment, the video decoding device 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 device 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, or 520d, or may not divide the second coding unit 510. The video decoding device 100 may acquire the partition mode information, and may divide the first coding unit 500 based on the acquired partition mode information to determine, for example, a plurality of second coding units 510 of various types. The second coding units 510 may be divided according to the partition mode information. According to one embodiment, if the first coding unit 500 is divided into the second coding unit 510 based on the division mode information associated with 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 associated with the second coding unit 510. That is, the coding units are also divided recursively based on the division mode information associated with each coding unit. Thus, for a non-square coding unit, square coding units are determined, and such square coding units are recursively divided to determine non-square coding units.

[0118] Referring to FIG. 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 central coding unit or a square-shaped coding unit) is also recursively divided. According to one embodiment, the square-shaped 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-shaped 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-shaped fourth coding unit 530b or 530d may be further divided into an odd number of coding units. Methods that can be used for 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. Furthermore, 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 impose a predetermined restriction on certain third coding units among the odd number of third coding units 520b, 520c, and 520d. For example, the video decoding device 100 may restrict the middle coding unit 520c among the odd number of third coding units 520b, 520c, and 520d so that it cannot be further divided, or may restrict it to be divided a configurable number of times.

[0120] 5, the video decoding device 100 may restrict the center coding unit 520c 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, to be divided into a predetermined division pattern (e.g., into only four coding units, or into a pattern corresponding to the division pattern of the second coding unit 510), or to be divided only a predetermined number of times (e.g., divided n times, n>0). However, the above restriction on the center coding unit 520c 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 may allow the center coding unit 520c to 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., sample 640, 690 located in the middle) among the samples included in the current coding unit 600, 650. However, the predetermined position within the current coding unit 600 from which at least one piece of 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, bottom, left, right, top left, bottom left, top right, bottom right, etc.) that can be included within the current coding unit 600. The video decoding device 100 obtains the partition mode information obtained from the predetermined position and may determine whether to partition the current coding unit into coding units of various types and sizes, or not to partition 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 plurality of coding units, and such methods will be described later with reference to 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 device 100 may use information indicating the positions of each odd-numbered coding unit to determine a middle coding unit among the odd-numbered coding units. Referring to Figure 6, the video decoding device 100 may divide a current coding unit 600 or a current coding unit 650 to determine odd-numbered coding units 620a, 620b, and 620c or odd-numbered coding units 660a, 660b, and 660c. The video decoding device 100 may determine the middle coding unit 620b or the middle coding unit 660b using information regarding the positions of the odd-numbered coding units 620a, 620b, and 620c or odd-numbered 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, respectively, may include information related to the positions or coordinates of the coding units 620a, 620b, and 620c within the 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, respectively, 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 within the 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 the position of the top left sample 630a of the top coding unit 620a may indicate (xa, ya) coordinates, information indicating the position of the top left sample 630b of the middle coding unit 620b may indicate (xb, yb) coordinates, and information indicating the position of the top left sample 630c of the bottom coding unit 620c may indicate (xc, yc) coordinates. The video decoding device 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 obtained by dividing the current coding unit 600. However, the coordinates indicating the positions of the top left samples 630a, 630b, and 630c may indicate absolute positions within a picture. Furthermore, (dxb, dyb) coordinates indicating the relative position of the top left sample 630b of the middle coding unit 620b and (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 the 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 select a coding unit from 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 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 the (xa, ya) coordinates indicating the position of the top left sample 630a of the top coding unit 620a, the (xb, yb) coordinates indicating the position of the top left sample 630b of the middle coding unit 620b, and the (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 the (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 device 100 may determine the height of the top coding unit 620a as yb-ya. According to an embodiment, the video decoding device 100 may determine the width of the middle coding unit 620b as the width of the current coding unit 600. The video decoding device 100 may determine the height of the middle coding unit 620b as yc-yb. According to an embodiment, the video decoding device 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 device 100 may determine a coding unit having a different size from the 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 device 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 of a predetermined position. However, the 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. Based on the determined widths and heights of the coding units 660a, 660b, and 660c, the video decoding device 100 may determine a coding unit having a size different from the other coding units. 6, the video decoding apparatus 100 may determine a middle coding unit 660b, which has a size different from that of a left coding unit 660a and a right coding unit 660c, as a coding unit at a predetermined position. However, the process in which the video decoding apparatus 100 determines a coding unit having a size different from that of other coding units, is merely one embodiment in which the video decoding apparatus 100 determines a coding unit at a predetermined position using the size of the coding unit determined based on sample coordinates. Therefore, various processes may be used to determine a coding unit at a predetermined position by comparing the size of the coding unit determined based on the predetermined sample coordinates.

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

[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 account the shape of the current coding unit. For example, if the current coding unit is non-square in shape, with its width greater than its height, the video decoding apparatus 100 may select a coding unit at a predetermined position along the horizontal direction. That is, the video decoding apparatus 100 may select one of the coding units at a different position in the horizontal direction and set a constraint on the coding unit. If the current coding unit is non-square in shape, with its height greater than its width, the video decoding apparatus 100 may select a coding unit at a predetermined position along the vertical direction. That is, the video decoding apparatus 100 may select one of the coding units at a different position in the vertical direction and set a constraint on the coding unit.

[0135] According to one embodiment, the video decoding apparatus 100 may use information indicating the positions of each of the even-numbered coding units to determine a coding unit at a predetermined position among the even-numbered coding units. The video decoding apparatus 100 may determine the even-numbered coding units by dividing (binary dividing) the current coding unit, and may determine the coding unit at a predetermined position using information regarding the positions of the even-numbered coding units. Specific steps related to this process correspond to the process of determining a coding unit at a predetermined position (e.g., the middle position) among the odd-numbered coding units described with reference to FIG. 6, and therefore will not be described here.

[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 device 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 middle coding unit 620b among the plurality of coding units 620a, 620b, and 620c. Furthermore, the video decoding device 100 may determine the middle coding unit 620b by considering a position at which 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. 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 to be the middle coding unit. However, the information used to determine the middle coding unit is not limited to the partition mode information, and various types of information may also be used in the process of determining the middle coding unit.

[0138] According to an embodiment, predetermined information for identifying a coding unit at a predetermined position may also be 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 within the current coding unit 600 (e.g., a sample located at the center of the current coding unit 600) to determine a coding unit at a predetermined position (e.g., a central coding unit among multiple coding units 620a, 620b, and 620c obtained 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 type of the current coding unit 600. The video decoding device 100 may determine a coding unit 620b including a sample from which predetermined information (e.g., partition mode information) can be obtained among the multiple coding units 620a, 620b, and 620c obtained by dividing the current coding unit 600, and may impose a predetermined restriction. 6, according to one 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 can be acquired, and may place a certain restriction on the decoding process of a coding unit 620b including such sample 640. However, the position of the sample from which certain information can be acquired is not limited to the above position, but may also be a sample at an arbitrary position included in the coding unit 620b determined to place the restriction.

[0139] According to an embodiment, the location of a sample from which certain information can be acquired is also determined according to the shape of the current coding unit 600. According to an embodiment, block shape information may determine whether the shape of the current coding unit is square or non-square, and the location of a sample from which certain information can be acquired may be determined 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 certain information can be acquired. For another example, if the block shape information related to the current coding unit indicates a non-square shape, the video decoding apparatus 100 may determine, as a sample from which certain information can be acquired, 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 video decoding device 100 divides a current coding unit into a plurality of coding units, the video decoding device 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 device 100 may acquire the partition mode information from a sample at a predetermined position included in the coding unit, and may divide the plurality of coding units generated by dividing the current coding unit using the 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 may also be recursively divided using the partition mode information acquired from a sample at a predetermined position included in each of the plurality of coding units. The recursive division process of a coding unit has been described with reference to FIG. 5, and therefore, a detailed description thereof will be omitted.

[0141] According to 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 based on 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 apparatus 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 divide the first coding unit 700 vertically and determine the second coding units 710a and 710b, or may divide the first coding unit 700 horizontally and determine the second coding units 730a and 730b, or may divide the first coding unit 700 vertically and horizontally and determine the second coding units 750a, 750b, 750c, and 750d, according to the division mode information.

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

[0145] According to an embodiment, the video decoding device 100 may recursively divide a coding unit (CU). Referring to Figure 7, the video decoding device 100 may divide a first CU 700 to determine a plurality of CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d, and may recursively divide each of the determined CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d. The method of dividing the plurality of CUs 710a, 710b, 730a, 730b, 750a, 750b, 750c, and 750d corresponds to the method of dividing the first CU 700. 7, the video decoding device 100 may divide the first coding unit 700 vertically to determine the second coding units 710a and 710b, and may further determine whether to divide each of the second coding units 710a and 710b independently.

[0146] In 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 not divide the second coding unit 710b on the right side.

[0147] According to an embodiment, the processing order of coding units is also determined based on the division process of the coding units. In other words, the processing order of divided coding units is also determined based on the processing order of the coding units immediately before the division. The video decoding device 100 may determine the processing order of the third coding units 720a and 720b, which are 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 horizontally to determine the third coding units 720a and 720b, the third coding units 720a and 720b are also processed in the vertical direction 720c. Furthermore, 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 by 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 into various forms and determined can be processed independently in a predetermined order.

[0148] FIG. 8 illustrates a process in which the video decoding apparatus 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 Figure 8, a square-shaped first coding unit 800 is further divided into non-square-shaped second coding units 810a and 810b, and the second coding units 810a and 810b are further divided into third coding units 820a, 820b, 820c, 820d, and 820e. According to an embodiment, the video decoding device 100 may horizontally divide the left coding unit 810a of the second coding unit into a plurality of third coding units 820a and 820b, and the right coding unit 810b is further 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 there is an odd number of coding units by determining whether the third coding units 820a, 820b, 820c, 820d, and 820e can be processed in a predetermined order. 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 based on at least one of block type information and partition 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 coding units satisfy the condition that they can be processed in the predetermined order.

[0151] According to an embodiment, the video decoding device 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 can be processed in a predetermined order, where the condition relates 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, which are determined by dividing the height of the non-square left second coding unit 810a in half, may satisfy the condition. The boundaries of the third coding units 820c, 820d, and 820e, which are determined by dividing the right-side second coding unit 810b into three coding units, may not divide the width or height of the right-side second coding unit 810b in half, so the third coding units 820c, 820d, and 820e may be determined not to 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 based on this determination result, may determine that the right-side second coding unit 810b is to be divided into an odd number of coding units. According to an embodiment, when dividing into an odd number of coding units, the video decoding device 100 may impose a predetermined restriction on coding units at predetermined positions among the divided coding units. The content of such a restriction and the predetermined positions have been described in various embodiments, and therefore 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 division mode information acquired via 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 coding units. For example, referring to FIG. 9, if the first coding unit 900 is 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 for being processed in a predetermined order, where the condition relates to whether at least one of the width and height of the first coding unit 900 is divided in half along the boundaries of the second coding units 910a, 910b, 910c, 920a, 920b, and 920c. Referring to FIG. 9, the boundaries of the second coding units 910a, 910b, and 910c determined by dividing the square-shaped first coding unit 900 vertically do not divide the width of the first coding unit 900 in half, so it may be determined that the first coding unit 900 does not satisfy the condition for being processed in a predetermined order. In addition, since the boundaries of the second coding units 920a, 920b, and 920c determined by dividing the square-shaped first coding unit 900 horizontally 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 for being processed in a predetermined order. If such a condition is not satisfied, the video decoding device 100 may determine that the scanning order is broken and, based on the determination result, may determine that the first coding unit 900 is divided into an odd number of coding units. According to an embodiment, when dividing the first coding unit 900 into an odd number of coding units, the video decoding device 100 may impose 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 in various embodiments, and therefore a 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] Referring to FIG. 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, the video decoding device 100 restricts the manner in which the second coding unit may be divided when the non-square second coding unit determined by dividing the first coding unit 1000 satisfies certain conditions.

[0158] According to one embodiment, the video decoding device 100 may determine to divide a square-shaped first coding unit 1000 into non-square-shaped second coding units 1010a, 1010b, 1020a, and 1020b based on division mode information acquired via 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 multiple coding units or not based on the division mode information associated with each of the second coding units 1010a, 1010b, 1020a, and 1020b. According to one embodiment, the video decoding device 100 may horizontally divide the left-side non-square-shaped second coding unit 1010a, which is determined by dividing the first coding unit 1000 vertically, to determine third coding units 1012a and 1012b. However, when the video decoding device 100 divides the left second coding unit 1010a horizontally, the right second coding unit 1010b may be restricted so that it cannot be divided horizontally in the same direction as the division of the left second coding unit 1010a. If the right second coding unit 1010b is divided in the same direction to determine the third coding units 1014a and 1014b, the left second coding unit 1010a and the right second coding unit 1010b may be divided horizontally independently to determine the third coding units 1012a, 1012b, 1014a, and 1014b. However, this is the same result as if the video decoding device 100 had divided the first coding unit 1000 into four square second coding units 1030a, 1030b, 1030c, and 1030d based on the division mode information, which is inefficient in terms of video decoding.

[0159] According to one 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 horizontally, to determine the third coding units 1022a, 1022b, 1024a, and 1024b. However, if the video decoding device 100 vertically divides one of the second coding units (e.g., the top second coding unit 1020a), for the reasons described above, the video decoding device 100 may restrict the other second coding units (e.g., the bottom coding unit 1020b) from being vertically divided in the same direction as the top second coding unit 1020a.

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

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

[0162] According to an embodiment, the video decoding apparatus 100 may independently partition the non-square second coding units 1110a, 1110b, 1120a, and 1120b. Through a recursive method, the second coding units 1110a, 1110b, 1120a, and 1120b are also partitioned in a predetermined order, which corresponds to the partitioning method for the first coding unit 1100 based on the partitioning mode information.

[0163] For example, the video decoding device 100 may horizontally divide the left-side second coding unit 1110a to determine square-shaped third coding units 1112a and 1112b, and may horizontally divide the right-side second coding unit 1110b to determine square-shaped third coding units 1114a and 1114b. Furthermore, the video decoding device 100 may horizontally divide both the left-side second coding unit 1110a and the right-side second coding unit 1110b to determine square-shaped third coding units 1116a, 1116b, 1116c, and 1116d. In this case, the coding units may be determined in the same manner as when the first coding unit 1100 is divided into four square-shaped 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 manner 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 the processing order of multiple coding units may vary depending on the division process of the coding units, according to an embodiment.

[0166] According to an embodiment, the video decoding device 100 may partition the first coding unit 1200 based on the partition mode information. If the block shape is square and the partition mode information indicates that the first coding unit 1200 is to be partitioned in at least one of the horizontal and vertical directions, the video decoding device 100 may partition 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 horizontally or vertically are also independently partitioned based on the associated partition mode information. For example, the video decoding device 100 may horizontally divide the second coding units 1210a and 1210b, which are generated by vertically dividing the first coding unit 1200, into third coding units 1216a, 1216b, 1216c, and 1216d, and may vertically divide the second coding units 1220a and 1220b, which are generated by horizontally dividing the first coding unit 1200, into third coding units 1226a, 1226b, 1226c, and 1226d. The division process for the second coding units 1210a, 1210b, 1220a, and 1220b has been described with reference to FIG. 11, and therefore, detailed description thereof will be omitted.

[0167] According to an embodiment, the video decoding device 100 may process coding units in a predetermined order. The characteristics of processing 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 a 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 the processing order of the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d depending on the division form of the first coding unit 1200.

[0168] According to one embodiment, the video decoding device 100 can horizontally divide the second coding units 1210a and 1210b, which have been generated by vertical division, to determine the third coding units 1216a, 1216b, 1216c, and 1216d. The video decoding device 100 can process the third coding units 1216a, 1216b, 1216c, and 1216d in an order 1217 in which the third coding units 1216a and 1216c included in the left second coding unit 1210a are first processed vertically, and then the third coding units 1216b and 1216d included in the right second coding unit 1210b are processed vertically.

[0169] According to one embodiment, the video decoding device 100 can vertically divide the second coding units 1220a and 1220b, which have been generated by dividing them horizontally, to determine the third coding units 1226a, 1226b, 1226c, and 1226d. The video decoding device 100 can process the third coding units 1226a, 1226b, 1226c, and 1226d in an order 1227 in which the third coding units 1226a and 1226b included in the top second coding unit 1220a are first processed horizontally, and then the third coding units 1226c and 1226d included in the bottom second coding unit 1220b are processed horizontally.

[0170] 12, the second coding units 1210a, 1210b, 1220a, and 1220b may be divided into square-shaped third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d. The second coding units 1210a and 1210b, which are determined by dividing vertically, and the second coding units 1220a and 1220b, which are determined by dividing horizontally, are divided into different types. However, the third coding units 1216a, 1216b, 1216c, 1216d, 1226a, 1226b, 1226c, and 1226d, which are determined later, are ultimately coding units of the same type, resulting in 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 mode information, and as a result, even if coding units of the same type are determined, multiple coding units determined to be of the same type can be processed in different orders.

[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 video decoding apparatus 100 may determine the depth of the coding unit according to a predetermined criterion. For example, the video decoding apparatus 100 may determine the depth of the coding unit according to a predetermined criterion. n When the coding unit is divided by (n>0), it can be determined that the depth of the current coding unit is increased by n from the depth of the coding unit before division. Hereinafter, the coding unit whose depth is increased will be referred to as a coding unit of a lower depth.

[0173] 13, according to an embodiment, the video decoding apparatus 100 may divide a square-shaped first coding unit 1300 based on block shape information indicating a square shape (e.g., the block shape information may indicate "0:SQUARE"), and 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, which is 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, which is 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 the width and height 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., at 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, second coding units 1302, 1312, and 1322. That is, the video decoding device 100 may divide the first coding unit 1310 horizontally 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 horizontally and vertically 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 vertically divide the first coding unit 1320 to determine the second coding unit 1302 having a size of NxN or the second coding unit 1312 having a size of N / 2xN, or may horizontally and vertically divide the first coding unit 1320 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 NxN second coding unit 1302 to determine, for example, third coding units 1304, 1314, and 1324. That is, the video decoding device 100 may divide the second coding unit 1302 vertically and horizontally to determine the N / 2xN / 2 third coding unit 1304, the N / 4xN / 2 third coding unit 1314, or the N / 2xN / 4 third coding unit 1324.

[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 horizontally 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 vertically and horizontally 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 horizontally or vertically. 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, if the depth is determined based on the length of the longest side of the coding unit, the depth of the coding unit determined by dividing the first coding unit 1300 having a size of 2Nx2N horizontally or vertically may be the same as the depth of the first coding unit 1300.

[0181] According to one embodiment, the width and height of the third coding unit 1314 or 1324 may be 1 / 4 times that of the first coding unit 1310 or 1320. If 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, may also be 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, may also be D+2.

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

[0183] According to an embodiment, the video decoding device 100 may determine various types of second coding units by dividing a square-shaped first coding unit 1400. Referring to Figure 14, the video decoding device 100 may divide the first coding unit 1400 in at least one of the vertical and horizontal directions according to the partition mode information, and determine 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 associated with 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 for the square-shaped first coding unit 1400 may be determined based on the long side lengths. For example, since the length of one side of the square-shaped first coding unit 1400 is the same as the long side lengths 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 considered to be 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 a first coding unit 1410, whose height is greater than its width, horizontally 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 a first coding unit 1420, whose width is greater than its height, vertically 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, since the length of one side of the square second coding units 1412a and 1412b is half the length of one side of the non-square first coding unit 1410, whose height is greater than its width, 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 may 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 length of the long sides of the non-square second coding units 1414a and 1414c and the length of one side of the square second coding unit 1414b are half the length of one side of the first coding unit 1410. Therefore, the depths of the second coding units 1414a, 1414b, and 1414c are also D+1, which is one depth lower than D, the depth of the first coding unit 1410. The video decoding device 100 can 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, when determining an index (PID) for a divided coding unit segment, if the divided coding units are not the same size, the video decoding apparatus 100 may determine the index based on the size ratio between the coding units. Referring to FIG. 14, among the divided coding units 1414a, 1414b, and 1414c, the middle coding unit 1414b 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 middle coding unit 1414b may include both the other coding units 1414a and 1414c. Therefore, if the index (PID) of the middle coding unit 1414b in the scanning order is 1, the index of the next coding unit 1414c is 3, which is an increase of 2. That is, discontinuity in 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 whether there is an index discontinuity for the partition between such divided coding units.

[0189] According to an embodiment, the video decoding device 100 may determine whether a current coding unit has been 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 device 100 may divide a rectangular first coding unit 1410, whose height is greater than its width, to determine an even number of coding units 1412a and 1412b or an odd number of coding units 1414a, 1414b, and 1414c. The video decoding device 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 device 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, if partition mode information related to a rectangular first coding unit 1410 whose height is greater than its width indicates that the first coding unit 1410 is to be divided into three coding units, the video decoding device 100 may divide the first coding unit 1410 into three coding units 1414a, 1414b, and 1414c. The video decoding device 100 may assign an index related to each of the three coding units 1414a, 1414b, and 1414c. The video decoding device 100 may compare the indexes related to each coding unit to determine the middle coding unit among the odd number of coding units. Based on the indexes of the coding units, the video decoding apparatus 100 may determine a coding unit 1414b having an index corresponding to a middle value as a middle coding unit among the coding units obtained by dividing the first coding unit 1410. According to an embodiment, when determining indexes for dividing the divided coding units, if the coding units are not the same size, the video decoding apparatus 100 may determine the indexes 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 the height of the other coding units 1414a and 1414c, which have different heights. In this case, if the index (PID) of the middle coding unit 1414b is 1, the index of the next coding unit 1414c is 3, which is increased by 2.In such a case, when the indexes increase uniformly but the increments of the middle coding units are different, the video decoding device 100 may determine that the current coding unit has been divided into a plurality of coding units, including coding units having different sizes from the other coding units. According to one embodiment, when the division mode information indicates division into an odd number of coding units, the video decoding device 100 may divide the current coding unit such that 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 the 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) associated with the coding unit. However, the index and the size or position of the determined coding unit are specified for purposes of describing one embodiment and should not be construed as being limited thereto, and various indexes, positions, and sizes of coding units may be used.

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

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

[0193] According to one embodiment, the predetermined data unit is also defined as a data unit from which a coding unit begins to be recursively divided using 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 a 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 one embodiment, the reference data unit may have a predetermined size and shape. According to one embodiment, the reference coding unit may include MxN samples, where M and N may be the same or may be integers expressed as a power of 2. That is, the reference data unit may have a square or non-square shape, and may be subsequently divided into an integer number of coding units.

[0195] According to an embodiment, the video decoding apparatus 100 may divide a current picture into a plurality of reference data units. According to an embodiment, the video decoding apparatus 100 may divide the current picture into a plurality of reference data units using partition mode information associated with each reference data unit. 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 based on the determined reference data unit using partition mode information.

[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 based on various data units (e.g., a sequence, a picture, a slice, a slice segment, a tile, a tile group, a maximum coding unit, etc.) that may include at least one reference coding unit.

[0198] According to an embodiment, a receiving unit (not shown) of the video decoding device 100 may acquire at least one of information regarding the type of the reference coding unit and information regarding the size of the reference 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 reference 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 reference coding unit 1502 has been described through the process of dividing the current coding unit 400 or 450 in FIG. 4, so detailed descriptions 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 a base coding unit to determine the size and type of the base coding unit according to a predetermined data unit determined 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 base coding unit for each slice, slice segment, tile, tile group, maximum coding unit, etc., as a data unit satisfying 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 base data unit for each data unit satisfying the predetermined condition by using the index. If information regarding the type of the reference coding unit and information regarding the size of the reference coding unit are obtained from a bitstream for each relatively small data unit and used, the bitstream utilization efficiency will be poor. Therefore, instead of directly obtaining information regarding the type of the reference coding unit and information regarding the size of the reference coding unit, only the index may be obtained and used. In this case, at least one of the size and type of the reference coding unit corresponding to the index indicating the size and type of the reference coding unit is predetermined. That is, the video decoding device 100 may determine at least one of the size and 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 type of the predetermined reference coding unit according to the index.

[0200] According to one 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 one embodiment, at least one of the width and height of the maximum coding unit may be an integer multiple of at least one of the width and height of the reference coding unit. According to one embodiment, the size of the reference coding unit is the size obtained by dividing the maximum coding unit n times using a quadtree structure. That is, the video decoding apparatus 100 may determine the reference coding unit by dividing the maximum coding unit n times using a quadtree structure. According to various embodiments, the video decoding apparatus 100 may divide the reference coding unit based on at least one of block shape information and partition shape mode information.

[0201] FIG. 16 illustrates processing blocks that are responsible for determining the order in which reference coding units included in a picture 1600 are determined, 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 orders in which the reference coding units may be determined, and the determination order of the reference coding units determined in each processing block may vary depending on the processing block. The determination order of the reference coding units determined for each processing block may be one of various orders such as raster scan, Z scan, N scan, up-right diagonal scan, horizontal scan, and vertical scan, but the possible orders should not be construed as being limited to the above scan orders.

[0203] According to an embodiment, the video decoding device 100 may acquire information related to the size of a processing block and determine the size of at least one processing block included in a video. The video decoding device 100 may acquire information related to the size of a processing block from a bitstream and determine the size of at least one processing block included in a video. 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 one embodiment, a receiving unit (not shown) of the video decoding device 100 may acquire information regarding the size of a processing block for each specific data unit from a bitstream. For example, the information regarding the size of a processing block may be acquired from the bitstream for each data unit, such as an image, a sequence, a picture, a slice, a slice segment, a tile, or a tile group. That is, the receiving unit (not shown) may acquire information regarding the size of a processing block from the 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 acquired information regarding the size of the processing block. The size of such a processing block may be an integer multiple of the base 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 obtained 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 the order in which at least one reference coding unit is determined within at least one processing block.

[0206] According to one embodiment, the video decoding device 100 may determine each of the processing blocks 1602 and 1612 included in the picture 1600 based on the size of the processing block, and may determine the order of determining at least one reference coding unit included in the processing blocks 1602 and 1612. According to one embodiment, determining 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 regarding a determination order of at least one reference coding unit included in at least one processing block from a bitstream and determine an order in which at least one reference coding unit is determined based on the acquired information regarding the determination order. The information regarding the determination order may also be defined as an order or direction in which the reference coding units are determined within a processing block. That is, the order in which the reference coding units are determined may be determined independently for each processing block.

[0208] According to an embodiment, the video decoding apparatus 100 may acquire information regarding the determination order of the base coding units from a bitstream for each specific data unit. For example, a receiving unit (not shown) may acquire information regarding the determination order of the base 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, or a processing block. Since the information regarding the determination order of the base coding units indicates the determination order of the base coding units within a processing block, the information regarding the determination order may also be acquired 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 from a bitstream as information related to processing blocks 1602 and 1612, 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 determine at least one base coding unit included in the picture 1600 according to the determined coding unit order. Referring to Figure 16, the video decoding apparatus 100 may determine a determination order 1604 and 1614 of at least one base coding unit associated with each processing block 1602 and 1612. For example, if information related to the determination order of base coding units is acquired for each processing block, the determination order of base coding units associated with each processing block 1602 and 1612 may differ for each processing block. If the reference coding unit determination order 1604 associated with a 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, if the reference coding unit determination order 1614 associated with another processing block 1612 is a reverse raster scan order, the reference coding units included in the processing block 1612 are also determined in the reverse raster scan order.

[0211] According to an embodiment, the video decoding apparatus 100 may decode at least one reference coding unit determined. The video decoding apparatus 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 the type of the current coding unit or partition type mode information indicating a method of partitioning the current coding unit from a bitstream. The partition type mode information may also be included in bitstreams 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 syntax elements corresponding to block type information or partition type mode information from the bitstream for each largest coding unit, base coding unit, or 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 video partitioning rule. 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 video partitioning rule 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 differently depending on the frame, slice, temporal layer, maximum coding unit, or coding unit.

[0215] The video decoding device 100 may determine a 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 to this. The video decoding device 100 may determine the partitioning rule based on information obtained from a bitstream received from the video encoding device 150.

[0216] The shape of the coding unit may include square and non-square shapes. If the width and height of the coding unit are the same, the video decoding apparatus 100 may determine the shape of the coding unit to be square. If the width and height of the coding unit are not the same, the video decoding apparatus 100 may determine the shape of the coding unit to be 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 partitioning rule to coding units classified into the same group. For example, the video decoding device 100 may classify coding units having the same long side length into the same size. The video decoding device 100 may also apply the same partitioning rule to 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, or 16:1. The direction of the coding unit may include a horizontal direction and a vertical direction. The horizontal direction may indicate that the width of the coding unit is greater than the height. The vertical direction may indicate that 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 different allowable partitioning modes 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 the partitioning direction based on the size of the coding unit. The video decoding device 100 may determine allowable partitioning types based on 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 division rule based on the position of the coding unit. The video decoding device 100 can adaptively determine the division rule based on the position of the coding unit in the video.

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

[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 decoding device 100 of Figure 1A and the encoder 155 of the video encoding device 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] Intra prediction modes according to various embodiments may include non-angular intra prediction modes that do not have directionality, such as planar mode and DC mode, and angular intra prediction modes that have directionality.

[0226] 17 and 18, the directional intra prediction modes include intra prediction modes indicating specific directions in the ranges of -135° to -180° and 45° to 180° based on the directions of 45° and -135°.

[0227] In the following description, prediction direction angles in the range of 0 to 180° indicating directions on the first and second quadrants are expressed as +, and prediction direction angles in the range of -180 to 0° indicating directions on the third and fourth quadrants are expressed as -. A predetermined angle -a (a is a positive real number) indicating directions 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] 17 and 18, the prediction direction indicated by the arrow 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 shown in Figures 17 and 18 indicate examples of intra prediction mode indexes (predModeIntra) according to the intra prediction directions. For Planar mode, which is a non-directional intra prediction mode, the value of predModeIntra is set to 0, and for DC mode, the value of predModeIntra is also set to 1.

[0229] 17, 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 , directional intra prediction modes according to an embodiment may include 65 intra prediction modes, which are obtained by dividing the range between −135° and −180° and between 45° and 180° into 65 sections based on the directions of 45° and −135°. The 65 directional intra prediction modes may sequentially have predModeIntra values ​​ranging 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 illustrated in FIGS. 17 and 18 and may be changed. For example, the number of directional intra prediction modes in the clockwise direction from the 45° 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 counterclockwise from the 45° direction, and the set predModeIntra values ​​may also be changed. Without being limited thereto, the directional intra prediction modes may include a predetermined number of intra prediction modes indicating specific directions within a range of any 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 components.

[0232] In 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 4:2:2 format video, the vertical sampling rate of the luma component is the same as that of the chroma component, but the horizontal sampling rate of the chroma component is half that of the luma component. That is, 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 the 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 video, the luma component and chroma component have the same sampling rate in the vertical direction, but the chroma component sampling rate in the horizontal direction is half that of the luma component. That is, for every two horizontal luma components, only one chroma component is sampled. Therefore, in a 4:2:2 format video, the luma component and chroma component have the same resolution in the vertical direction, but the chroma component resolution in the horizontal direction is half 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 in Figures 17 and 18 are set with a square shape in mind. However, as described with reference to 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 instead of a square shape. Also, according to the 4:2:2 format, even if a luma component has a square shape, the corresponding chroma component block may have a non-square shape.

[0238] Therefore, according to various embodiments, if 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 when an intra prediction mode applied to a square block 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 when an intra prediction mode applied to a square block is applied to a current block whose height is greater than its width.

[0240] 23, the current block is an 8x4 non-square block 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 the value of a surrounding pixel L 2311, which is spatially closer to the current pixel A 2310 than the surrounding pixel L 2311. Therefore, a surrounding pixel T 2312 indicated in an opposite direction 2315 of the intra prediction mode 2314 is not used for intra prediction of the current pixel A 2310. 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. Therefore, 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 a square block equally indicates the surrounding samples on the upper and left sides. Therefore, when the intra prediction mode applied to a square block is applied to a non-square, i.e., rectangular, block, a spatially distant reference sample is used as the predicted value of the current pixel instead of a nearby sample. As such, the intra prediction mode applied to a square block cannot adequately indicate surrounding samples in the direction having the longer length of the width or height. For example, the intra prediction mode applied to a square block, which indicates directions between -135° and -180° and between 45° and 180° based on the directions of 45° and -135°, does not include prediction directions between 0° and 45°. Therefore, in a current block whose width is greater than its height as shown in FIG. 23, it cannot adequately indicate the surrounding pixels on the upper right side located in the direction between 0° and 45° based on the current pixel. Furthermore, intra prediction modes indicating directions between -135° and -180° and between 45° and 180° based on the directions of 45° and -135° applied to square blocks do not include prediction directions between -90° and -135°, and therefore cannot adequately represent neighboring pixels located in the lower left direction, which are in the directions between -90° and -135° based on the current pixel, in a current block whose height is greater than its width, as shown in Figure 24. Therefore, when intra prediction modes applied to square blocks are applied to non-square blocks, intra prediction efficiency decreases.

[0243] To solve such problems, various embodiments can adaptively change the intra prediction mode applied to square blocks when the current block has a non-square shape, and configure the intra prediction mode applied to the non-square 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 that can be applied to a square-shaped current block according to an embodiment. If 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 that can be applied to a square-shaped block is also referred to as first candidate intra prediction modes.

[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 Figure 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 Figure 20B, a predetermined number of intra prediction modes 2011 and 2012, which are included in the first intra prediction mode candidate and indicate the bottom-left direction and directions close to the bottom-left direction, indicate surrounding pixels that are spatially distant. Furthermore, 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 the width direction, which is greater than the height. In other words, according to the first intra prediction mode candidate, surrounding pixels located on 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 one embodiment, when the current block 2015 has a non-square shape in which the width is greater than the height, instead of a predetermined number of intra prediction modes 2011, 2012 selected from the first intra prediction mode candidates based on the bottom-left direction, as shown in the bottom of FIG. 20B , a predetermined number of intra prediction modes 2021, 2022 indicating a specific direction set based on the top-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. Hereinafter, the set of intra prediction modes applicable to non-square blocks will also be referred to as second intra prediction mode candidates.

[0249] FIG. 20C 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 height is greater than its width, according to one embodiment.

[0250] The upper part of Figure 20C illustrates a case where the first intra prediction mode candidate is directly applied to a rectangular current block 2030. Referring to the upper part of Figure 20C, a predetermined number of intra prediction modes 2031 and 2032, which indicate the upper right direction and directions close to the upper right direction, included in the first intra prediction mode candidate indicate surrounding pixels that are spatially distant. Furthermore, if the first intra prediction mode candidate is directly applied 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. In other words, according to the first intra prediction mode candidate, surrounding pixels located on 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 mode 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] 21 , among the first intra prediction mode candidates in directions between −135° and −180° and between 45° and 180° that are applied to a square block 2100, intra prediction modes excluded from the second intra prediction mode candidates that are applied to a non-square block 2110 are selected in 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 that indicates the lower left vertex from the center of the non-square block 2110 and a −135° direction 2112 that is off 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 first intra prediction mode candidates excluded from the non-square block 2110 may be changed while taking into account the number of previously set global directional intra prediction modes.

[0254] In place 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 include 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 the direction opposite to the direction of the intra prediction modes 2112 and 2113 excluded from the first intra prediction mode candidates, i.e., the direction flipped 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] 22, among the first intra prediction mode candidates in the directions between −135° and −180° and between 45° and 180°, i.e., the directions between 45° and 225°, which are 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 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 the first intra prediction mode candidates excluded from the non-square block 2210 may be changed taking into account the number of pre-set global directional intra prediction modes.

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

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

[0259] The second intra prediction mode candidates may also include a plurality of intra prediction modes that are preset according to the width-to-height ratio of the current block. For example, if the width-to-height ratio 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 that indicates a preset specific direction between the first intra prediction direction and the second intra prediction direction according to the width-to-height ratio of the current block, based on the first intra prediction direction indicating the lower left vertex from the center of the current block and the second intra prediction direction indicating the upper right vertex from the center of the current block, based on the width-to-height ratio determined by the value of n.

[0260] Figure 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 Figure 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 containing horizontal stripes, the block shape determined based on the rate-distortion (RD) cost may be a flat rectangular shape whose width is greater than its height, and the intra prediction mode may be an intra prediction mode indicating a horizontal or similar direction. Conversely, in the case of an image with a strong vertical component, such as an image containing vertical stripes, the block shape may be a rectangular shape whose height is greater than its width, and the intra prediction mode may be an intra prediction mode indicating a vertical or similar direction.

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

[0263] FIG. 26A illustrates a scheme for classifying intra prediction modes applied to a block into a horizontal part and a vertical part according to various embodiments.

[0264] 26A , intra prediction modes applied to a square block 2600 include a first intra prediction mode 2601 in a 45° direction indicating the top right vertex, a second intra prediction mode 2603 in a 135° direction, and a third intra prediction mode 2602 in a −135° direction, and include vertical part intra prediction modes configured by dividing the angle between the 45° and 135° directions, and horizontal part intra prediction modes configured by dividing the angle between the 135° and 180° directions and the −135° and −180° directions, i.e., the 135° and 225° directions. The vertical part intra prediction modes may include intra prediction modes indicating directions obtained by dividing the angle between the 45° and 135° directions. For example, vertical part intra prediction modes 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 angle between the 45° direction and the 90° direction in half, and an intra prediction mode obtained by dividing the angle between the 90° direction and the 135° direction in half. In this manner, vertical part intra prediction modes may be configured by sequentially dividing the angle between the 45° direction and the 135° direction. The number of times to divide the angle between the 45° direction and the 135° direction may be determined taking into account the number of all intra prediction modes.

[0265] Similarly, the horizontal part intra prediction mode may include intra prediction modes indicating directions obtained by dividing the angle between the 135° and 225° directions, i.e., the 135° to 180° direction and the −135° to −180° 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° and 135° directions in half, an intra prediction mode obtained by dividing the 135° and 180° directions in half, and an intra prediction mode obtained by dividing the −135° and −180° directions in half. In this way, horizontal part intra prediction modes may be configured by dividing the angle between the 135° and 180° directions and the −135° to −180° directions in half. The number of times to divide the angle between the −135° direction and the 135° direction may be determined taking into account 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, the second intra prediction mode candidates to be applied to the current block 2610, whose width is greater than its height, may include an intra prediction mode indicating the upper right vertex direction 2611 from the center of the current block 2610, an intra prediction mode indicating the upper left vertex direction 2613 from the center of the current block 2610, and an intra prediction mode indicating the lower left vertex direction 2612 from the center of the current block 2610. These may include vertical part intra prediction modes 2614, 2615, and 2616, which are formed by sequentially halving 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, which are formed by sequentially halving the angle between the upper left vertex direction 2613 and the lower left vertex direction 2612.

[0268] Taking the number of overall intra prediction modes into consideration, 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 so 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, the second intra prediction mode candidates to be applied to the current block 2620, whose height is greater than its width, may include an intra prediction mode indicating the upper right vertex direction 2621 from the center of the current block 2620, an intra prediction mode indicating the upper left vertex direction 2623 from the center of the current block 2620, and an intra prediction mode indicating the lower left vertex direction 2622 from the center of the current block 2620. These may include vertical part intra prediction modes 2624, 2625, and 2626 formed by sequentially halving 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 formed by sequentially halving the angle between the upper left vertex direction 2623 and the lower left vertex direction 2622.

[0270] Taking into consideration the number of overall 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 candidate applied to the current block 2620 whose height is greater than its width is set so 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 largely by the intra prediction mode of a block, the intra prediction mode may be set to indicate more compact horizontal and vertical directions.

[0272] Figure 27 is a lookup table showing the 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 the mapping relationship between an intra-prediction mode index (predModeIntra) and an angle parameter (IntraPredAngle) according to another embodiment.

[0273] According to the various embodiments described above, a specific direction of the intra prediction mode can be expressed using an angle parameter (IntraPredAngle) related to a specific direction according to the intra prediction mode index (predModeIntra), except for the vertical direction (90°) and the horizontal direction (180°). For example, the direction of the horizontal part intra prediction mode is expressed using a fixed number in the horizontal direction and an angle parameter (intraPredAngle) in the vertical direction, and is expressed as tan -1 The direction of the vertical part intra prediction mode is determined by the horizontal angle parameter (intraPredAngle) and the vertical fixed number. -1 The direction 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 centered on a current pixel 2910 uses an angle parameter (intraPredAngle) in the horizontal direction and a fixed number 32 in the vertical direction, and is expressed as tan -1 (32 / intraPredAngle)(°) or (90-tan -1 It has an angle of (32 / intraPredAngle)(°).

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

[0277] The process of determining a peripheral pixel 2911 indicated by a specific direction 2911 centered on a current pixel 2910 will be described. Assume 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 this proportional relationship, n=(y+1)*intraPredAngle / 32 can be derived. The n=(y+1)*intraPredAngle / 32 operation can also be performed through bit operations, 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, p indicates a neighboring pixel at an integer position, and if (y+1)*intraPredAngle is not a multiple of 32, the specific direction defined by intraPredAngle indicates a direction between two neighboring pixels (k and k+1). If the specific direction defined by intraPredAngle indicates a direction between two neighboring pixels (k and k+1), the weighted average value 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 of pixels in the horizontal or vertical direction, the direction of the directional intra prediction mode may be indicated using one angle parameter (intraPredAngle). Therefore, as shown in Figures 27 and 28, the angle parameter (IntraPredAngle) indicating a particular direction of the corresponding directional intra prediction mode may be pre-set in the form of a look-up table according to the intra prediction mode index (predModeIntra) of the intra prediction mode.

[0280] Meanwhile, let us assume 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 the intra prediction modes included in the first intra prediction mode candidate is A (A is an integer). The value of an intra prediction mode index indicating an intra prediction mode included in the second intra prediction mode candidate instead of the substituted first intra prediction mode candidate may have a value obtained by adding or subtracting a predetermined value a (a is an integer) to A. In addition, 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 included in the first intra prediction mode candidate with a predModeIntra value of 2 has an intraPredAngle of 32, indicating a -135° direction on the lower left side. In the case of a non-square block whose width is 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 is determined to be 67, which is obtained by adding a predetermined value of 65 to predModeIntra, and when predModeIntra is 67, the second intra prediction mode candidate can be indicated by assigning the value of (IntraPredAngle) to 35. In other words, for a non-square block, instead of the intraPredAngle indicated by the existing predModeIntra, an (IntraPredAngle) value indicating a specific direction according to the second intra prediction mode candidate that replaces PredModeIntra+a or PredModeIntra-a can be set.

[0281] According to another embodiment, the second intra prediction mode candidates may include a plurality of pre-set intra prediction modes according to the width-to-height ratio of the current block. When the width-to-height ratio of the current block is 1:n or n:1 (n is a positive integer), the second intra prediction mode candidates may also include pre-set intra prediction modes indicating specific directions based on the width-to-height ratio 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 block and the intra prediction mode candidates to be applied to the chroma component block are determined independently based on the respective types and ratios of the luma component and chroma component blocks.

[0283] FIG. 30 shows 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 top row block and the left row block are reconstructed. In the first embodiment 3120, the reference samples 3102 and 3106 of the reconstructed top block and the reference sample 3108 of the reconstructed left block can be used for intra prediction. The reference sample 3110 of the bottom left block is used only when the bottom left block is reconstructed, or it can also 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 top row block and the right block are reconstructed. In the second embodiment 3130, the reference samples 3102 and 3104 of the reconstructed top block and the reference sample 3112 of the reconstructed right block can be used for intra prediction. The reference sample 3114 of the top right block is used only when the top right block is reconstructed, or it can also 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] A third embodiment 3140 shows reference samples 3102, 3108, and 3112 used for intra prediction when the top, right, and left blocks 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 decreases. 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 higher than in the other embodiments.

[0288] A fourth embodiment 3150 shows reference samples 3102, 3104, and 3106 used for intra prediction when only the top row of blocks is reconstructed. In the fourth embodiment 3150, only the reference samples 3102, 3104, and 3106 of the reconstructed top block 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 block above. Furthermore, the reference samples 3104 and 3106 are spatially distant from the current block, resulting in lower prediction accuracy compared to the other embodiments 3120, 3130, and 3140. Therefore, the intra prediction method used in the fourth embodiment 3150 is preferably a vertical mode that uses the reference sample 3102 of the block above 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 orders of two horizontally adjacent blocks are swapped, the right block is first predicted using the intra prediction method according to the fourth embodiment 3150. Then, after the right block is reconstructed, the left block can be reconstructed by predicting it using the intra prediction method according to the third embodiment 3140.

[0291]

[0111] In this way, according to this embodiment, when the positions of the reference samples are changed due to a change in the processing order, the intra prediction mode can be adaptively reconfigured according to the positions of the reference samples. For example, when the upper row block and the right block are restored as in the second embodiment 3130, intra prediction mode candidates indicating specific directions in the ranges of -135° to -180° and 45° to 180°, such as the prediction directions included in the second intra prediction direction group 3135, are also used for intra prediction of the current block 3100. Furthermore, when the upper block, the right block, and the left block are restored as in the third embodiment 3140, intra prediction mode candidates indicating directions in the ranges of 0° to 180°, such as the prediction directions included in the third intra prediction direction group 3145, are also used for intra prediction of the current block 3100. Also, as in the fourth embodiment 3150, when only the reference sample 3102 of the block adjacent to the current block above 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] According to this 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 from among the first intra prediction mode candidates.

[0293] In addition, according to this embodiment, whether to reconstruct a candidate intra-prediction mode to be applied to a non-square block is also determined based on the availability of neighboring pixels of the current block. Here, the availability is determined based on whether the neighboring pixels are included in a slice or a tile different from the current block, or whether the neighboring pixels are pixels included in an inter-predicted block. For example, if the neighboring pixels are included in a slice or a tile different from the current block, or if the neighboring pixels are pixels included in an inter-predicted block, the neighboring pixels are also determined to be unavailable neighboring 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 the 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, if the height of the current block is greater than the width, and if the surrounding pixels located on the lower left side are not available, the first intra prediction mode candidate applied to the square 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 block.

[0296] According to another embodiment, whether or not to reconstruct intra prediction mode candidates applied to non-square blocks may also 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] Generally, the current block and the surrounding blocks are likely to have similar image characteristics. Therefore, the MPM may be determined 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 an upper peripheral block 3110 adjacent to the upper side of a current block 3100 and a 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 mode and horizontal mode, and further mode sets are also configured by modes between the vertical mode and horizontal mode that are highly relevant to and close to the MPM mode. For example, further mode sets may be configured by intra prediction modes with indexes increased by 1 from the intra prediction mode index of the vertical mode, intra prediction modes with indexes increased by 2 from the intra prediction mode index of the vertical mode, intra prediction modes with indexes decreased by 2 from the intra prediction mode index of the horizontal mode, intra prediction modes with indexes decreased by 1 from the intra prediction mode index of the horizontal mode, intra prediction modes with indexes obtained by averaging and rounding off 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 one 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 types of intra prediction modes of neighboring blocks of the current block. Specifically, the additional mode set may differ depending on whether the intra prediction modes of the neighboring blocks are angular modes or non-angular modes such as DC mode or planar mode.

[0302] If the candidate intra prediction modes adaptively configured according to the shape of the current block are applied as described above, the intra prediction mode of a neighboring block is not included in the intra prediction modes applied to the current block. According to this embodiment, if the shape of a neighboring block adjacent to the left or above 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 above is not included in the candidate intra prediction modes of the current block, the intra prediction mode of the neighboring block adjacent to the left or above may be replaced with the intra prediction mode having the closest direction among the candidate intra prediction modes of the current block. Furthermore, according to this embodiment, if the shape of a neighboring block adjacent to the left or above 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 above is not included in the candidate intra prediction modes of the current block, the intra prediction mode of the neighboring block adjacent to the left or above may be replaced with the intra prediction mode indicating the direction closest to the direction 180° reversed from the direction indicated by the intra prediction mode of the neighboring block adjacent to the left or above.

[0303] 31, it is assumed that an upper peripheral block 3110 has a rectangular shape with its width greater than its height, and the intra prediction mode of the upper peripheral block 3110 indicates a direction 3115 between 0° and 45°, while a left peripheral block 3120 has a rectangular shape with its height 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 modes of the upper peripheral block 3110 and the left peripheral block 3120 indicate directions outside the ranges of -135° to -180° and 45° to 180°, and therefore are not included in the first intra prediction mode candidates of the current block 3100. Thus, when configuring an MPM, if the types of the surrounding blocks and the current block are different and the candidate intra prediction modes are different, the intra prediction mode of the surrounding blocks may be replaced with the intra prediction mode having the most similar direction among the candidate intra prediction modes applied to the current block. For example, in FIG. 31, the intra prediction mode of the top surrounding block 3110 may be replaced with the intra prediction mode indicating a 45° direction 3116 instead of the direction 3115 between 0° and 45°, and the intra prediction mode of the left surrounding block 3120 may be replaced with the intra prediction mode indicating a −135° direction 3126 instead of the direction 3125 between −90° and −135°.

[0304] According to another embodiment, if the intra prediction mode of a neighboring block is not included in the candidate intra prediction modes 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 neighboring block. For example, referring to FIG. 31, the intra prediction mode of the upper neighboring block 3110 may be determined to be 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 candidate intra prediction modes of the current block 3100, the intra prediction mode indicating a direction most similar to the 180° inverted direction among the candidate intra prediction modes of the current block 3100 may be determined to be the intra prediction mode of the upper neighboring block 3110.

[0305] Even if there is a difference in the 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 will understand that the present disclosure can be embodied in various modified forms without departing from the essential characteristics of the present disclosure. Therefore, the disclosed embodiments should be considered from an illustrative rather than a restrictive perspective. The scope of the present disclosure is defined by the claims, not the foregoing description, and all differences within the scope of the claims should be construed as being within the scope of the present disclosure.

[0307] The above-described embodiments of the present disclosure can be created as a computer-executable program and can be implemented in a general-purpose digital computer that runs the program using a computer-readable recording medium. Computer-readable recording media include 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; When the current block has a non-square shape in which the width is greater than the height and the prediction direction indicated by the intra prediction mode information is −135°, 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 in which the height is greater than the width and the prediction direction indicated by the intra prediction mode information is 45°, 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; performing intra prediction according to the determined intra prediction mode of the current block to obtain predicted samples of pixels 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; 1. 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 width is greater than height and the intra prediction mode indicates a direction greater than 45°; determining a prediction direction of the intra prediction mode information as 45° when the current block has a non-square shape in which the height is greater than the width and the intra prediction mode indicates a direction less than −135°; obtaining residual samples corresponding to differences between pixel values ​​of the current block and predicted samples of pixels included in the current block based on the intra prediction mode; encoding the residual samples and the intra-prediction mode information; A video encoding method comprising:

3. 1. A device for generating and transmitting a bitstream, the device comprising: Memory and generating the bitstream by performing the video encoding method of claim 2; transmitting the bitstream to a video decoding device; at least one processor configured to: A device comprising:

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